Repository navigation
fix(spanner): fix PG SHOW isolation level statements - #14904
rayudu3745 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for retrieving and formatting the transaction isolation level, resolving unspecified isolation levels to the database default, and formatting them appropriately based on the dialect (such as PostgreSQL). It also introduces the SHOW [VARIABLE] TRANSACTION_ISOLATION client-side statement for PostgreSQL, along with comprehensive unit and integration tests to verify these behaviors. I have no feedback to provide as the review comment was filtered out.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the Spanner connection statement executor to correctly resolve and format transaction isolation levels, specifically handling PostgreSQL-specific formatting (e.g., 'serializable' and 'repeatable read') and resolving unspecified isolation levels to the database default. It also introduces support for the SHOW [VARIABLE] TRANSACTION_ISOLATION client-side statement in the PostgreSQL dialect, along with comprehensive unit and integration tests to verify these behaviors. There are no review comments provided, and I have no additional feedback on these changes.
For PostgreSQL-dialect databases, the isolation level
SHOWstatements returned Java enum names and did not resolve an unspecified isolation level:SHOW TRANSACTION ISOLATION LEVEL/SHOW default_transaction_isolationwith no isolation level set on the connectionISOLATION_LEVEL_UNSPECIFIEDrepeatable read(serializableif the database has no default)REPEATABLE_READ)REPEATABLE_READrepeatable readSHOW transaction_isolationSHOW queries are not supported)SHOW TRANSACTION ISOLATION LEVELPostgreSQL drivers expect the PostgreSQL names. For example, pgjdbc's
getTransactionIsolation()does not recognizeREPEATABLE_READ.Changes
DatabaseClient#getDatabaseDefaultIsolationLevel()(chore(spanner): expose database default isolation level #14806), falling back toSERIALIZABLEwhen the database has no default. If this client does not recognize the database default, the statement fails withFAILED_PRECONDITION.serializable,repeatable read).SHOW transaction_isolation, the PostgreSQL name forSHOW TRANSACTION ISOLATION LEVEL.