Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update isolation error message to include config option #2043

Merged
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
4 changes: 2 additions & 2 deletions contrib/babelfishpg_tsql/src/backend_parser/gram-tsql-rule.y
Original file line number Diff line number Diff line change
Expand Up @@ -4416,7 +4416,7 @@ tsql_IsolationLevelStr:
TSQLInstrumentation(INSTR_UNSUPPORTED_TSQL_ISOLATION_LEVEL_REPEATABLE_READ);
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to get PG repeatable read isolation level."),
errmsg("Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to 'pg_isolation' to get PG repeatable read isolation level."),
parser_errposition(@1)));
}

Expand All @@ -4438,7 +4438,7 @@ tsql_IsolationLevelStr:
TSQLInstrumentation(INSTR_UNSUPPORTED_TSQL_ISOLATION_LEVEL_SERIALIZABLE);
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_serializable’ config option to get PG serializable isolation level."),
errmsg("Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_serializable’ config option to 'pg_isolation' to get PG serializable isolation level."),
parser_errposition(@1)));
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/JDBC/expected/BABEL-3214.out
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
GO
~~ERROR (Code: 33557097)~~

~~ERROR (Message: Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to get PG repeatable read isolation level.)~~
~~ERROR (Message: Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to 'pg_isolation' to get PG repeatable read isolation level.)~~

SELECT CAST(current_setting('transaction_isolation') AS VARCHAR);
SELECT transaction_isolation_level from sys.dm_exec_sessions WHERE session_id = @@SPID;
Expand All @@ -65,7 +65,7 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
GO
~~ERROR (Code: 33557097)~~

~~ERROR (Message: Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_serializable’ config option to get PG serializable isolation level.)~~
~~ERROR (Message: Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_serializable’ config option to 'pg_isolation' to get PG serializable isolation level.)~~

SELECT CAST(current_setting('transaction_isolation') AS VARCHAR);
SELECT transaction_isolation_level from sys.dm_exec_sessions WHERE session_id = @@SPID;
Expand Down
8 changes: 4 additions & 4 deletions test/JDBC/expected/BABEL_4145.out
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
GO
~~ERROR (Code: 33557097)~~

~~ERROR (Message: Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to get PG repeatable read isolation level.)~~
~~ERROR (Message: Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to 'pg_isolation' to get PG repeatable read isolation level.)~~

SELECT current_setting('transaction_isolation');
GO
Expand All @@ -137,7 +137,7 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
GO
~~ERROR (Code: 33557097)~~

~~ERROR (Message: Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_serializable’ config option to get PG serializable isolation level.)~~
~~ERROR (Message: Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_serializable’ config option to 'pg_isolation' to get PG serializable isolation level.)~~

SELECT current_setting('transaction_isolation');
GO
Expand Down Expand Up @@ -208,7 +208,7 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
GO
~~ERROR (Code: 33557097)~~

~~ERROR (Message: Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_serializable’ config option to get PG serializable isolation level.)~~
~~ERROR (Message: Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_serializable’ config option to 'pg_isolation' to get PG serializable isolation level.)~~

SELECT current_setting('transaction_isolation');
GO
Expand Down Expand Up @@ -261,7 +261,7 @@ SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
GO
~~ERROR (Code: 33557097)~~

~~ERROR (Message: Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to get PG repeatable read isolation level.)~~
~~ERROR (Message: Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to 'pg_isolation' to get PG repeatable read isolation level.)~~

SELECT current_setting('transaction_isolation');
GO
Expand Down
4 changes: 2 additions & 2 deletions test/JDBC/expected/TestIsolationLevels.out
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set transaction isolation level repeatable read;
go
~~ERROR (Code: 33557097)~~

~~ERROR (Message: Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to get PG repeatable read isolation level.)~~
~~ERROR (Message: Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to 'pg_isolation' to get PG repeatable read isolation level.)~~


set transaction isolation level snapshot;
Expand All @@ -32,7 +32,7 @@ set transaction isolation level serializable;
go
~~ERROR (Code: 33557097)~~

~~ERROR (Message: Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_serializable’ config option to get PG serializable isolation level.)~~
~~ERROR (Message: Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_serializable’ config option to 'pg_isolation' to get PG serializable isolation level.)~~


select set_config('default_transaction_isolation', 'read uncommitted', false);
Expand Down
4 changes: 2 additions & 2 deletions test/JDBC/expected/TestTransactionsSQLBatch.out
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ int
set transaction isolation level repeatable read;
~~ERROR (Code: 33557097)~~

~~ERROR (Message: Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to get PG repeatable read isolation level.)~~
~~ERROR (Message: Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to 'pg_isolation' to get PG repeatable read isolation level.)~~

#show transaction_isolation;
#show default_transaction_isolation;
Expand Down Expand Up @@ -374,7 +374,7 @@ int
set transaction isolation level serializable;
~~ERROR (Code: 33557097)~~

~~ERROR (Message: Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_serializable’ config option to get PG serializable isolation level.)~~
~~ERROR (Message: Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_serializable’ config option to 'pg_isolation' to get PG serializable isolation level.)~~

#show transaction_isolation;
#show default_transaction_isolation;
Expand Down
4 changes: 2 additions & 2 deletions test/python/expected/pymssql/TestTransactionsSQLBatch.out
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ int

set transaction isolation level repeatable read;
~~ERROR (Code: 33557097)~~
~~ERROR (Message: 'Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to get PG repeatable read isolation level.DB-Lib error message 20018, severity 16:\nGeneral SQL Server error: Check messages from the SQL Server\n')~~
~~ERROR (Message: 'Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to 'pg_isolation' to get PG repeatable read isolation level.DB-Lib error message 20018, severity 16:\nGeneral SQL Server error: Check messages from the SQL Server\n')~~

#show transaction_isolation;
#show default_transaction_isolation;
Expand Down Expand Up @@ -430,7 +430,7 @@ int
# begin transaction name -> save transaction name -> rollback tran name, Rollback whole transaction
set transaction isolation level serializable;
~~ERROR (Code: 33557097)~~
~~ERROR (Message: 'Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_serializable’ config option to get PG serializable isolation level.DB-Lib error message 20018, severity 16:\nGeneral SQL Server error: Check messages from the SQL Server\n')~~
~~ERROR (Message: 'Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_serializable’ config option to 'pg_isolation' to get PG serializable isolation level.DB-Lib error message 20018, severity 16:\nGeneral SQL Server error: Check messages from the SQL Server\n')~~

#show transaction_isolation;
#show default_transaction_isolation;
Expand Down
4 changes: 2 additions & 2 deletions test/python/expected/pyodbc/TestTransactionsSQLBatch.out
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int

set transaction isolation level repeatable read;
~~ERROR (Code: 33557097)~~
~~ERROR (Message: [42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to get PG repeatable read isolation level. (33557097) (SQLExecDirectW))~~
~~ERROR (Message: [42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Isolation level ‘REPEATABLE READ’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_repeatable_read’ config option to 'pg_isolation' to get PG repeatable read isolation level. (33557097) (SQLExecDirectW))~~

#show transaction_isolation;
#show default_transaction_isolation;
Expand Down Expand Up @@ -372,7 +372,7 @@ int
# begin transaction name -> save transaction name -> rollback tran name, Rollback whole transaction
set transaction isolation level serializable;
~~ERROR (Code: 33557097)~~
~~ERROR (Message: [42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Please use ‘babelfishpg_tsql.isolation_level_serializable’ config option to get PG serializable isolation level. (33557097) (SQLExecDirectW))~~
~~ERROR (Message: [42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Isolation level ‘SERIALIZABLE’ is not currently supported in Babelfish. Set ‘babelfishpg_tsql.isolation_level_serializable’ config option to 'pg_isolation' to get PG serializable isolation level. (33557097) (SQLExecDirectW))~~

#show transaction_isolation;
#show default_transaction_isolation;
Expand Down