text: NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @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;
  @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 SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  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=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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  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;
  SET SPANNER.READONLY=TRUE;
  @EXPECT RESULT_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 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 2022-03-23T14:42:27.293000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:27.293000000Z'
  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 2022-03-23T14:42:27.293000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2022-03-23T14:42:27.293000000Z'
  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='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 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 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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  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;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @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';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  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_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  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;
  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 AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  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=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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  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;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @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;
  @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;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @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;
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  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;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  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;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  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;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @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
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  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 AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  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;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:27.688000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:27.688000000Z'
  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 2022-03-23T14:42:27.688000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2022-03-23T14:42:27.688000000Z'
  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='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 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 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;
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  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;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  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;
  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 AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  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;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  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;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @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;
  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;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READONLY=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=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:28.001000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:28.001000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:28.001000000Z';
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  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'
  SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE;
  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 AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @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;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE
  SHOW VARIABLE AUTOCOMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP'
  SHOW VARIABLE SPANNER.READ_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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 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 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 2022-03-23T14:42:28.314000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:28.314000000Z'
  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 2022-03-23T14:42:28.314000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2022-03-23T14:42:28.314000000Z'
  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 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 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';
  @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;
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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'
  SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE;
  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 AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  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=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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @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;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE
  SHOW VARIABLE AUTOCOMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP'
  SHOW VARIABLE SPANNER.READ_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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 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 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 2022-03-23T14:42:28.639000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:28.639000000Z'
  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 2022-03-23T14:42:28.639000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2022-03-23T14:42:28.639000000Z'
  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 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 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';
  @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;
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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'
  SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE;
  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 AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  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=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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @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;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE
  SHOW VARIABLE AUTOCOMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null
  SHOW VARIABLE SPANNER.READ_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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 SPANNER.READONLY=TRUE;
  @EXPECT RESULT_SET 'SPANNER.READONLY',TRUE
  SHOW VARIABLE SPANNER.READONLY;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:28.902000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:28.902000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:28.902000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2022-03-23T14:42:28.902000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  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=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=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=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  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;
  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 AUTOCOMMIT=TRUE;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  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=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @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;
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @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;
  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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null
  SHOW VARIABLE SPANNER.READ_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  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;
  SET SPANNER.READONLY=TRUE;
  @EXPECT RESULT_SET 'SPANNER.READONLY',TRUE
  SHOW VARIABLE SPANNER.READONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=FALSE;
  COMMIT;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:29.148000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:29.148000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:29.148000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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;
  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 AUTOCOMMIT=FALSE;
  COMMIT;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @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;
  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;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE
  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;
  SET SPANNER.READONLY=TRUE;
  @EXPECT RESULT_SET 'SPANNER.READONLY',TRUE
  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 2022-03-23T14:42:29.376000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:29.376000000Z'
  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 2022-03-23T14:42:29.376000000Z';
  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;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @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';
  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;
  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 AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  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
  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;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=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=FALSE;
  BEGIN TRANSACTION;
  @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=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=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=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=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=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @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=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:29.657000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:29.657000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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 2022-03-23T14:42:29.657000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=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=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=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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;
  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 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;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=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=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=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  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 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=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=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=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=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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;
  SET SPANNER.READONLY=TRUE;
  @EXPECT RESULT_SET 'SPANNER.READONLY',TRUE
  SHOW VARIABLE SPANNER.READONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:29.941000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:29.941000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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='MIN_READ_TIMESTAMP 2022-03-23T14:42:29.941000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=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';
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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;
  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 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;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=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=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=FALSE;
  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=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READONLY=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:30.135000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:30.135000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:30.135000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=TRUE;
  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=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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;
  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 AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=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=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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=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=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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READONLY=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='STRONG';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:30.355000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:30.355000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=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';
  NEW_CONNECTION;
  SET SPANNER.READONLY=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';
  NEW_CONNECTION;
  SET SPANNER.READONLY=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';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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;
  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 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;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  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;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP'
  SHOW VARIABLE SPANNER.READ_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READONLY=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='STRONG';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:30.594000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:30.594000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  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;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  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;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  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;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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;
  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 AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  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=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null
  SHOW VARIABLE SPANNER.READ_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  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 SPANNER.READONLY=TRUE;
  @EXPECT RESULT_SET 'SPANNER.READONLY',TRUE
  SHOW VARIABLE SPANNER.READONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:30.790000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:30.790000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:30.790000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=TRUE;
  SET AUTOCOMMIT=FALSE;
  @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 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;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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;
  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 AUTOCOMMIT=FALSE;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE'
  SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET SPANNER.READONLY=TRUE;
  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=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=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=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @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
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READONLY=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='STRONG';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:30.980000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:30.980000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @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 SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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;
  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=TRUE;
  START BATCH DDL;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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;
  START BATCH DDL;
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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;
  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;
  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;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  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;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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;
  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;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:31.151000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:31.151000000Z'
  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='MIN_READ_TIMESTAMP 2022-03-23T14:42:31.151000000Z';
  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';
  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;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @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;
  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;
  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=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  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;
  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;
  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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  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=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  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=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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:31.485000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:31.485000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:31.485000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2022-03-23T14:42:31.485000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  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;
  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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP'
  SHOW VARIABLE SPANNER.COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP'
  SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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'
  SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE;
  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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=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=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  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=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  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=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  BEGIN TRANSACTION;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READONLY=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  BEGIN TRANSACTION;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:31.700000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:31.700000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:31.700000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  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=TRUE;
  BEGIN TRANSACTION;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET SPANNER.TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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);
  @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);
  @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;
  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);
  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);
  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);
  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);
  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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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);
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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);
  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 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);
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @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);
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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);
  @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);
  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 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);
  @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);
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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=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=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=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 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 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 2022-03-23T14:42:32.018000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:32.018000000Z'
  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='MIN_READ_TIMESTAMP 2022-03-23T14:42:32.018000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2022-03-23T14:42:32.018000000Z'
  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='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 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 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);
  @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);
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @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);
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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);
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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);
  @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);
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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'
  SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE;
  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=TRUE;
  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;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  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);
  @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);
  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
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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);
  @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);
  @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);
  @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;
  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);
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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;
  @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;
  UPDATE foo SET bar=1;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  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 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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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=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=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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 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 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 2022-03-23T14:42:32.292000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:32.292000000Z'
  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='MIN_READ_TIMESTAMP 2022-03-23T14:42:32.292000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2022-03-23T14:42:32.292000000Z'
  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='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 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 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'
  SHOW VARIABLE SPANNER.COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  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=TRUE;
  UPDATE foo SET bar=1;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @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;
  @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;
  @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;
  @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;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  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=TRUE;
  @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;
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @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 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=TRUE;
  @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;
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @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;
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @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;
  @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;
  @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;
  @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP'
  SHOW VARIABLE SPANNER.READ_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  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;
  @EXPECT RESULT_SET 'TEST',1
  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=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  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=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  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=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:32.518000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:32.518000000Z'
  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 2022-03-23T14:42:32.518000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2022-03-23T14:42:32.518000000Z'
  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='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 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 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;
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @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;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @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;
  @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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @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;
  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=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @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;
  @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;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @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;
  @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;
  @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 SPANNER.TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  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=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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;
  @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;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  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;
  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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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=TRUE;
  SELECT 1 AS TEST;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:32.770000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:32.770000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:32.770000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2022-03-23T14:42:32.770000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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=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=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=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  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=TRUE;
  SELECT 1 AS TEST;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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);
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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;
  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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @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);
  @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;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  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 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 2022-03-23T14:42:33.018000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:33.018000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:33.018000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2022-03-23T14:42:33.018000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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=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=TRUE;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  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=TRUE;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE'
  SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'SPANNER.READ_TIMESTAMP',null
  SHOW VARIABLE SPANNER.READ_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  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;
  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;
  COMMIT;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  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=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:33.206000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:33.206000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:33.206000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  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;
  COMMIT;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE'
  SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET SPANNER.TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  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;
  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;
  @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;
  @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;
  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;
  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;
  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;
  @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;
  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;
  @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;
  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;
  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;
  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;
  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;
  @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;
  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;
  @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;
  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;
  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;
  @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;
  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 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 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;
  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;
  @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);
  @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;
  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;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  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 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 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 2022-03-23T14:42:33.448000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:33.448000000Z'
  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;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:33.449000000Z';
  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='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;
  @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 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;
  @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;
  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.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @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;
  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;
  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;
  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;
  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;
  @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;
  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.OPTIMIZER_STATISTICS_PACKAGE='custom-package';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package'
  SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE;
  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;
  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;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  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;
  @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;
  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;
  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;
  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;
  @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;
  @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 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;
  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;
  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);
  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);
  @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);
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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);
  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);
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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);
  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);
  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);
  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);
  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);
  @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);
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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);
  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);
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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);
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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);
  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);
  @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);
  @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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READONLY=TRUE;
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='STRONG';
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:33.677000000Z';
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:33.677000000Z';
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  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);
  @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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  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);
  @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);
  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);
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @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);
  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);
  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);
  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);
  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);
  @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);
  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);
  SET SPANNER.OPTIMIZER_STATISTICS_PACKAGE='custom-package';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE','custom-package'
  SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE;
  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;
  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;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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);
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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);
  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);
  @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;
  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);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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);
  @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);
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  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);
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @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
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READONLY=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='STRONG';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:33.887000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:33.887000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  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;
  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;
  START BATCH DDL;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @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;
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  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=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=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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  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=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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @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;
  @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;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @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;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  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=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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  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=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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  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=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=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=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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @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;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:34.149000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:34.149000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  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 2022-03-23T14:42:34.149000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @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;
  @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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @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;
  @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;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  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;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  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 TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  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=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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  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;
  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 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;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  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=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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET SPANNER.TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  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=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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READONLY=TRUE;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:34.333000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:34.333000000Z'
  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 2022-03-23T14:42:34.333000000Z';
  NEW_CONNECTION;
  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=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=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=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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  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;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  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 TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  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;
  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 TRANSACTION READ ONLY;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @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=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.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  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
  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';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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=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=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:34.517000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:34.517000000Z'
  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 2022-03-23T14:42:34.517000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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=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=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=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  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.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  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.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  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.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=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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=FALSE;
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  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;
  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;
  @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;
  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
  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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  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.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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  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 TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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);
  @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;
  @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;
  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=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;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:34.777000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:34.777000000Z'
  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 2022-03-23T14:42:34.777000000Z';
  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 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.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'
  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 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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  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 STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  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;
  @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;
  NEW_CONNECTION;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  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;
  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;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  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=FALSE;
  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;
  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;
  COMMIT;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  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;
  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;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @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;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  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',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;
  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;
  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;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  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;
  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;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:35.084000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:35.084000000Z'
  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;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:35.084000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  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';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  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;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  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;
  COMMIT;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  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;
  COMMIT;
  @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;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  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;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  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;
  BEGIN TRANSACTION;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READONLY=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  BEGIN TRANSACTION;
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:35.282000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:35.282000000Z'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:35.282000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  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;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  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;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  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 'SPANNER.READ_ONLY_STALENESS'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET SPANNER.TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  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
  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
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READONLY=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='STRONG';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:35.509000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:35.509000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  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
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  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
  SELECT 1 AS TEST;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  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
  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
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  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;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  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
  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;
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READONLY=TRUE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='STRONG';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='READ_TIMESTAMP 2022-03-23T14:42:35.756000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2022-03-23T14:42:35.756000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  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;
  SELECT 1 AS TEST;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  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;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'SPANNER.AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE SPANNER.AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @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);
  @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;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  ROLLBACK;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  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.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 2022-03-23T14:42:35.963000000Z';
  @EXPECT RESULT_SET 'SPANNER.READ_ONLY_STALENESS','READ_TIMESTAMP 2022-03-23T14:42:35.963000000Z'
  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 2022-03-23T14:42:35.963000000Z';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET SPANNER.READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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=FALSE;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','1'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','2'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION','latest'
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  SET SPANNER.OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_VERSION',''
  SHOW VARIABLE SPANNER.OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'SPANNER.COMMIT_TIMESTAMP',null
  SHOW VARIABLE SPANNER.COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  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;
  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 STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=DEFAULT;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','0'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  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 'SPANNER.READ_ONLY_STALENESS'
  SHOW VARIABLE SPANNER.READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'SPANNER.OPTIMIZER_STATISTICS_PACKAGE'
  SHOW VARIABLE SPANNER.OPTIMIZER_STATISTICS_PACKAGE;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET SPANNER.TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET SPANNER.READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  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;
  