Skip to content

Commit

Permalink
Remove GUC for setting migration mode for BABEL-4279 and test_search_…
Browse files Browse the repository at this point in the history
…path testfiles (#3185)

As part of #3096, we ignored these files to revisit the migration mode testing.
With this commit we have:
1. Removed GUC for setting migration mode to multi-db for BABEL-4279 and test_search_path testfiles.
2. Separated BABEL-4279 testfile for single-db and multi-db migration mode.

Signed-off-by: ANJU BHARTI <[email protected]>
  • Loading branch information
anju15bharti authored Dec 3, 2024
1 parent cd20d5f commit 45bc806
Show file tree
Hide file tree
Showing 8 changed files with 414 additions and 185 deletions.
46 changes: 0 additions & 46 deletions test/JDBC/expected/BABEL-4279.out
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
-- tsql
CREATE TABLE babelfish_migration_mode_table (id_num INT IDENTITY(1,1), mig_mode VARCHAR(10))
GO
INSERT INTO babelfish_migration_mode_table SELECT current_setting('babelfishpg_tsql.migration_mode')
GO
~~ROW COUNT: 1~~


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

SELECT set_config('babelfishpg_tsql.migration_mode', 'multi-db', false);
GO
~~START~~
text
multi-db
~~END~~


-- tsql
CREATE TABLE test_babel_4279_t1([ABC.nfds] INT, [DEf.j] INT);
GO
Expand Down Expand Up @@ -434,25 +410,3 @@ GO

DROP TABLE t3
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_table 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~~


Drop Table IF EXISTS babelfish_migration_mode_table
GO
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
CREATE TABLE babelfish_migration_mode_table (id_num INT IDENTITY(1,1), mig_mode VARCHAR(10))
GO
INSERT INTO babelfish_migration_mode_table SELECT current_setting('babelfishpg_tsql.migration_mode')
GO
~~ROW COUNT: 1~~


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

SELECT set_config('babelfishpg_tsql.migration_mode', 'multi-db', false);
GO
~~START~~
text
multi-db
~~END~~


-- check if correct schema is present in search path
CREATE DATABASE ["BABEL_5111.db"]
GO
Expand Down Expand Up @@ -355,25 +332,3 @@ GO

DROP DATABASE ["龙漫远; 龍漫遠.¢£€¥"]
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_table 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~~


Drop Table IF EXISTS babelfish_migration_mode_table
GO
Loading

0 comments on commit 45bc806

Please sign in to comment.