diff --git a/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/ClientSideStatements.json b/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/ClientSideStatements.json index 20d7522961d..393e244038e 100644 --- a/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/ClientSideStatements.json +++ b/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/ClientSideStatements.json @@ -449,11 +449,11 @@ "statementType": "SET_STATEMENT_TAG", "regex": "(?is)\\A\\s*set\\s+statement_tag\\s*(?:=)\\s*(.*)\\z", "method": "statementSetStatementTag", - "exampleStatements": ["set statement_tag='tag1'", "set statement_tag='tag2'", "set statement_tag=''"], + "exampleStatements": ["set statement_tag='tag1'", "set statement_tag='tag2'", "set statement_tag=''", "set statement_tag='test_tag'"], "setStatement": { "propertyName": "STATEMENT_TAG", "separator": "=", - "allowedValues": "'(([a-zA-Z][a-zA-Z0-9_\\-]{1,63})|())'", + "allowedValues": "'(.*)'", "converterName": "ClientSideStatementValueConverters$StringValueConverter" } }, @@ -464,12 +464,12 @@ "statementType": "SET_TRANSACTION_TAG", "regex": "(?is)\\A\\s*set\\s+transaction_tag\\s*(?:=)\\s*(.*)\\z", "method": "statementSetTransactionTag", - "exampleStatements": ["set transaction_tag='tag1'", "set transaction_tag='tag2'", "set transaction_tag=''"], + "exampleStatements": ["set transaction_tag='tag1'", "set transaction_tag='tag2'", "set transaction_tag=''", "set transaction_tag='test_tag'"], "examplePrerequisiteStatements": ["set autocommit = false"], "setStatement": { "propertyName": "TRANSACTION_TAG", "separator": "=", - "allowedValues": "'(([a-zA-Z][a-zA-Z0-9_\\-]{1,63})|())'", + "allowedValues": "'(.*)'", "converterName": "ClientSideStatementValueConverters$StringValueConverter" } }, diff --git a/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/PG_ClientSideStatements.json b/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/PG_ClientSideStatements.json index bd04b725c29..dcbf15c09ea 100644 --- a/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/PG_ClientSideStatements.json +++ b/google-cloud-spanner/src/main/resources/com/google/cloud/spanner/connection/PG_ClientSideStatements.json @@ -621,12 +621,13 @@ "set spanner.statement_tag=''", "set spanner.statement_tag to 'tag1'", "set spanner.statement_tag to 'tag2'", - "set spanner.statement_tag to ''" + "set spanner.statement_tag to ''", + "set spanner.statement_tag to 'test_tag'" ], "setStatement": { "propertyName": "SPANNER.STATEMENT_TAG", "separator": "(?:=|\\s+TO\\s+)", - "allowedValues": "'(([a-zA-Z][a-zA-Z0-9_\\-]{1,63})|())'", + "allowedValues": "'(.*)'", "converterName": "ClientSideStatementValueConverters$StringValueConverter" } }, @@ -643,13 +644,14 @@ "set spanner.transaction_tag=''", "set spanner.transaction_tag to 'tag1'", "set spanner.transaction_tag to 'tag2'", - "set spanner.transaction_tag to ''" + "set spanner.transaction_tag to ''", + "set spanner.transaction_tag to 'test_tag'" ], "examplePrerequisiteStatements": ["set autocommit = false"], "setStatement": { "propertyName": "SPANNER.TRANSACTION_TAG", "separator": "(?:=|\\s+TO\\s+)", - "allowedValues": "'(([a-zA-Z][a-zA-Z0-9_\\-]{1,63})|())'", + "allowedValues": "'(.*)'", "converterName": "ClientSideStatementValueConverters$StringValueConverter" } }, diff --git a/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ClientSideStatementsTest.sql b/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ClientSideStatementsTest.sql index 878408a5fa1..b8183a6c944 100644 --- a/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ClientSideStatementsTest.sql +++ b/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ClientSideStatementsTest.sql @@ -15965,6 +15965,204 @@ NEW_CONNECTION; @EXPECT EXCEPTION INVALID_ARGUMENT set/-statement_tag=''; NEW_CONNECTION; +set statement_tag='test_tag'; +NEW_CONNECTION; +SET STATEMENT_TAG='TEST_TAG'; +NEW_CONNECTION; +set statement_tag='test_tag'; +NEW_CONNECTION; + set statement_tag='test_tag'; +NEW_CONNECTION; + set statement_tag='test_tag'; +NEW_CONNECTION; + + + +set statement_tag='test_tag'; +NEW_CONNECTION; +set statement_tag='test_tag' ; +NEW_CONNECTION; +set statement_tag='test_tag' ; +NEW_CONNECTION; +set statement_tag='test_tag' + +; +NEW_CONNECTION; +set statement_tag='test_tag'; +NEW_CONNECTION; +set statement_tag='test_tag'; +NEW_CONNECTION; +set +statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +foo set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag' bar; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +%set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'%; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set%statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +_set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'_; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set_statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +&set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'&; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set&statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +$set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'$; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set$statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +@set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'@; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set@statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +!set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'!; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set!statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +*set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'*; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set*statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +(set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'(; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set(statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +)set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'); +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set)statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +-set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'-; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set-statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT ++set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'+; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set+statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +-#set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'-#; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set-#statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +/set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'/; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set/statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +\set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'\; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set\statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +?set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'?; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set?statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +-/set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'-/; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set-/statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +/#set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'/#; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set/#statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +/-set statement_tag='test_tag'; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set statement_tag='test_tag'/-; +NEW_CONNECTION; +@EXPECT EXCEPTION INVALID_ARGUMENT +set/-statement_tag='test_tag'; +NEW_CONNECTION; set autocommit = false; set transaction_tag='tag1'; NEW_CONNECTION; @@ -16763,6 +16961,272 @@ set autocommit = false; @EXPECT EXCEPTION INVALID_ARGUMENT set/-transaction_tag=''; NEW_CONNECTION; +set autocommit = false; +set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +SET TRANSACTION_TAG='TEST_TAG'; +NEW_CONNECTION; +set autocommit = false; +set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; + set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; + set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; + + + +set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +set transaction_tag='test_tag' ; +NEW_CONNECTION; +set autocommit = false; +set transaction_tag='test_tag' ; +NEW_CONNECTION; +set autocommit = false; +set transaction_tag='test_tag' + +; +NEW_CONNECTION; +set autocommit = false; +set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +set +transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +foo set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag' bar; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +%set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'%; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set%transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +_set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'_; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set_transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +&set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'&; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set&transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +$set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'$; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set$transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +@set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'@; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set@transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +!set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'!; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set!transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +*set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'*; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set*transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +(set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'(; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set(transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +)set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'); +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set)transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'-; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set-transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT ++set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'+; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set+transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-#set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'-#; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set-#transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'/; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set/transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +\set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'\; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set\transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +?set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'?; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set?transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +-/set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'-/; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set-/transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/#set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'/#; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set/#transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +/-set transaction_tag='test_tag'; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set transaction_tag='test_tag'/-; +NEW_CONNECTION; +set autocommit = false; +@EXPECT EXCEPTION INVALID_ARGUMENT +set/-transaction_tag='test_tag'; +NEW_CONNECTION; set rpc_priority='HIGH'; NEW_CONNECTION; SET RPC_PRIORITY='HIGH'; diff --git a/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ConnectionImplGeneratedSqlScriptTest.sql b/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ConnectionImplGeneratedSqlScriptTest.sql index 087b2a9acad..afd36776317 100644 --- a/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ConnectionImplGeneratedSqlScriptTest.sql +++ b/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/ConnectionImplGeneratedSqlScriptTest.sql @@ -1,23 +1,23 @@ NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -26,125 +26,123 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +COMMIT; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +COMMIT; ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET READONLY=FALSE; @EXPECT RESULT_SET 'READONLY',FALSE SHOW VARIABLE READONLY; @@ -153,60 +151,58 @@ SET READONLY=TRUE; SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:19.121000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:19.121000000Z' +SET AUTOCOMMIT=FALSE; +COMMIT; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:45.964000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:45.964000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:19.121000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:19.121000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:45.964000000Z'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -221,34 +217,34 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -257,8 +253,8 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -301,46 +297,45 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +COMMIT; COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; BEGIN TRANSACTION; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -351,36 +346,28 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -389,173 +376,123 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; -@EXPECT RESULT_SET 'READ_TIMESTAMP' +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET READONLY=FALSE; @EXPECT RESULT_SET 'READONLY',FALSE SHOW VARIABLE READONLY; @@ -564,78 +501,58 @@ SET READONLY=TRUE; SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:19.478000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:19.478000000Z' +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.090000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.090000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:19.478000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:19.478000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.090000000Z'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -650,48 +567,34 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -700,10 +603,8 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -746,62 +647,45 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; BEGIN TRANSACTION; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -812,207 +696,324 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; +SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +ROLLBACK; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET READONLY=FALSE; +@EXPECT RESULT_SET 'READONLY',FALSE +SHOW VARIABLE READONLY; +SET READONLY=TRUE; +@EXPECT RESULT_SET 'READONLY',TRUE +SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:19.808000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:19.808000000Z' +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.188000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.188000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:19.808000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.188000000Z'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -1027,34 +1028,55 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -NEW_CONNECTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; +NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -1063,8 +1085,11 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -1107,71 +1132,116 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; BEGIN TRANSACTION; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -1180,125 +1250,195 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'READ_TIMESTAMP' SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET READONLY=FALSE; @EXPECT RESULT_SET 'READONLY',FALSE SHOW VARIABLE READONLY; @@ -1307,60 +1447,85 @@ SET READONLY=TRUE; SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:20.055000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:20.055000000Z' +COMMIT; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.289000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.289000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:20.055000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:20.055000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.289000000Z'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -1375,34 +1540,55 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -1411,8 +1597,11 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -1455,46 +1644,69 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; BEGIN TRANSACTION; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -1505,217 +1717,208 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; +BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'READ_TIMESTAMP' +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -SET READONLY=FALSE; -@EXPECT RESULT_SET 'READONLY',FALSE -SHOW VARIABLE READONLY; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READONLY=TRUE; -@EXPECT RESULT_SET 'READONLY',TRUE -SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:20.470000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:20.470000000Z' +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.382000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.382000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:20.470000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:20.470000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.382000000Z'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -1730,34 +1933,34 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -1766,8 +1969,8 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -1810,230 +2013,282 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'READ_TIMESTAMP',null +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT RESULT_SET 'READ_TIMESTAMP' SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READONLY=FALSE; -@EXPECT RESULT_SET 'READONLY',FALSE -SHOW VARIABLE READONLY; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READONLY=TRUE; -@EXPECT RESULT_SET 'READONLY',TRUE -SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='STRONG'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:20.734000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:20.734000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.455000000Z'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:20.734000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:20.734000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.455000000Z'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null -SHOW VARIABLE COMMIT_RESPONSE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null +SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -2048,27 +2303,41 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -2077,7 +2346,9 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -2120,254 +2391,254 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; -@EXPECT RESULT_SET 'READ_TIMESTAMP',null +SELECT 1 AS TEST; +@EXPECT RESULT_SET 'READ_TIMESTAMP' SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; -SET READONLY=FALSE; -@EXPECT RESULT_SET 'READONLY',FALSE -SHOW VARIABLE READONLY; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READONLY=TRUE; -@EXPECT RESULT_SET 'READONLY',TRUE -SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='STRONG'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:20.932000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:20.932000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.532000000Z'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:20.932000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.532000000Z'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -2383,33 +2654,33 @@ SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -2419,7 +2690,7 @@ SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -2463,76 +2734,66 @@ SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; -BEGIN TRANSACTION; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -2542,122 +2803,98 @@ SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; ROLLBACK; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET READONLY=FALSE; @EXPECT RESULT_SET 'READONLY',FALSE SHOW VARIABLE READONLY; @@ -2667,57 +2904,48 @@ SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:21.099000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:21.099000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.605000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.605000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:21.099000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.605000000Z'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -2733,33 +2961,26 @@ SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -2769,7 +2990,6 @@ SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -2813,44 +3033,36 @@ SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; COMMIT; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; BEGIN TRANSACTION; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -2862,39 +3074,26 @@ BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -2902,196 +3101,134 @@ SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 +COMMIT; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; -ROLLBACK; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 +COMMIT; +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; -ROLLBACK; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; ROLLBACK; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET READONLY=FALSE; @EXPECT RESULT_SET 'READONLY',FALSE SHOW VARIABLE READONLY; @@ -3099,86 +3236,59 @@ SET READONLY=TRUE; @EXPECT RESULT_SET 'READONLY',TRUE SHOW VARIABLE READONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:21.259000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:21.259000000Z' +COMMIT; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.688000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.688000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:21.259000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.688000000Z'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -3192,56 +3302,35 @@ SET OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -3249,12 +3338,9 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -3296,117 +3382,84 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; BEGIN TRANSACTION; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -3414,196 +3467,182 @@ SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; -@EXPECT RESULT_SET 'READ_TIMESTAMP' +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; +@EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; -COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; -COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; ROLLBACK; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET READONLY=FALSE; @EXPECT RESULT_SET 'READONLY',FALSE SHOW VARIABLE READONLY; @@ -3611,86 +3650,77 @@ SET READONLY=TRUE; @EXPECT RESULT_SET 'READONLY',TRUE SHOW VARIABLE READONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:21.436000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:21.436000000Z' +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.755000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.755000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:21.436000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.755000000Z'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -3704,56 +3734,49 @@ SET OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; -NEW_CONNECTION; -SET READONLY=TRUE; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; +NEW_CONNECTION; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -3761,12 +3784,11 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -3808,282 +3830,305 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; BEGIN TRANSACTION; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); ABORT BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -NEW_CONNECTION; -SET READONLY=TRUE; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +NEW_CONNECTION; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET READONLY=TRUE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='STRONG'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:21.587000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:21.587000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.825000000Z'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:21.587000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.825000000Z'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -4097,35 +4142,42 @@ SET OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -4133,9 +4185,10 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -4177,283 +4230,255 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS' +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; ABORT BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'TEST',1 +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'READ_TIMESTAMP' +START BATCH DDL; +@EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET READONLY=TRUE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='STRONG'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:21.769000000Z'; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.881000000Z'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:21.769000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.881000000Z'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -4467,42 +4492,35 @@ SET OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -4510,10 +4528,9 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -4555,255 +4572,378 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS' +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'READ_TIMESTAMP' SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +COMMIT; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +COMMIT; +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; ROLLBACK; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; +SET READONLY=FALSE; +@EXPECT RESULT_SET 'READONLY',FALSE +SHOW VARIABLE READONLY; SET READONLY=TRUE; +@EXPECT RESULT_SET 'READONLY',TRUE +SHOW VARIABLE READONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET READ_ONLY_STALENESS='STRONG'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:21.960000000Z'; +COMMIT; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.940000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.940000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:21.960000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.940000000Z'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -4817,35 +4957,56 @@ SET OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -4853,9 +5014,12 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -4897,220 +5061,279 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +COMMIT; +BEGIN TRANSACTION; SELECT 1 AS TEST; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET READONLY=TRUE; -SET AUTOCOMMIT=FALSE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; SET TRANSACTION READ ONLY; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET TRANSACTION READ ONLY; SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; ROLLBACK; NEW_CONNECTION; -SET READONLY=TRUE; -SET AUTOCOMMIT=FALSE; SET READONLY=FALSE; -@EXPECT RESULT_SET 'READONLY',FALSE -SHOW VARIABLE READONLY; +SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READONLY=TRUE; -@EXPECT RESULT_SET 'READONLY',TRUE -SHOW VARIABLE READONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:22.101000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:22.101000000Z' +SET TRANSACTION READ ONLY; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.009000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.009000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:22.101000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.009000000Z'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -5124,28 +5347,35 @@ SET OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -5153,8 +5383,9 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -5196,243 +5427,267 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; COMMIT; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=TRUE; +SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; +SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET READONLY=FALSE; +@EXPECT RESULT_SET 'READONLY',FALSE +SHOW VARIABLE READONLY; +SET READONLY=TRUE; +@EXPECT RESULT_SET 'READONLY',TRUE +SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET READ_ONLY_STALENESS='STRONG'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:22.206000000Z'; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.061000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.061000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:22.206000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.061000000Z'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -5447,34 +5702,34 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -5483,8 +5738,8 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -5527,284 +5782,381 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +BEGIN TRANSACTION; +SELECT 1 AS TEST; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; +SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET READONLY=FALSE; +@EXPECT RESULT_SET 'READONLY',FALSE +SHOW VARIABLE READONLY; +SET READONLY=TRUE; +@EXPECT RESULT_SET 'READONLY',TRUE +SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:22.306000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:22.306000000Z' +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.119000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.119000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:22.306000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.119000000Z'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -5819,41 +6171,55 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -5862,9 +6228,11 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -5907,87 +6275,113 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; +BEGIN TRANSACTION; +SELECT 1 AS TEST; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE @@ -5997,150 +6391,166 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; -@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL' -SHOW VARIABLE AUTOCOMMIT_DML_MODE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; -@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' -SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -6152,9 +6562,10 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -6166,17 +6577,18 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET READONLY=FALSE; @EXPECT RESULT_SET 'READONLY',FALSE @@ -6186,77 +6598,84 @@ SET READONLY=TRUE; SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:22.480000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:22.480000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.220000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.220000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:22.480000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:22.480000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.220000000Z'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP' SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' @@ -6272,47 +6691,54 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP' SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' @@ -6322,9 +6748,10 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' @@ -6368,61 +6795,67 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; BEGIN TRANSACTION; SELECT 1 AS TEST; @@ -6433,137 +6866,138 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -6575,68 +7009,68 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READONLY=FALSE; +SET READONLY=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:22.662000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:22.662000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.290000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.290000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:22.662000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.290000000Z'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' @@ -6652,33 +7086,33 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' @@ -6688,7 +7122,7 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' @@ -6732,193 +7166,206 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT UPDATE_COUNT 1 -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT UPDATE_COUNT 1 +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; -@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL' -SHOW VARIABLE AUTOCOMMIT_DML_MODE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; -@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' -SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -6929,76 +7376,76 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -SET READONLY=FALSE; -@EXPECT RESULT_SET 'READONLY',FALSE -SHOW VARIABLE READONLY; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READONLY=TRUE; -@EXPECT RESULT_SET 'READONLY',TRUE -SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='STRONG'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:22.808000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:22.808000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.348000000Z'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:22.808000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:22.808000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.348000000Z'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -7013,34 +7460,41 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -7049,8 +7503,9 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -7093,200 +7548,190 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -BEGIN TRANSACTION; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; -@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL' -SHOW VARIABLE AUTOCOMMIT_DML_MODE; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; -@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' -SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -7297,76 +7742,65 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -SET READONLY=FALSE; -@EXPECT RESULT_SET 'READONLY',FALSE -SHOW VARIABLE READONLY; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READONLY=TRUE; -@EXPECT RESULT_SET 'READONLY',TRUE -SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='STRONG'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:22.962000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:22.962000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.416000000Z'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:22.962000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:22.962000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.416000000Z'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -@EXPECT RESULT_SET 'COMMIT_TIMESTAMP' +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -7381,34 +7815,34 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -@EXPECT RESULT_SET 'COMMIT_TIMESTAMP' +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -7417,8 +7851,8 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -7461,81 +7895,67 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -BEGIN TRANSACTION; +SET AUTOCOMMIT=FALSE; SELECT 1 AS TEST; -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -7544,130 +7964,83 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; -@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL' -SHOW VARIABLE AUTOCOMMIT_DML_MODE; +SET AUTOCOMMIT=FALSE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; -@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' -SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'READ_TIMESTAMP' +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -7678,9 +8051,7 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -7691,16 +8062,11 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET READONLY=FALSE; @EXPECT RESULT_SET 'READONLY',FALSE SHOW VARIABLE READONLY; @@ -7709,69 +8075,49 @@ SET READONLY=TRUE; SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:23.132000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:23.132000000Z' +SET AUTOCOMMIT=FALSE; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.475000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.475000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:23.132000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:23.132000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.475000000Z'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -7786,41 +8132,27 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -7829,9 +8161,7 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -7874,54 +8204,36 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SELECT 1 AS TEST; UPDATE foo SET bar=1; @@ -7931,232 +8243,201 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT UPDATE_COUNT 1 +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; -@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL' -SHOW VARIABLE AUTOCOMMIT_DML_MODE; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; -@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' -SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'TEST',1 +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'READ_TIMESTAMP' +START BATCH DDL; +@EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READONLY=FALSE; -@EXPECT RESULT_SET 'READONLY',FALSE -SHOW VARIABLE READONLY; -SET READONLY=TRUE; -@EXPECT RESULT_SET 'READONLY',TRUE -SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='STRONG'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:23.314000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:23.314000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.523000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:23.314000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:23.314000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.523000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -8172,33 +8453,33 @@ SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -8208,7 +8489,7 @@ SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -8252,242 +8533,283 @@ SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS' +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -@EXPECT UPDATE_COUNT 1 +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; -@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL' -SHOW VARIABLE AUTOCOMMIT_DML_MODE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; -@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' -SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -@EXPECT EXCEPTION FAILED_PRECONDITION +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -@EXPECT EXCEPTION FAILED_PRECONDITION +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -@EXPECT EXCEPTION FAILED_PRECONDITION +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READONLY=FALSE; -@EXPECT RESULT_SET 'READONLY',FALSE -SHOW VARIABLE READONLY; -SET READONLY=TRUE; -@EXPECT RESULT_SET 'READONLY',TRUE -SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:23.477000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:23.477000000Z' +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.574000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.574000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:23.477000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:23.477000000Z' -SHOW VARIABLE READ_ONLY_STALENESS; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.574000000Z'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -8503,26 +8825,40 @@ SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -8532,6 +8868,8 @@ SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -8575,66 +8913,86 @@ SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; -@EXPECT EXCEPTION FAILED_PRECONDITION +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -SELECT 1 AS TEST; -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE @@ -8644,103 +9002,150 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; +@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL' +SHOW VARIABLE AUTOCOMMIT_DML_MODE; SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; +@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' +SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -8752,7 +9157,9 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -8764,12 +9171,17 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET READONLY=FALSE; @EXPECT RESULT_SET 'READONLY',FALSE @@ -8779,57 +9191,77 @@ SET READONLY=TRUE; SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:23.602000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:23.602000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.631000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.631000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:23.602000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.631000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:47.631000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; -@EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null +@EXPECT RESULT_SET 'COMMIT_TIMESTAMP' SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' @@ -8845,33 +9277,47 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; -@EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null +@EXPECT RESULT_SET 'COMMIT_TIMESTAMP' SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' @@ -8881,7 +9327,9 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' @@ -8925,43 +9373,61 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; BEGIN TRANSACTION; SELECT 1 AS TEST; @@ -8972,198 +9438,138 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; +BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -9174,95 +9580,69 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION SET READONLY=FALSE; -@EXPECT RESULT_SET 'READONLY',FALSE -SHOW VARIABLE READONLY; -SET READONLY=TRUE; -@EXPECT RESULT_SET 'READONLY',TRUE -SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:23.741000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:23.741000000Z' +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.693000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.693000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:23.741000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.693000000Z'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -9277,48 +9657,34 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -9327,10 +9693,8 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -9373,303 +9737,272 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -SELECT 1 AS TEST; -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; +@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL' +SHOW VARIABLE AUTOCOMMIT_DML_MODE; SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; +@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' +SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +SET READONLY=FALSE; +@EXPECT RESULT_SET 'READONLY',FALSE +SHOW VARIABLE READONLY; SET READONLY=TRUE; +@EXPECT RESULT_SET 'READONLY',TRUE +SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='STRONG'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:23.906000000Z'; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.748000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.748000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:23.906000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.748000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:47.748000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' @@ -9685,40 +10018,33 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' @@ -9728,8 +10054,7 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' @@ -9773,254 +10098,280 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +BEGIN TRANSACTION; +SELECT 1 AS TEST; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; +@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL' +SHOW VARIABLE AUTOCOMMIT_DML_MODE; SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; +@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' +SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +SET READONLY=FALSE; +@EXPECT RESULT_SET 'READONLY',FALSE +SHOW VARIABLE READONLY; SET READONLY=TRUE; +@EXPECT RESULT_SET 'READONLY',TRUE +SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET READ_ONLY_STALENESS='STRONG'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:24.025000000Z'; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.806000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.806000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:24.025000000Z'; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.806000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:47.806000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'COMMIT_TIMESTAMP' SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -10035,34 +10386,34 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'COMMIT_TIMESTAMP' SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -10071,8 +10422,8 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -10115,83 +10466,81 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +BEGIN TRANSACTION; +SELECT 1 AS TEST; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -10200,167 +10549,130 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; +@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL' +SHOW VARIABLE AUTOCOMMIT_DML_MODE; SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; +@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' +SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'READ_TIMESTAMP' SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -10371,11 +10683,9 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -10386,19 +10696,16 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET READONLY=FALSE; @EXPECT RESULT_SET 'READONLY',FALSE SHOW VARIABLE READONLY; @@ -10407,85 +10714,69 @@ SET READONLY=TRUE; SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:24.143000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:24.143000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.863000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.863000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:24.143000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.863000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:47.863000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -10500,55 +10791,41 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -10557,11 +10834,9 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -10604,68 +10879,54 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; BEGIN TRANSACTION; SELECT 1 AS TEST; UPDATE foo SET bar=1; @@ -10675,207 +10936,232 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; +@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL' +SHOW VARIABLE AUTOCOMMIT_DML_MODE; SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; +@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' +SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT RESULT_SET 'READ_TIMESTAMP',null +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +@EXPECT RESULT_SET 'READ_TIMESTAMP' SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +SET READONLY=FALSE; +@EXPECT RESULT_SET 'READONLY',FALSE +SHOW VARIABLE READONLY; SET READONLY=TRUE; +@EXPECT RESULT_SET 'READONLY',TRUE +SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:24.282000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:24.282000000Z' +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.924000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.924000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:24.282000000Z'; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.924000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:47.924000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -10890,34 +11176,34 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -10926,8 +11212,8 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -10970,71 +11256,73 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +BEGIN TRANSACTION; +SELECT 1 AS TEST; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -11043,104 +11331,88 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; +@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL' +SHOW VARIABLE AUTOCOMMIT_DML_MODE; SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; +@EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' +SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -11151,8 +11423,7 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); START BATCH DDL; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -11163,13 +11434,12 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET READONLY=FALSE; @EXPECT RESULT_SET 'READONLY',FALSE SHOW VARIABLE READONLY; @@ -11178,58 +11448,51 @@ SET READONLY=TRUE; SHOW VARIABLE READONLY; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:24.383000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:24.383000000Z' +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.985000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.985000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:24.383000000Z'; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.985000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:47.985000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -11244,34 +11507,27 @@ SET OPTIMIZER_VERSION=''; SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -11280,8 +11536,7 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -11324,44 +11579,38 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SELECT 1 AS TEST; UPDATE foo SET bar=1; @@ -11371,40 +11620,27 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -11412,206 +11648,126 @@ SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -@EXPECT UPDATE_COUNT 1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET READONLY=FALSE; @EXPECT RESULT_SET 'READONLY',FALSE SHOW VARIABLE READONLY; @@ -11619,86 +11775,61 @@ SET READONLY=TRUE; @EXPECT RESULT_SET 'READONLY',TRUE SHOW VARIABLE READONLY; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:24.512000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:24.512000000Z' +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:48.034000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:48.034000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:24.512000000Z'; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:48.034000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:48.034000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' +SHOW VARIABLE READ_ONLY_STALENESS; +NEW_CONNECTION; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -11712,56 +11843,35 @@ SET OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -11769,12 +11879,9 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -11816,113 +11923,85 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; BEGIN TRANSACTION; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET AUTOCOMMIT=FALSE; @@ -11932,204 +12011,172 @@ SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -@EXPECT UPDATE_COUNT 1 +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -@EXPECT RESULT_SET 'READ_TIMESTAMP',null +@EXPECT RESULT_SET 'READ_TIMESTAMP' SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET READONLY=FALSE; @@ -12139,84 +12186,77 @@ SET READONLY=TRUE; @EXPECT RESULT_SET 'READONLY',TRUE SHOW VARIABLE READONLY; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:24.703000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:24.703000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:48.085000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:48.085000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:24.703000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:48.085000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:48.085000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -@EXPECT RESULT_SET 'COMMIT_TIMESTAMP' +@EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET OPTIMIZER_VERSION='1'; @@ -12232,54 +12272,47 @@ SET OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -@EXPECT RESULT_SET 'COMMIT_TIMESTAMP' +@EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @@ -12289,10 +12322,9 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET STATEMENT_TIMEOUT='1s'; @@ -12336,283 +12368,273 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; BEGIN TRANSACTION; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET AUTOCOMMIT=TRUE; -NEW_CONNECTION; -SET READONLY=FALSE; SET AUTOCOMMIT=FALSE; +NEW_CONNECTION; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT UPDATE_COUNT 1 +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; ROLLBACK; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READONLY=TRUE; -NEW_CONNECTION; SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +NEW_CONNECTION; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:24.875000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:24.875000000Z' +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:48.146000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:48.146000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:24.875000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:48.146000000Z'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' @@ -12627,34 +12649,34 @@ SET OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' @@ -12663,8 +12685,8 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' @@ -12707,286 +12729,260 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT UPDATE_COUNT 1 +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT RESULT_SET 'READ_TIMESTAMP',null +@EXPECT RESULT_SET 'READ_TIMESTAMP' SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET READONLY=FALSE; +@EXPECT RESULT_SET 'READONLY',FALSE +SHOW VARIABLE READONLY; SET READONLY=TRUE; +@EXPECT RESULT_SET 'READONLY',TRUE +SHOW VARIABLE READONLY; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='STRONG'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:24.992000000Z'; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:48.232000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:48.232000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:24.992000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:48.232000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:48.232000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' @@ -13001,41 +12997,34 @@ SET OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' @@ -13044,9 +13033,8 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' @@ -13089,259 +13077,267 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +BEGIN TRANSACTION; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT UPDATE_COUNT 1 +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT RESULT_SET 'READ_TIMESTAMP',null +@EXPECT RESULT_SET 'READ_TIMESTAMP' SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SELECT 1 AS TEST; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET READONLY=FALSE; +@EXPECT RESULT_SET 'READONLY',FALSE +SHOW VARIABLE READONLY; SET READONLY=TRUE; +@EXPECT RESULT_SET 'READONLY',TRUE +SHOW VARIABLE READONLY; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='STRONG'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:25.198000000Z'; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:48.288000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:48.288000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:25.198000000Z'; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:48.288000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:48.288000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' @@ -13356,34 +13352,34 @@ SET OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' @@ -13392,8 +13388,8 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' @@ -13436,68 +13432,75 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +BEGIN TRANSACTION; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'OPTIMIZER_VERSION' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -13505,110 +13508,102 @@ SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT UPDATE_COUNT 1 +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE' SHOW VARIABLE AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'READ_TIMESTAMP',null SHOW VARIABLE READ_TIMESTAMP; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET READONLY=FALSE; @EXPECT RESULT_SET 'READONLY',FALSE SHOW VARIABLE READONLY; @@ -13616,50 +13611,52 @@ SET READONLY=TRUE; @EXPECT RESULT_SET 'READONLY',TRUE SHOW VARIABLE READONLY; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:25.346000000Z'; -@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:25.346000000Z' +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:48.341000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:48.341000000Z' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:25.346000000Z'; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:48.341000000Z'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:48.341000000Z' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_RESPONSE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1' SHOW VARIABLE OPTIMIZER_VERSION; @@ -13673,28 +13670,28 @@ SET OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'OPTIMIZER_VERSION','' SHOW VARIABLE OPTIMIZER_VERSION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null SHOW VARIABLE COMMIT_TIMESTAMP; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; @@ -13702,8 +13699,8 @@ SET OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -13745,44 +13742,47 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'READ_ONLY_STALENESS' SHOW VARIABLE READ_ONLY_STALENESS; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET READONLY=TRUE; +SET AUTOCOMMIT=TRUE; diff --git a/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/postgresql/ConnectionImplGeneratedSqlScriptTest.sql b/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/postgresql/ConnectionImplGeneratedSqlScriptTest.sql index 32f07949e9d..1757973f593 100644 --- a/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/postgresql/ConnectionImplGeneratedSqlScriptTest.sql +++ b/google-cloud-spanner/src/test/resources/com/google/cloud/spanner/connection/postgresql/ConnectionImplGeneratedSqlScriptTest.sql @@ -1,23 +1,23 @@ NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -26,125 +26,123 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +COMMIT; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +COMMIT; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET SPANNER.READONLY=FALSE; @EXPECT RESULT_SET 'SPANNER.READONLY',FALSE SHOW VARIABLE SPANNER.READONLY; @@ -153,60 +151,58 @@ SET SPANNER.READONLY=TRUE; SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:19.303000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:19.303000000Z' +SET AUTOCOMMIT=FALSE; +COMMIT; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.025000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.025000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:19.303000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:19.303000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.025000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -221,34 +217,34 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -257,8 +253,8 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -301,46 +297,45 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +COMMIT; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; BEGIN TRANSACTION; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -351,36 +346,28 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -389,173 +376,123 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; -@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP' +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.READONLY=FALSE; @EXPECT RESULT_SET 'SPANNER.READONLY',FALSE SHOW VARIABLE SPANNER.READONLY; @@ -564,78 +501,58 @@ SET SPANNER.READONLY=TRUE; SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:19.659000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:19.659000000Z' +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.135000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.135000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:19.659000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:19.659000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.135000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -650,48 +567,34 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -700,10 +603,8 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -746,62 +647,45 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; BEGIN TRANSACTION; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -812,207 +696,324 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -COMMIT; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; +SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +ROLLBACK; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET SPANNER.READONLY=FALSE; +@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE +SHOW VARIABLE SPANNER.READONLY; +SET SPANNER.READONLY=TRUE; +@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE +SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:19.923000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:19.923000000Z' +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.241000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.241000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:19.923000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.241000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -1027,34 +1028,55 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -NEW_CONNECTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; +NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -1063,8 +1085,11 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -1107,71 +1132,116 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; BEGIN TRANSACTION; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -1180,125 +1250,195 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP' SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET SPANNER.READONLY=FALSE; @EXPECT RESULT_SET 'SPANNER.READONLY',FALSE SHOW VARIABLE SPANNER.READONLY; @@ -1307,60 +1447,85 @@ SET SPANNER.READONLY=TRUE; SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:20.233000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:20.233000000Z' +COMMIT; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.337000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.337000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:20.233000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:20.233000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.337000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -1375,34 +1540,55 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -1411,8 +1597,11 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -1455,46 +1644,69 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; BEGIN TRANSACTION; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -1505,217 +1717,208 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; +BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP' +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -SET SPANNER.READONLY=FALSE; -@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE -SHOW VARIABLE SPANNER.READONLY; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READONLY=TRUE; -@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE -SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:20.600000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:20.600000000Z' +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.418000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.418000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:20.600000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:20.600000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.418000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -1730,34 +1933,34 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -1766,8 +1969,8 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -1810,230 +2013,282 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP' SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READONLY=FALSE; -@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE -SHOW VARIABLE SPANNER.READONLY; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READONLY=TRUE; -@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE -SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='STRONG'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:20.834000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:20.834000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.494000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:20.834000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:20.834000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.494000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null -SHOW VARIABLE SPANNER.COMMIT_RESPONSE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null +SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -2048,27 +2303,41 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -2077,7 +2346,9 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -2120,254 +2391,254 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; -BEGIN TRANSACTION; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; -@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null +SELECT 1 AS TEST; +@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP' SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; -SET SPANNER.READONLY=FALSE; -@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE -SHOW VARIABLE SPANNER.READONLY; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READONLY=TRUE; -@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE -SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='STRONG'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:21.015000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:21.015000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.568000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:21.015000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.568000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -2383,33 +2654,33 @@ SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -2419,7 +2690,7 @@ SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -2463,76 +2734,66 @@ SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; -BEGIN TRANSACTION; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -COMMIT; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -2542,122 +2803,98 @@ SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.READONLY=FALSE; @EXPECT RESULT_SET 'SPANNER.READONLY',FALSE SHOW VARIABLE SPANNER.READONLY; @@ -2667,57 +2904,48 @@ SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:21.175000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:21.175000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.636000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.636000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:21.175000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.636000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -2733,33 +2961,26 @@ SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -2769,7 +2990,6 @@ SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -2813,44 +3033,36 @@ SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; BEGIN TRANSACTION; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -2862,39 +3074,26 @@ BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=TRUE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -2902,196 +3101,134 @@ SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 +COMMIT; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; -ROLLBACK; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 +COMMIT; +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; -ROLLBACK; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; ROLLBACK; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET SPANNER.READONLY=FALSE; @EXPECT RESULT_SET 'SPANNER.READONLY',FALSE SHOW VARIABLE SPANNER.READONLY; @@ -3099,86 +3236,59 @@ SET SPANNER.READONLY=TRUE; @EXPECT RESULT_SET 'SPANNER.READONLY',TRUE SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:21.351000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:21.351000000Z' +COMMIT; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.718000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.718000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:21.351000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.718000000Z'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -3192,56 +3302,35 @@ SET SPANNER.OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -3249,12 +3338,9 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -3296,117 +3382,84 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0' SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; BEGIN TRANSACTION; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -3414,196 +3467,182 @@ SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; -@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP' +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; +@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; -COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; -COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; ROLLBACK; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET SPANNER.READONLY=FALSE; @EXPECT RESULT_SET 'SPANNER.READONLY',FALSE SHOW VARIABLE SPANNER.READONLY; @@ -3611,86 +3650,77 @@ SET SPANNER.READONLY=TRUE; @EXPECT RESULT_SET 'SPANNER.READONLY',TRUE SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:21.518000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:21.518000000Z' +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.789000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.789000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:21.518000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.789000000Z'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -3704,56 +3734,49 @@ SET SPANNER.OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; -NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; +NEW_CONNECTION; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -3761,12 +3784,11 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -3808,282 +3830,305 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0' SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; BEGIN TRANSACTION; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -COMMIT; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); ABORT BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +NEW_CONNECTION; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READONLY=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='STRONG'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:21.677000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:21.677000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.854000000Z'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:21.677000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.854000000Z'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -4097,35 +4142,42 @@ SET SPANNER.OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -4133,9 +4185,10 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -4177,283 +4230,255 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0' SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; +START BATCH DDL; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; ABORT BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'TEST',1 +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP' +START BATCH DDL; +@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READONLY=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='STRONG'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:21.872000000Z'; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.908000000Z'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:21.872000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.908000000Z'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -4467,42 +4492,35 @@ SET SPANNER.OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -4510,10 +4528,9 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -4555,255 +4572,378 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0' SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP' SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +COMMIT; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +COMMIT; +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; ROLLBACK; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; +SET SPANNER.READONLY=FALSE; +@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE +SHOW VARIABLE SPANNER.READONLY; SET SPANNER.READONLY=TRUE; +@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE +SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET SPANNER.READ_ONLY_STALENESS='STRONG'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:22.037000000Z'; +COMMIT; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:46.975000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:46.975000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:22.037000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:46.975000000Z'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -4817,35 +4957,56 @@ SET SPANNER.OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -4853,9 +5014,12 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -4897,220 +5061,279 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0' SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +COMMIT; SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +COMMIT; +BEGIN TRANSACTION; SELECT 1 AS TEST; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; +COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; SET TRANSACTION READ ONLY; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET TRANSACTION READ ONLY; SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; ROLLBACK; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; -SET AUTOCOMMIT=FALSE; SET SPANNER.READONLY=FALSE; -@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE -SHOW VARIABLE SPANNER.READONLY; +SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READONLY=TRUE; -@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE -SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:22.154000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:22.154000000Z' +SET TRANSACTION READ ONLY; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.035000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.035000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:22.154000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.035000000Z'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -5124,28 +5347,35 @@ SET SPANNER.OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -5153,8 +5383,9 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -5196,243 +5427,267 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0' SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=TRUE; +SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; +SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.READONLY=FALSE; +@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE +SHOW VARIABLE SPANNER.READONLY; +SET SPANNER.READONLY=TRUE; +@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE +SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.READ_ONLY_STALENESS='STRONG'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:22.255000000Z'; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.088000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.088000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:22.255000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.088000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -5447,34 +5702,34 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -5483,8 +5738,8 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -5527,284 +5782,381 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +BEGIN TRANSACTION; +SELECT 1 AS TEST; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -START BATCH DDL; +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; +SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET SPANNER.READONLY=FALSE; +@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE +SHOW VARIABLE SPANNER.READONLY; +SET SPANNER.READONLY=TRUE; +@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE +SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:22.355000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:22.355000000Z' +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.171000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.171000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:22.355000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.171000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -5819,41 +6171,55 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -5862,9 +6228,11 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -5907,87 +6275,113 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; +BEGIN TRANSACTION; +SELECT 1 AS TEST; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET TRANSACTION READ ONLY; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE @@ -5997,150 +6391,166 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -SET SPANNER.AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; -@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','TRANSACTIONAL' -SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; -@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' -SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -6152,9 +6562,10 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -6166,17 +6577,18 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET SPANNER.READONLY=FALSE; @EXPECT RESULT_SET 'SPANNER.READONLY',FALSE @@ -6186,77 +6598,84 @@ SET SPANNER.READONLY=TRUE; SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:22.572000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:22.572000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.258000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.258000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:22.572000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:22.572000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.258000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP' SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' @@ -6272,47 +6691,54 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP' SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' @@ -6322,9 +6748,10 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' @@ -6368,61 +6795,67 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; BEGIN TRANSACTION; SELECT 1 AS TEST; @@ -6433,137 +6866,138 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -6575,68 +7009,68 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READONLY=FALSE; +SET SPANNER.READONLY=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:22.724000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:22.724000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.317000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.317000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:22.724000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.317000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' @@ -6652,33 +7086,33 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' @@ -6688,7 +7122,7 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' @@ -6732,193 +7166,206 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT UPDATE_COUNT 1 -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT UPDATE_COUNT 1 +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -SET SPANNER.AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; -@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','TRANSACTIONAL' -SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; -@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' -SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -6929,76 +7376,76 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -SET SPANNER.READONLY=FALSE; -@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE -SHOW VARIABLE SPANNER.READONLY; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READONLY=TRUE; -@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE -SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='STRONG'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:22.886000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:22.886000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.380000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:22.886000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:22.886000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.380000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -7013,34 +7460,41 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -7049,8 +7503,9 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -7093,200 +7548,190 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -BEGIN TRANSACTION; +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'TEST',1 +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -SET SPANNER.AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; -@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','TRANSACTIONAL' -SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; -@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' -SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -7297,76 +7742,65 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -SET SPANNER.READONLY=FALSE; -@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE -SHOW VARIABLE SPANNER.READONLY; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READONLY=TRUE; -@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE -SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='STRONG'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:23.046000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:23.046000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.447000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:23.046000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:23.046000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.447000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP' +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -7381,34 +7815,34 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP' +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; +@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -7417,8 +7851,8 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -7461,81 +7895,67 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; -BEGIN TRANSACTION; +SET AUTOCOMMIT=FALSE; SELECT 1 AS TEST; -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -UPDATE foo SET bar=1; +SET AUTOCOMMIT=FALSE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -7544,130 +7964,83 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -SET SPANNER.AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; -@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','TRANSACTIONAL' -SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; +SET AUTOCOMMIT=FALSE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; -@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' -SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP' +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -7678,9 +8051,7 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -7691,16 +8062,11 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET SPANNER.READONLY=FALSE; @EXPECT RESULT_SET 'SPANNER.READONLY',FALSE SHOW VARIABLE SPANNER.READONLY; @@ -7709,69 +8075,49 @@ SET SPANNER.READONLY=TRUE; SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:23.227000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:23.227000000Z' +SET AUTOCOMMIT=FALSE; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.499000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.499000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:23.227000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:23.227000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +SET AUTOCOMMIT=FALSE; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.499000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -7786,41 +8132,27 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -7829,9 +8161,7 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -7874,54 +8204,36 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; BEGIN TRANSACTION; SELECT 1 AS TEST; UPDATE foo SET bar=1; @@ -7931,232 +8243,201 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT UPDATE_COUNT 1 +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -SET SPANNER.AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; -@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','TRANSACTIONAL' -SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; -@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' -SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'TEST',1 +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP' +START BATCH DDL; +@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READONLY=FALSE; -@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE -SHOW VARIABLE SPANNER.READONLY; -SET SPANNER.READONLY=TRUE; -@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE -SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='STRONG'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:23.402000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:23.402000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.546000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:23.402000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:23.402000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.546000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -8172,33 +8453,33 @@ SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -8208,7 +8489,7 @@ SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -8252,242 +8533,283 @@ SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +START BATCH DDL; RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; -BEGIN TRANSACTION; -SELECT 1 AS TEST; -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SELECT 1 AS TEST; +START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; -SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -@EXPECT UPDATE_COUNT 1 +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SET SPANNER.AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; -@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','TRANSACTIONAL' -SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; -@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' -SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -@EXPECT EXCEPTION FAILED_PRECONDITION +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -@EXPECT EXCEPTION FAILED_PRECONDITION +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -@EXPECT EXCEPTION FAILED_PRECONDITION +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READONLY=FALSE; -@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE -SHOW VARIABLE SPANNER.READONLY; -SET SPANNER.READONLY=TRUE; -@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE -SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:23.535000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:23.535000000Z' +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.598000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.598000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:23.535000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-01-31T15:41:23.535000000Z' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.598000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' -SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -8503,26 +8825,40 @@ SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -8532,6 +8868,8 @@ SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -8575,66 +8913,86 @@ SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; -@EXPECT EXCEPTION FAILED_PRECONDITION +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -SELECT 1 AS TEST; -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET TRANSACTION READ ONLY; @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE @@ -8644,103 +9002,150 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; +@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','TRANSACTIONAL' +SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; +@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' +SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -8752,7 +9157,9 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION @@ -8764,12 +9171,17 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET SPANNER.READONLY=FALSE; @EXPECT RESULT_SET 'SPANNER.READONLY',FALSE @@ -8779,57 +9191,77 @@ SET SPANNER.READONLY=TRUE; SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:23.671000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:23.671000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.664000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.664000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:23.671000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.664000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:47.664000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; -@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null +@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP' SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' @@ -8845,33 +9277,47 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; -@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null +@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP' SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' @@ -8881,7 +9327,9 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' @@ -8925,43 +9373,61 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; BEGIN TRANSACTION; SELECT 1 AS TEST; @@ -8972,198 +9438,138 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +UPDATE foo SET bar=1; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE -SHOW VARIABLE AUTOCOMMIT; SET AUTOCOMMIT=TRUE; -@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE -SHOW VARIABLE AUTOCOMMIT; +BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -9174,95 +9580,69 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READONLY=FALSE; -@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE -SHOW VARIABLE SPANNER.READONLY; -SET SPANNER.READONLY=TRUE; -@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE -SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:23.829000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:23.829000000Z' +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.717000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.717000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:23.829000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.717000000Z'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -9277,48 +9657,34 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -9327,10 +9693,8 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -9373,303 +9737,272 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -SELECT 1 AS TEST; -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -RUN BATCH; +SET AUTOCOMMIT=TRUE; +BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; +@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','TRANSACTIONAL' +SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; +@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' +SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READONLY=FALSE; +@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE +SHOW VARIABLE SPANNER.READONLY; SET SPANNER.READONLY=TRUE; +@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE +SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='STRONG'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:23.965000000Z'; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.776000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.776000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:23.965000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.776000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:47.776000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' @@ -9685,40 +10018,33 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' @@ -9728,8 +10054,7 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' @@ -9773,254 +10098,280 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +BEGIN TRANSACTION; +SELECT 1 AS TEST; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +SET SPANNER.AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; +@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','TRANSACTIONAL' +SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; +@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' +SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +SET SPANNER.READONLY=FALSE; +@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE +SHOW VARIABLE SPANNER.READONLY; SET SPANNER.READONLY=TRUE; +@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE +SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET SPANNER.READ_ONLY_STALENESS='STRONG'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:24.077000000Z'; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.835000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.835000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:24.077000000Z'; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.835000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:47.835000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP' SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -10035,34 +10386,34 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP' SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -10071,8 +10422,8 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -10115,83 +10466,81 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; +BEGIN TRANSACTION; +SELECT 1 AS TEST; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; +SET AUTOCOMMIT=TRUE; +UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -10200,167 +10549,130 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; +@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','TRANSACTIONAL' +SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; +@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' +SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP' SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -10371,11 +10683,9 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -10386,19 +10696,16 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET SPANNER.READONLY=FALSE; @EXPECT RESULT_SET 'SPANNER.READONLY',FALSE SHOW VARIABLE SPANNER.READONLY; @@ -10407,85 +10714,69 @@ SET SPANNER.READONLY=TRUE; SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:24.219000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:24.219000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.891000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.891000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:24.219000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.891000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:47.891000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -10500,55 +10791,41 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -10557,11 +10834,9 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -10604,68 +10879,54 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; BEGIN TRANSACTION; SELECT 1 AS TEST; UPDATE foo SET bar=1; @@ -10675,207 +10936,232 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; -COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +@EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +SET SPANNER.AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; +@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','TRANSACTIONAL' +SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; +@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' +SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP' SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +START BATCH DDL; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +START BATCH DML; +@EXPECT EXCEPTION FAILED_PRECONDITION +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +SET SPANNER.READONLY=FALSE; +@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE +SHOW VARIABLE SPANNER.READONLY; SET SPANNER.READONLY=TRUE; +@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE +SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:24.331000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:24.331000000Z' +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:47.957000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:47.957000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:24.331000000Z'; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:47.957000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:47.957000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -10890,34 +11176,34 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -10926,8 +11212,8 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -10970,71 +11256,73 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; +BEGIN TRANSACTION; +SELECT 1 AS TEST; +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET TRANSACTION READ ONLY; +SET AUTOCOMMIT=TRUE; +SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -11043,104 +11331,88 @@ SET AUTOCOMMIT=TRUE; SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT UPDATE_COUNT 1 UPDATE foo SET bar=1; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; +SET SPANNER.AUTOCOMMIT_DML_MODE='TRANSACTIONAL'; +@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','TRANSACTIONAL' +SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; +@EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC' +SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; START BATCH DDL; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -11151,8 +11423,7 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); START BATCH DDL; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; START BATCH DML; @EXPECT EXCEPTION FAILED_PRECONDITION SELECT 1 AS TEST; @@ -11163,13 +11434,12 @@ UPDATE foo SET bar=1; START BATCH DML; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET SPANNER.READONLY=FALSE; @EXPECT RESULT_SET 'SPANNER.READONLY',FALSE SHOW VARIABLE SPANNER.READONLY; @@ -11178,58 +11448,51 @@ SET SPANNER.READONLY=TRUE; SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:24.438000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:24.438000000Z' +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:48.009000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:48.009000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:24.438000000Z'; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:48.009000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:48.009000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=TRUE; SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -11244,34 +11507,27 @@ SET SPANNER.OPTIMIZER_VERSION=''; SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -11280,8 +11536,7 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -11324,44 +11579,38 @@ SET STATEMENT_TIMEOUT='0ns'; SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SELECT 1 AS TEST; UPDATE foo SET bar=1; @@ -11371,40 +11620,27 @@ CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); BEGIN TRANSACTION; NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s'; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -11412,206 +11648,126 @@ SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -@EXPECT UPDATE_COUNT 1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET SPANNER.READONLY=FALSE; @EXPECT RESULT_SET 'SPANNER.READONLY',FALSE SHOW VARIABLE SPANNER.READONLY; @@ -11619,86 +11775,61 @@ SET SPANNER.READONLY=TRUE; @EXPECT RESULT_SET 'SPANNER.READONLY',TRUE SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:24.605000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:24.605000000Z' +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:48.058000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:48.058000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:24.605000000Z'; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:48.058000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:48.058000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; -NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; -SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; +NEW_CONNECTION; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -11712,56 +11843,35 @@ SET SPANNER.OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -11769,12 +11879,9 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -11816,113 +11923,85 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0' SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; BEGIN TRANSACTION; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -ROLLBACK; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET AUTOCOMMIT=FALSE; @@ -11932,204 +12011,172 @@ SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -@EXPECT UPDATE_COUNT 1 +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null +@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP' SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET SPANNER.READONLY=FALSE; @@ -12139,84 +12186,77 @@ SET SPANNER.READONLY=TRUE; @EXPECT RESULT_SET 'SPANNER.READONLY',TRUE SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:24.798000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:24.798000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:48.118000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:48.118000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:24.798000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:48.118000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:48.118000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP' +@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET SPANNER.OPTIMIZER_VERSION='1'; @@ -12232,54 +12272,47 @@ SET SPANNER.OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; -@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP' +@EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @@ -12289,10 +12322,9 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; SET STATEMENT_TIMEOUT='1s'; @@ -12336,283 +12368,273 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0' SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; BEGIN TRANSACTION; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET AUTOCOMMIT=TRUE; -NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; SET AUTOCOMMIT=FALSE; +NEW_CONNECTION; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -@EXPECT UPDATE_COUNT 1 +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; ROLLBACK; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READONLY=TRUE; -NEW_CONNECTION; SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +NEW_CONNECTION; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:24.928000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:24.928000000Z' +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:48.169000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:48.169000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:24.928000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:48.169000000Z'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' @@ -12627,34 +12649,34 @@ SET SPANNER.OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' @@ -12663,8 +12685,8 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' @@ -12707,286 +12729,260 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0' SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT UPDATE_COUNT 1 +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null +@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP' SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 -SELECT 1 AS TEST; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READONLY=FALSE; +@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE +SHOW VARIABLE SPANNER.READONLY; SET SPANNER.READONLY=TRUE; +@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE +SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='STRONG'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:25.098000000Z'; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:48.260000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:48.260000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:25.098000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:48.260000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:48.260000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' @@ -13001,41 +12997,34 @@ SET SPANNER.OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' @@ -13044,9 +13033,8 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' @@ -13089,259 +13077,267 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0' SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +BEGIN TRANSACTION; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT RESULT_SET 'TEST',1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET AUTOCOMMIT=FALSE; +@EXPECT RESULT_SET 'AUTOCOMMIT',FALSE +SHOW VARIABLE AUTOCOMMIT; SET AUTOCOMMIT=TRUE; +@EXPECT RESULT_SET 'AUTOCOMMIT',TRUE +SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT UPDATE_COUNT 1 +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null +@EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP' SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SELECT 1 AS TEST; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; -@EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READONLY=FALSE; +@EXPECT RESULT_SET 'SPANNER.READONLY',FALSE +SHOW VARIABLE SPANNER.READONLY; SET SPANNER.READONLY=TRUE; +@EXPECT RESULT_SET 'SPANNER.READONLY',TRUE +SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='STRONG'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:25.279000000Z'; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:48.315000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:48.315000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:25.279000000Z'; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:48.315000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:48.315000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' @@ -13356,34 +13352,34 @@ SET SPANNER.OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' @@ -13392,8 +13388,8 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' @@ -13436,68 +13432,75 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0' SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; +BEGIN TRANSACTION; +SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION +UPDATE foo SET bar=1; +@EXPECT EXCEPTION FAILED_PRECONDITION +CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION ABORT BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET AUTOCOMMIT=FALSE; @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE SHOW VARIABLE AUTOCOMMIT; @@ -13505,110 +13508,102 @@ SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE SHOW VARIABLE AUTOCOMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT UPDATE_COUNT 1 +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'TEST',1 SELECT 1 AS TEST; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE' SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ ONLY; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET TRANSACTION READ WRITE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null SHOW VARIABLE SPANNER.READ_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DDL; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -UPDATE foo SET bar=1; -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DDL; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -START BATCH DML; -@EXPECT EXCEPTION FAILED_PRECONDITION -SELECT 1 AS TEST; -@EXPECT EXCEPTION FAILED_PRECONDITION -CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); -UPDATE foo SET bar=1; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION START BATCH DML; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION ROLLBACK; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET SPANNER.READONLY=FALSE; @EXPECT RESULT_SET 'SPANNER.READONLY',FALSE SHOW VARIABLE SPANNER.READONLY; @@ -13616,50 +13611,52 @@ SET SPANNER.READONLY=TRUE; @EXPECT RESULT_SET 'SPANNER.READONLY',TRUE SHOW VARIABLE SPANNER.READONLY; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET SPANNER.READ_ONLY_STALENESS='STRONG'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','STRONG' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-01-31T15:41:25.401000000Z'; -@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-01-31T15:41:25.401000000Z' +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2024-03-25T15:13:48.369000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2024-03-25T15:13:48.369000000Z' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT EXCEPTION FAILED_PRECONDITION -SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-01-31T15:41:25.401000000Z'; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2024-03-25T15:13:48.369000000Z'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2024-03-25T15:13:48.369000000Z' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 1s' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; -@EXPECT EXCEPTION FAILED_PRECONDITION +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms'; +@EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MAX_STALENESS 100ms' +SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us'; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','EXACT_STALENESS 100us' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_RESPONSE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET SPANNER.OPTIMIZER_VERSION='1'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; @@ -13673,28 +13670,28 @@ SET SPANNER.OPTIMIZER_VERSION=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','' SHOW VARIABLE SPANNER.OPTIMIZER_VERSION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package'; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; @@ -13702,8 +13699,8 @@ SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE=''; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; SET STATEMENT_TIMEOUT='1s'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s' SHOW VARIABLE STATEMENT_TIMEOUT; @@ -13745,44 +13742,47 @@ SET STATEMENT_TIMEOUT='0ns'; @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0' SHOW VARIABLE STATEMENT_TIMEOUT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS' SHOW VARIABLE SPANNER.READ_ONLY_STALENESS; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION COMMIT; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE' SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; @EXPECT EXCEPTION FAILED_PRECONDITION RUN BATCH; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; +@EXPECT EXCEPTION FAILED_PRECONDITION SET SPANNER.TRANSACTION_TAG = 'some-tag'; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE; BEGIN TRANSACTION; SELECT 1 AS TEST; +@EXPECT EXCEPTION FAILED_PRECONDITION UPDATE foo SET bar=1; @EXPECT EXCEPTION FAILED_PRECONDITION CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id); @EXPECT EXCEPTION FAILED_PRECONDITION BEGIN TRANSACTION; NEW_CONNECTION; -SET SPANNER.READONLY=FALSE; -SET AUTOCOMMIT=FALSE; +SET SPANNER.READONLY=TRUE; +SET AUTOCOMMIT=TRUE;