Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-22.1: sql: fix implicit txn flag in console #92430

Merged
merged 1 commit into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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