Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -152,6 +152,8 @@ StatementResult statementSetPgSessionCharacteristicsTransactionMode(

StatementResult statementShowTransactionIsolationLevel();

StatementResult statementShowDefaultTransactionIsolation();

StatementResult statementSetProtoDescriptors(byte[] protoDescriptors);

StatementResult statementSetProtoDescriptorsFilePath(String filePath);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -64,6 +64,7 @@
import static com.google.cloud.spanner.connection.StatementResult.ClientSideStatementType.SHOW_COMMIT_RESPONSE;
import static com.google.cloud.spanner.connection.StatementResult.ClientSideStatementType.SHOW_COMMIT_TIMESTAMP;
import static com.google.cloud.spanner.connection.StatementResult.ClientSideStatementType.SHOW_DATA_BOOST_ENABLED;
import static com.google.cloud.spanner.connection.StatementResult.ClientSideStatementType.SHOW_DEFAULT_TRANSACTION_ISOLATION;
import static com.google.cloud.spanner.connection.StatementResult.ClientSideStatementType.SHOW_DELAY_TRANSACTION_START_UNTIL_FIRST_WRITE;
import static com.google.cloud.spanner.connection.StatementResult.ClientSideStatementType.SHOW_DIRECTED_READ;
import static com.google.cloud.spanner.connection.StatementResult.ClientSideStatementType.SHOW_EXCLUDE_TXN_FROM_CHANGE_STREAMS;
Expand DownExpand Up@@ -647,7 +648,19 @@ public StatementResult statementShowReadLockMode() {

@Override
public StatementResult statementShowTransactionIsolationLevel() {
return resultSet("transaction_isolation", "serializable", SHOW_TRANSACTION_ISOLATION_LEVEL);
TransactionOptions.IsolationLevel isolationLevel =
getConnection().isInTransaction()
? getConnection().getTransactionIsolationLevel()
: getConnection().getDefaultIsolationLevel();
return resultSet("transaction_isolation", isolationLevel, SHOW_TRANSACTION_ISOLATION_LEVEL);
}

@Override
public StatementResult statementShowDefaultTransactionIsolation() {
return resultSet(
"default_transaction_isolation",
getConnection().getDefaultIsolationLevel(),
SHOW_DEFAULT_TRANSACTION_ISOLATION);
}

@Override
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -98,6 +98,7 @@ enum ClientSideStatementType {
SET_RPC_PRIORITY,
SHOW_RPC_PRIORITY,
SHOW_TRANSACTION_ISOLATION_LEVEL,
SHOW_DEFAULT_TRANSACTION_ISOLATION,
SHOW_SAVEPOINT_SUPPORT,
SET_SAVEPOINT_SUPPORT,
SHOW_DATA_BOOST_ENABLED,
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -248,6 +248,15 @@
"method": "statementShowTransactionIsolationLevel",
"exampleStatements": ["show transaction isolation level","show variable transaction isolation level"]
},
{
"name": "SHOW [VARIABLE] DEFAULT_TRANSACTION_ISOLATION",
"executorName": "ClientSideStatementNoParamExecutor",
"resultType": "RESULT_SET",
"statementType": "SHOW_DEFAULT_TRANSACTION_ISOLATION",
"regex": "(?is)\\A\\s*show\\s+(?:variable\\s+)?default_transaction_isolation\\s*\\z",
"method": "statementShowDefaultTransactionIsolation",
"exampleStatements": ["show default_transaction_isolation","show variable default_transaction_isolation"]
},
{
"name": "EXPLAIN <sql>",
"executorName": "ClientSideStatementExplainExecutor",
Expand Down
Loading