Skip to content

Commit 95e5f6b

Browse files
committed
sql: revert disabling buffered writes for EXPLAIN of a DDL
This is no longer needed as of fad25b4. Release note: None
1 parent 33254c8 commit 95e5f6b

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

pkg/sql/conn_executor_ddl.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,6 @@ func (ex *connExecutor) maybeAdjustTxnForDDL(ctx context.Context, stmt Statement
8787
return txnSchemaChangeErr
8888
}
8989
}
90-
}
91-
// For buffered writes, we need to check for DDL statements as well as EXPLAIN
92-
// with DDL statements to avoid errors with the declarative schema changer
93-
// (see #144274).
94-
ast := tree.UnwrapExplain(stmt.AST)
95-
if tree.CanModifySchema(ast) {
9690
if ex.state.mu.txn.BufferedWritesEnabled() {
9791
ex.state.mu.txn.SetBufferedWritesEnabled(false /* enabled */)
9892
p.BufferClientNotice(ctx, pgnotice.Newf("disabling buffered writes on the current txn due to schema change"))

pkg/sql/sem/tree/stmt.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -209,18 +209,6 @@ func ReturnsAtMostOneRow(stmt Statement) bool {
209209

210210
}
211211

212-
// UnwrapExplain returns the inner statement if the outer statement is an EXPLAIN
213-
// or EXPLAIN ANALYZE statement. Otherwise, it just returns the original statemnt.
214-
func UnwrapExplain(stmt Statement) Statement {
215-
switch t := stmt.(type) {
216-
case *Explain:
217-
return t.Statement
218-
case *ExplainAnalyze:
219-
return t.Statement
220-
}
221-
return stmt
222-
}
223-
224212
// HiddenFromShowQueries is a pseudo-interface to be implemented
225213
// by statements that should not show up in SHOW QUERIES (and are hence
226214
// not cancellable using CANCEL QUERIES either). Usually implemented by

0 commit comments

Comments
 (0)