text: NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:20.237000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:20.237000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:20.237000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2021-04-13T18:14:20.237000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'READ_TIMESTAMP'
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:20.345000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:20.345000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:20.345000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2021-04-13T18:14:20.345000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READONLY=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:20.443000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:20.443000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:20.443000000Z';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE
  SHOW VARIABLE AUTOCOMMIT;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE
  SHOW VARIABLE AUTOCOMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_TIMESTAMP'
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:20.529000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:20.529000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:20.529000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2021-04-13T18:14:20.529000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET 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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE
  SHOW VARIABLE AUTOCOMMIT;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE
  SHOW VARIABLE AUTOCOMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_TIMESTAMP'
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:20.633000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:20.633000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:20.633000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2021-04-13T18:14:20.633000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET 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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE
  SHOW VARIABLE AUTOCOMMIT;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE
  SHOW VARIABLE AUTOCOMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:20.712000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:20.712000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:20.712000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2021-04-13T18:14:20.712000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READONLY=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='STRONG';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:20.755000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:20.755000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET 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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READONLY=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:20.807000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:20.807000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:20.807000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL';
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=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 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:20.903000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:20.903000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:20.903000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2021-04-13T18:14:20.903000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP'
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP'
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET 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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READONLY=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:20.957000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:20.957000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:20.957000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE
  SHOW VARIABLE AUTOCOMMIT;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE
  SHOW VARIABLE AUTOCOMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL';
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  START BATCH DML;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:21.041000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:21.041000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:21.041000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2021-04-13T18:14:21.041000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE
  SHOW VARIABLE AUTOCOMMIT;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE
  SHOW VARIABLE AUTOCOMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL';
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  START BATCH DML;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:21.115000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:21.115000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:21.115000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2021-04-13T18:14:21.115000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP'
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP'
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET 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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE
  SHOW VARIABLE AUTOCOMMIT;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE
  SHOW VARIABLE AUTOCOMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL';
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET 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 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_TIMESTAMP'
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET 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 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:21.186000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:21.186000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:21.186000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2021-04-13T18:14:21.186000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL';
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_TIMESTAMP'
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  START BATCH DML;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:21.257000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:21.257000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:21.257000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2021-04-13T18:14:21.257000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET 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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SET AUTOCOMMIT_DML_MODE='TRANSACTIONAL';
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','TRANSACTIONAL'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE','PARTITIONED_NON_ATOMIC'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  START BATCH DML;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:21.313000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:21.313000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:21.313000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MIN_READ_TIMESTAMP 2021-04-13T18:14:21.313000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','MAX_STALENESS 100ms'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET 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 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:21.357000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:21.357000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:21.357000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE
  SHOW VARIABLE AUTOCOMMIT;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE
  SHOW VARIABLE AUTOCOMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  START BATCH DML;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:21.419000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:21.419000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:21.419000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET 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 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 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET 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 AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET 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 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READONLY=TRUE;
  NEW_CONNECTION;
  SET 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 READ_ONLY_STALENESS='STRONG';
  NEW_CONNECTION;
  SET 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 READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:21.477000000Z';
  NEW_CONNECTION;
  SET 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 READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:21.477000000Z';
  NEW_CONNECTION;
  SET 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 READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  NEW_CONNECTION;
  SET 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 READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET 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 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 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_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READONLY=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='STRONG';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:21.520000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:21.520000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET 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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET 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 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'READ_TIMESTAMP'
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  START BATCH DML;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:21.566000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:21.566000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:21.566000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READONLY=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:21.620000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:21.620000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:21.620000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET 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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE
  SHOW VARIABLE AUTOCOMMIT;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE
  SHOW VARIABLE AUTOCOMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  START BATCH DML;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:21.679000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:21.679000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:21.679000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=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 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET 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 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=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 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:21.778000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:21.778000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:21.778000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  COMMIT;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=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 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET 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 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=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 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:21.885000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:21.885000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:21.885000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP'
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP'
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  COMMIT;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READONLY=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:21.950000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:21.950000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:21.950000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET 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 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  START BATCH DML;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READONLY=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='STRONG';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:22.004000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:22.004000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  START BATCH DML;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READONLY=TRUE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='STRONG';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:22.065000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:22.065000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET 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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT UPDATE_COUNT 1
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DDL;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  START BATCH DML;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:22.116000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:22.116000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:22.116000000Z';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET 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 READONLY=FALSE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE
  SHOW VARIABLE AUTOCOMMIT;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE
  SHOW VARIABLE AUTOCOMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:22.181000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:22.181000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:22.181000000Z';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',FALSE
  SHOW VARIABLE AUTOCOMMIT;
  SET AUTOCOMMIT=TRUE;
  @EXPECT RESULT_SET 'AUTOCOMMIT',TRUE
  SHOW VARIABLE AUTOCOMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:22.221000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:22.221000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:22.221000000Z';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 10s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:22.271000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:22.271000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:22.271000000Z';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  COMMIT;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  CREATE TABLE foo (id INT64 NOT NULL, name STRING(100)) PRIMARY KEY (id);
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'READ_TIMESTAMP'
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:22.325000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:22.325000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:22.325000000Z';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  COMMIT;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READONLY=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:22.371000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:22.371000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:22.371000000Z';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET 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 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET 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 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_TIMESTAMP'
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READONLY=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='STRONG';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:22.416000000Z';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:22.416000000Z';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_TIMESTAMP'
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READONLY=TRUE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='STRONG';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:22.473000000Z';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:22.473000000Z';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET 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=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  BEGIN TRANSACTION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION'
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  ABORT BATCH;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  UPDATE foo SET bar=1;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET AUTOCOMMIT_DML_MODE='PARTITIONED_NON_ATOMIC';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'TEST',1
  SELECT 1 AS TEST;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'AUTOCOMMIT_DML_MODE'
  SHOW VARIABLE AUTOCOMMIT_DML_MODE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET TRANSACTION READ ONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION READ WRITE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'READ_TIMESTAMP',null
  SHOW VARIABLE READ_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DDL;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  START BATCH DML;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  ROLLBACK;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READONLY=FALSE;
  @EXPECT RESULT_SET 'READONLY',FALSE
  SHOW VARIABLE READONLY;
  SET READONLY=TRUE;
  @EXPECT RESULT_SET 'READONLY',TRUE
  SHOW VARIABLE READONLY;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='STRONG';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','STRONG'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='READ_TIMESTAMP 2021-04-13T18:14:22.517000000Z';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','READ_TIMESTAMP 2021-04-13T18:14:22.517000000Z'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MIN_READ_TIMESTAMP 2021-04-13T18:14:22.517000000Z';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 1s';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 1s'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET READ_ONLY_STALENESS='MAX_STALENESS 100ms';
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET READ_ONLY_STALENESS='EXACT_STALENESS 100us';
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS','EXACT_STALENESS 100us'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_RESPONSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET OPTIMIZER_VERSION='1';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','1'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='2';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','2'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='latest';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION','latest'
  SHOW VARIABLE OPTIMIZER_VERSION;
  SET OPTIMIZER_VERSION='';
  @EXPECT RESULT_SET 'OPTIMIZER_VERSION',''
  SHOW VARIABLE OPTIMIZER_VERSION;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'COMMIT_TIMESTAMP',null
  SHOW VARIABLE COMMIT_TIMESTAMP;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  SET STATEMENT_TIMEOUT='1s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1s'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0s';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ms'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ms';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1us'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0us';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT='1ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT','1ns'
  SHOW VARIABLE STATEMENT_TIMEOUT;
  SET STATEMENT_TIMEOUT=null;
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  @EXPECT EXCEPTION INVALID_ARGUMENT
  SET STATEMENT_TIMEOUT='0ns';
  @EXPECT RESULT_SET 'STATEMENT_TIMEOUT',null
  SHOW VARIABLE STATEMENT_TIMEOUT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT RESULT_SET 'READ_ONLY_STALENESS'
  SHOW VARIABLE READ_ONLY_STALENESS;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  COMMIT;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  RUN BATCH;
  NEW_CONNECTION;
  SET READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  @EXPECT EXCEPTION FAILED_PRECONDITION
  SET TRANSACTION_TAG = 'some-tag';
  NEW_CONNECTION;
  SET 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 READONLY=TRUE;
  SET AUTOCOMMIT=FALSE;
  