Skip to content

Commit

Permalink
Merge pull request #92430 from rafiss/backport22.1-92408
Browse files Browse the repository at this point in the history
release-22.1: sql: fix implicit txn flag in console
  • Loading branch information
rafiss committed Nov 24, 2022
2 parents 53c4cba + 0eb28f9 commit 1ad7c22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/sql/conn_executor_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ func (ex *connExecutor) dispatchToExecutionEngine(
// defer is a catch-all in case some other return path is taken.
defer planner.curPlan.close(ctx)

if planner.autoCommit {
if planner.extendedEvalCtx.TxnImplicit {
planner.curPlan.flags.Set(planFlagImplicitTxn)
}

Expand Down
13 changes: 7 additions & 6 deletions pkg/sql/logictest/testdata/logic_test/statement_statistics
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ select 1, 2; select 1, 2, 3; select 'ok'
statement ok
SET application_name = ''

query T
SELECT txn_fingerprint_id FROM crdb_internal.node_statement_statistics WHERE application_name = 'multi_stmts_test' ORDER BY txn_fingerprint_id
query TTB
SELECT txn_fingerprint_id, key, implicit_txn FROM crdb_internal.node_statement_statistics WHERE application_name = 'multi_stmts_test' ORDER BY txn_fingerprint_id
----
10413021493801724718
10413021493801724718
10413021493801724718
17854018046052698166
10659166962890673102 SELECT '_' true
10659166962890673102 SELECT _, _ true
10659166962890673102 SELECT _, _, _ true
17854018046052698166 SET application_name = '_' true

statement ok
CREATE TABLE test(x INT, y INT, z INT); INSERT INTO test(x, y, z) VALUES (0,0,0);
Expand Down Expand Up @@ -258,6 +258,7 @@ SELECT key, implicit_txn
----
key implicit_txn
SELECT _ false
SELECT _ true
SELECT x FROM test WHERE y = _ false
SELECT x FROM test WHERE y = _ false
SELECT x FROM test WHERE y = _ true
Expand Down

0 comments on commit 1ad7c22

Please sign in to comment.