Skip to content

Commit

Permalink
Update test files by removing set_config calls (#3302)
Browse files Browse the repository at this point in the history
As part of #3096, we restricted setting of few configurations like role, migration mode etc. We ignored few files temporarily to get us unblocked.
This commit fixes 3 such test files:
1. BABEL-1435
2. BABEL-1446
3. babelfish_migration-mode-vu-*

Signed-off-by: Shameem Ahmed <[email protected]>
  • Loading branch information
ahmed-shameem authored Dec 30, 2024
1 parent cb798b3 commit 6426975
Show file tree
Hide file tree
Showing 43 changed files with 32 additions and 334 deletions.
46 changes: 0 additions & 46 deletions test/JDBC/expected/BABEL-1435.out
Original file line number Diff line number Diff line change
Expand Up @@ -175,29 +175,6 @@ GO
DROP DATABASE db1;
GO

-- Set current_user for testing db mode
IF (SELECT 1 FROM pg_roles WHERE rolname='jdbc_user') = 1
BEGIN
WITH SET_CTE
AS
(SELECT set_config('role', 'jdbc_user', false))
SELECT NULL
FROM SET_CTE
END
ELSE
BEGIN
WITH SET_CTE
AS
(SELECT set_config('role', 'babeltestuser', false))
SELECT NULL
FROM SET_CTE
END
GO
~~START~~
int
<NULL>
~~END~~


SELECT name FROM sys.sysdatabases ORDER BY name;
GO
Expand Down Expand Up @@ -454,29 +431,6 @@ GO
DROP DATABASE db1;
GO

-- Set current_user for testing db mode
IF (SELECT 1 FROM pg_roles WHERE rolname='jdbc_user') = 1
BEGIN
WITH SET_CTE
AS
(SELECT set_config('role', 'jdbc_user', false))
SELECT NULL
FROM SET_CTE
END
ELSE
BEGIN
WITH SET_CTE
AS
(SELECT set_config('role', 'babeltestuser', false))
SELECT NULL
FROM SET_CTE
END
GO
~~START~~
int
<NULL>
~~END~~


SELECT name FROM sys.sysdatabases ORDER BY name;
GO
Expand Down
16 changes: 0 additions & 16 deletions test/JDBC/expected/BABEL-1446.out
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,6 @@ int


-- test multi-db mode
SELECT set_config('role', 'jdbc_user', false);
GO
~~START~~
text
jdbc_user
~~END~~


CREATE DATABASE db1;
GO

Expand Down Expand Up @@ -225,14 +217,6 @@ int


-- test multi-db mode
SELECT set_config('role', 'jdbc_user', false);
GO
~~START~~
text
jdbc_user
~~END~~


CREATE DATABASE db1 COLLATE BBF_Unicode_CP1_CI_AI;
GO

Expand Down
67 changes: 0 additions & 67 deletions test/JDBC/expected/babelfish_migration_mode-vu-verify.out
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,6 @@ GO
~~ROW COUNT: 1~~


SELECT set_config('role', 'jdbc_user', false)
GO
~~START~~
text
jdbc_user
~~END~~


SELECT current_setting('babelfishpg_tsql.migration_mode')
GO
~~START~~
Expand Down Expand Up @@ -240,28 +232,12 @@ int
USE master
GO

SELECT set_config('role', 'jdbc_user', false)
GO
~~START~~
text
jdbc_user
~~END~~




-- should fail in single-db
USE babelfish_migration_mode_db2
GO

SELECT set_config('role', 'jdbc_user', false)
GO
~~START~~
text
jdbc_user
~~END~~


SELECT current_setting('babelfishpg_tsql.migration_mode')
GO
~~START~~
Expand Down Expand Up @@ -387,14 +363,6 @@ int
USE master
GO

SELECT set_config('role', 'jdbc_user', false)
GO
~~START~~
text
jdbc_user
~~END~~


SELECT current_setting('babelfishpg_tsql.migration_mode')
GO
~~START~~
Expand All @@ -407,14 +375,6 @@ multi-db
USE babelfish_migration_mode_db2
GO

SELECT set_config('role', 'jdbc_user', false)
GO
~~START~~
text
jdbc_user
~~END~~


SELECT current_setting('babelfishpg_tsql.migration_mode')
GO
~~START~~
Expand Down Expand Up @@ -444,14 +404,6 @@ GO
DROP DATABASE babelfish_migration_mode_db2
GO

SELECT set_config('role', 'jdbc_user', false)
GO
~~START~~
text
jdbc_user
~~END~~




INSERT INTO babelfish_migration_mode_catalog_status2
Expand Down Expand Up @@ -486,25 +438,6 @@ varchar#!#int
TRUNCATE TABLE babelfish_migration_mode_catalog_status2
GO

SELECT set_config('role', 'jdbc_user', false)
GO
~~START~~
text
jdbc_user
~~END~~


-- Reset migration mode to default
DECLARE @mig_mode VARCHAR(10)
SET @mig_mode = (SELECT mig_mode FROM babelfish_migration_mode_tbl WHERE id_num = 1)
SELECT CASE WHEN (SELECT set_config('babelfishpg_tsql.migration_mode', @mig_mode, false)) IS NOT NULL THEN 1 ELSE 0 END
GO
~~START~~
int
1
~~END~~


INSERT INTO babelfish_migration_mode_catalog_status2
SELECT 'sys.babelfish_sysdatabases', COUNT(*) FROM sys.babelfish_sysdatabases
GO
Expand Down
46 changes: 0 additions & 46 deletions test/JDBC/expected/single_db/BABEL-1435.out
Original file line number Diff line number Diff line change
Expand Up @@ -183,29 +183,6 @@ GO
DROP DATABASE db1;
GO

-- Set current_user for testing db mode
IF (SELECT 1 FROM pg_roles WHERE rolname='jdbc_user') = 1
BEGIN
WITH SET_CTE
AS
(SELECT set_config('role', 'jdbc_user', false))
SELECT NULL
FROM SET_CTE
END
ELSE
BEGIN
WITH SET_CTE
AS
(SELECT set_config('role', 'babeltestuser', false))
SELECT NULL
FROM SET_CTE
END
GO
~~START~~
int
<NULL>
~~END~~


SELECT name FROM sys.sysdatabases ORDER BY name;
GO
Expand Down Expand Up @@ -473,29 +450,6 @@ GO
DROP DATABASE db1;
GO

-- Set current_user for testing db mode
IF (SELECT 1 FROM pg_roles WHERE rolname='jdbc_user') = 1
BEGIN
WITH SET_CTE
AS
(SELECT set_config('role', 'jdbc_user', false))
SELECT NULL
FROM SET_CTE
END
ELSE
BEGIN
WITH SET_CTE
AS
(SELECT set_config('role', 'babeltestuser', false))
SELECT NULL
FROM SET_CTE
END
GO
~~START~~
int
<NULL>
~~END~~


SELECT name FROM sys.sysdatabases ORDER BY name;
GO
Expand Down
16 changes: 0 additions & 16 deletions test/JDBC/expected/single_db/BABEL-1446.out
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,6 @@ int


-- test multi-db mode
SELECT set_config('role', 'jdbc_user', false);
GO
~~START~~
text
jdbc_user
~~END~~


CREATE DATABASE db1;
GO

Expand Down Expand Up @@ -233,14 +225,6 @@ int


-- test multi-db mode
SELECT set_config('role', 'jdbc_user', false);
GO
~~START~~
text
jdbc_user
~~END~~


CREATE DATABASE db1 COLLATE BBF_Unicode_CP1_CI_AI;
GO

Expand Down
Loading

0 comments on commit 6426975

Please sign in to comment.