diff --git a/contrib/babelfishpg_tsql/src/hooks.c b/contrib/babelfishpg_tsql/src/hooks.c index 6553da8ccb..0082d0a906 100644 --- a/contrib/babelfishpg_tsql/src/hooks.c +++ b/contrib/babelfishpg_tsql/src/hooks.c @@ -1588,6 +1588,9 @@ pre_transform_target_entry(ResTarget *res, ParseState *pstate, int alias_len = 0; const char *colname_start; const char *identifier_name = NULL; + int open_square_bracket = 0; + int double_quotes = 0; + const char *last_dot; if (res->name == NULL && res->location != -1 && IsA(res->val, ColumnRef)) @@ -1600,12 +1603,69 @@ pre_transform_target_entry(ResTarget *res, ParseState *pstate, * sourcetext */ if (list_length(cref->fields) == 1 && - IsA(linitial(cref->fields), String)) + IsA(linitial(cref->fields), String)) { identifier_name = strVal(linitial(cref->fields)); alias_len = strlen(identifier_name); colname_start = pstate->p_sourcetext + res->location; } + /* + * This condition will preserve the case of column name when there are more than + * one cref->fields. For instance, Queries like + * 1. select [database].[schema].[table].[column] from table. + * 2. select [schema].[table].[column] from table. + * 3. select [t].[column] from table as t + * Case 1: Handle the cases when column name is passed with no delimiters + * For example, select ABC from table + * Case 2: Handle the cases when column name is delimited with dq. + * In such cases, we are checking if no. of dq are even or not. When dq are odd, + * we are not tracing number of sqb and sq within dq. + * For instance, Queries like select "AF bjs'vs] " from table. + * Case 3: Handle the case when column name is delimited with sqb. When number of sqb + * are zero, it means we are out of sqb. + */ + if(list_length(cref->fields) > 1 && + IsA(llast(cref->fields), String)) + { + identifier_name = strVal(llast(cref->fields)); + alias_len = strlen(identifier_name); + colname_start = pstate->p_sourcetext + res->location; + while(true) + { + if(open_square_bracket == 0 && *colname_start == '"') + { + double_quotes++; + } + /* To check how many open sqb are present in sourcetext. */ + else if(double_quotes % 2 == 0 && *colname_start == '[') + { + open_square_bracket++; + } + else if(double_quotes % 2 == 0 && *colname_start == ']') + { + open_square_bracket--; + } + /* + * last_dot pointer is to trace the last dot in the sourcetext, + * as last dot indicates the starting of column name. + */ + else if(open_square_bracket == 0 && double_quotes % 2 == 0 && *colname_start == '.') + { + last_dot = colname_start; + } + /* + * If there is no open sqb, there are even no. of sq or dq and colname_start is at + * space or comma, it means colname_start is at the end of column name. + */ + else if(open_square_bracket == 0 && double_quotes % 2 == 0 && (*colname_start == ' ' || *colname_start == ',')) + { + last_dot++; + colname_start = last_dot; + break; + } + colname_start++; + } + } } else if (res->name != NULL && res->name_location != -1) { diff --git a/test/JDBC/expected/BABEL-4279-vu-cleanup.out b/test/JDBC/expected/BABEL-4279-vu-cleanup.out new file mode 100644 index 0000000000..8226350864 --- /dev/null +++ b/test/JDBC/expected/BABEL-4279-vu-cleanup.out @@ -0,0 +1,60 @@ +-- tsql +DROP VIEW test_babel_4279_v1; +GO + +DROP VIEW test_babel_4279_v2; +GO + +DROP VIEW test_babel_4279_v3; +GO + +DROP TABLE test_babel_4279_t1; +GO + +USE [test_babel_4279_d.1]; +GO + +DROP VIEW test_babel_4279_sv1; +GO + +DROP TABLE test_babel_4279_s1.test_babel_4279_st1; +GO + +DROP SCHEMA test_babel_4279_s1; +GO + +USE MASTER; +GO + +DROP DATABASE [test_babel_4279_d.1]; +GO + +DROP VIEW test_babel_4279_v4; +GO + +DROP VIEW test_babel_4279_v5; +GO + +DROP TABLE test_babel_4279_t2; +GO + +DROP VIEW test_babel_4279_v6; +GO + +DROP TABLE "tngdf'".[sc,sdg"fdsngjds']; +GO + +DROP SCHEMA "tngdf'"; +GO + +DROP VIEW test_babel_4279_v7; +GO + +DROP TABLE test_babel_4279_t3; +GO + +DROP VIEW test_babel_4279_v8; +GO + +DROP TABLE test_babel_4279_t4; +GO diff --git a/test/JDBC/expected/BABEL-4279-vu-prepare.out b/test/JDBC/expected/BABEL-4279-vu-prepare.out new file mode 100644 index 0000000000..940c5b89ed --- /dev/null +++ b/test/JDBC/expected/BABEL-4279-vu-prepare.out @@ -0,0 +1,60 @@ +-- tsql +CREATE TABLE test_babel_4279_t1([ABC.nfds] INT, [DEf.j] INT); +GO + +CREATE VIEW test_babel_4279_v1 AS SELECT test_babel_4279_t1.[ABC.nfds] from test_babel_4279_t1; +GO + +CREATE VIEW test_babel_4279_v2 AS SELECT [test_babel_4279_t1].[ABC.nfds] ,test_babel_4279_t1.[DEf.j] from test_babel_4279_t1; +GO + +CREATE DATABASE [test_babel_4279_d.1]; +GO + +USE [test_babel_4279_d.1]; +GO + +CREATE SCHEMA test_babel_4279_s1; +GO + +CREATE TABLE test_babel_4279_s1.test_babel_4279_st1([ABC.nfds] INT, [DEf.j] INT); +GO + +CREATE VIEW test_babel_4279_sv1 AS SELECT [test_babel_4279_s1].[test_babel_4279_st1].[ABC.nfds] from test_babel_4279_s1.test_babel_4279_st1; +GO + +USE MASTER +GO + +CREATE VIEW test_babel_4279_v3 AS SELECT [test_babel_4279_d.1].[test_babel_4279_s1].[test_babel_4279_st1].[ABC.nfds] from [test_babel_4279_d.1].[test_babel_4279_s1].[test_babel_4279_st1]; +GO + +CREATE TABLE test_babel_4279_t2(您您对您对您对您对您对您对您对您对您对您您您 INT, 对您对您对您对您对您对您对您 INT); +GO + +CREATE VIEW test_babel_4279_v4 AS SELECT test_babel_4279_t2.[您您对您对您对您对您对您对您对您对您对您您您] from test_babel_4279_t2; +GO + +CREATE VIEW test_babel_4279_v5 AS SELECT ぁあ.[您您对您对您对您对您对您对您对您对您对您您您] from test_babel_4279_t2 AS ぁあ; +GO + +CREATE SCHEMA "tngdf'"; +GO + +CREATE TABLE "tngdf'".[sc,sdg"fdsngjds']("AB[C" INT); +GO + +CREATE VIEW test_babel_4279_v6 AS SELECT "tngdf'".[sc,sdg"fdsngjds']."AB[C" from "tngdf'".[sc,sdg"fdsngjds']; +GO + +CREATE TABLE test_babel_4279_t3(ABCD INT); +GO + +CREATE VIEW test_babel_4279_v7 AS SELECT test_babel_4279_t3.ABCD FROM test_babel_4279_t3; +GO + +CREATE TABLE test_babel_4279_t4([ぁあ'"] INT); +GO + +CREATE VIEW test_babel_4279_v8 AS SELECT test_babel_4279_t4.[ぁあ'"] FROM test_babel_4279_t4; +GO diff --git a/test/JDBC/expected/BABEL-4279-vu-verify.out b/test/JDBC/expected/BABEL-4279-vu-verify.out new file mode 100644 index 0000000000..46b9b8aae7 --- /dev/null +++ b/test/JDBC/expected/BABEL-4279-vu-verify.out @@ -0,0 +1,72 @@ +-- psql +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v1'; +GO +~~START~~ +text + SELECT test_babel_4279_t1."abc.nfds" AS "ABC.nfds" FROM master_dbo.test_babel_4279_t1; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v2'; +GO +~~START~~ +text + SELECT test_babel_4279_t1."abc.nfds" AS "ABC.nfds", test_babel_4279_t1."def.j" AS "DEf.j" FROM master_dbo.test_babel_4279_t1; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_sv1'; +GO +~~START~~ +text + SELECT test_babel_4279_st1."abc.nfds" AS "ABC.nfds" FROM "test_babel_4279_d.1_test_babel_4279_s1".test_babel_4279_st1; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v3'; +GO +~~START~~ +text + SELECT test_babel_4279_st1."abc.nfds" AS "ABC.nfds" FROM "test_babel_4279_d.1_test_babel_4279_s1".test_babel_4279_st1; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v4'; +GO +~~START~~ +text + SELECT test_babel_4279_t2."您您对您对您对您对您d60211ff7d947ff09db87babbf0cb9de" FROM master_dbo.test_babel_4279_t2; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v5'; +GO +~~START~~ +text + SELECT "ぁあ"."您您对您对您对您对您d60211ff7d947ff09db87babbf0cb9de" FROM master_dbo.test_babel_4279_t2 "ぁあ"; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v6'; +GO +~~START~~ +text + SELECT "sc,sdg""fdsngjds'"."ab[c" AS "AB[C" FROM "master_tngdf'"."sc,sdg""fdsngjds'"; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v7'; +GO +~~START~~ +text + SELECT test_babel_4279_t3.abcd AS "ABCD" FROM master_dbo.test_babel_4279_t3; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v8'; +GO +~~START~~ +text + SELECT test_babel_4279_t4."ぁあ'""" FROM master_dbo.test_babel_4279_t4; +~~END~~ + diff --git a/test/JDBC/expected/BABEL-4279.out b/test/JDBC/expected/BABEL-4279.out new file mode 100644 index 0000000000..ba6f3c90fa --- /dev/null +++ b/test/JDBC/expected/BABEL-4279.out @@ -0,0 +1,194 @@ +-- tsql +CREATE TABLE test_babel_4279_t1([ABC.nfds] INT, [DEf.j] INT); +GO + +CREATE VIEW test_babel_4279_v1 AS SELECT test_babel_4279_t1.[ABC.nfds] from test_babel_4279_t1; +GO + +CREATE VIEW test_babel_4279_v2 AS SELECT [test_babel_4279_t1].[ABC.nfds] ,test_babel_4279_t1.[DEf.j] from test_babel_4279_t1; +GO + +CREATE DATABASE ["test_babel_4279_d.1"]; +GO + +USE ["test_babel_4279_d.1"]; +GO + +CREATE SCHEMA test_babel_4279_s1; +GO + +CREATE TABLE test_babel_4279_s1.test_babel_4279_st1([ABC.nfds] INT, [DEf.j] INT); +GO + +CREATE VIEW test_babel_4279_sv1 AS SELECT [test_babel_4279_s1].[test_babel_4279_st1].[ABC.nfds] from test_babel_4279_s1.test_babel_4279_st1; +GO + +USE MASTER +GO + +CREATE VIEW test_babel_4279_v3 AS SELECT ["test_babel_4279_d.1"].[test_babel_4279_s1].[test_babel_4279_st1].[ABC.nfds] from ["test_babel_4279_d.1"].[test_babel_4279_s1].[test_babel_4279_st1]; +GO + +CREATE TABLE test_babel_4279_t2(您您对您对您对您对您对您对您对您对您对您您您 INT, 对您对您对您对您对您对您对您 INT); +GO + +CREATE VIEW test_babel_4279_v4 AS SELECT test_babel_4279_t2.[您您对您对您对您对您对您对您对您对您对您您您] from test_babel_4279_t2; +GO + +CREATE VIEW test_babel_4279_v5 AS SELECT ぁあ.[您您对您对您对您对您对您对您对您对您对您您您] from test_babel_4279_t2 AS ぁあ; +GO + +CREATE SCHEMA "tngdf'"; +GO + +CREATE TABLE "tngdf'".[sc,sdg"fdsngjds']("AB[C" INT); +GO + +CREATE VIEW test_babel_4279_v6 AS SELECT "tngdf'".[sc,sdg"fdsngjds']."AB[C" from "tngdf'".[sc,sdg"fdsngjds']; +GO + +CREATE TABLE test_babel_4279_t3(ABCD INT); +GO + +CREATE VIEW test_babel_4279_v7 AS SELECT test_babel_4279_t3.ABCD FROM test_babel_4279_t3; +GO + +CREATE TABLE test_babel_4279_t4([ぁあ'"] INT); +GO + +CREATE VIEW test_babel_4279_v8 AS SELECT test_babel_4279_t4.[ぁあ'"] FROM test_babel_4279_t4; +GO + +-- psql +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v1'; +GO +~~START~~ +text + SELECT test_babel_4279_t1."abc.nfds" AS "ABC.nfds" FROM master_dbo.test_babel_4279_t1; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v2'; +GO +~~START~~ +text + SELECT test_babel_4279_t1."abc.nfds" AS "ABC.nfds", test_babel_4279_t1."def.j" AS "DEf.j" FROM master_dbo.test_babel_4279_t1; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_sv1'; +GO +~~START~~ +text + SELECT test_babel_4279_st1."abc.nfds" AS "ABC.nfds" FROM test_babel_4279_s1.test_babel_4279_st1; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v3'; +GO +~~START~~ +text + SELECT test_babel_4279_st1."abc.nfds" AS "ABC.nfds" FROM test_babel_4279_s1.test_babel_4279_st1; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v4'; +GO +~~START~~ +text + SELECT test_babel_4279_t2."您您对您对您对您对您d60211ff7d947ff09db87babbf0cb9de" FROM master_dbo.test_babel_4279_t2; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v5'; +GO +~~START~~ +text + SELECT "ぁあ"."您您对您对您对您对您d60211ff7d947ff09db87babbf0cb9de" FROM master_dbo.test_babel_4279_t2 "ぁあ"; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v6'; +GO +~~START~~ +text + SELECT "sc,sdg""fdsngjds'"."ab[c" AS "AB[C" FROM "master_tngdf'"."sc,sdg""fdsngjds'"; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v7'; +GO +~~START~~ +text + SELECT test_babel_4279_t3.abcd AS "ABCD" FROM master_dbo.test_babel_4279_t3; +~~END~~ + + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v8'; +GO +~~START~~ +text + SELECT test_babel_4279_t4."ぁあ'""" FROM master_dbo.test_babel_4279_t4; +~~END~~ + + +-- tsql +DROP VIEW test_babel_4279_v1; +GO + +DROP VIEW test_babel_4279_v2; +GO + +DROP VIEW test_babel_4279_v3; +GO + +DROP TABLE test_babel_4279_t1; +GO + +USE ["test_babel_4279_d.1"]; +GO + +DROP VIEW test_babel_4279_sv1; +GO + +DROP TABLE test_babel_4279_s1.test_babel_4279_st1; +GO + +DROP SCHEMA test_babel_4279_s1; +GO + +USE MASTER; +GO + +DROP DATABASE ["test_babel_4279_d.1"]; +GO + +DROP VIEW test_babel_4279_v4; +GO + +DROP VIEW test_babel_4279_v5; +GO + +DROP TABLE test_babel_4279_t2; +GO + +DROP VIEW test_babel_4279_v6; +GO + +DROP TABLE "tngdf'".[sc,sdg"fdsngjds']; +GO + +DROP SCHEMA "tngdf'"; +GO + +DROP VIEW test_babel_4279_v7; +GO + +DROP TABLE test_babel_4279_t3; +GO + +DROP VIEW test_babel_4279_v8; +GO + +DROP TABLE test_babel_4279_t4; +GO diff --git a/test/JDBC/input/BABEL-4279-vu-cleanup.sql b/test/JDBC/input/BABEL-4279-vu-cleanup.sql new file mode 100644 index 0000000000..8226350864 --- /dev/null +++ b/test/JDBC/input/BABEL-4279-vu-cleanup.sql @@ -0,0 +1,60 @@ +-- tsql +DROP VIEW test_babel_4279_v1; +GO + +DROP VIEW test_babel_4279_v2; +GO + +DROP VIEW test_babel_4279_v3; +GO + +DROP TABLE test_babel_4279_t1; +GO + +USE [test_babel_4279_d.1]; +GO + +DROP VIEW test_babel_4279_sv1; +GO + +DROP TABLE test_babel_4279_s1.test_babel_4279_st1; +GO + +DROP SCHEMA test_babel_4279_s1; +GO + +USE MASTER; +GO + +DROP DATABASE [test_babel_4279_d.1]; +GO + +DROP VIEW test_babel_4279_v4; +GO + +DROP VIEW test_babel_4279_v5; +GO + +DROP TABLE test_babel_4279_t2; +GO + +DROP VIEW test_babel_4279_v6; +GO + +DROP TABLE "tngdf'".[sc,sdg"fdsngjds']; +GO + +DROP SCHEMA "tngdf'"; +GO + +DROP VIEW test_babel_4279_v7; +GO + +DROP TABLE test_babel_4279_t3; +GO + +DROP VIEW test_babel_4279_v8; +GO + +DROP TABLE test_babel_4279_t4; +GO diff --git a/test/JDBC/input/BABEL-4279-vu-prepare.sql b/test/JDBC/input/BABEL-4279-vu-prepare.sql new file mode 100644 index 0000000000..940c5b89ed --- /dev/null +++ b/test/JDBC/input/BABEL-4279-vu-prepare.sql @@ -0,0 +1,60 @@ +-- tsql +CREATE TABLE test_babel_4279_t1([ABC.nfds] INT, [DEf.j] INT); +GO + +CREATE VIEW test_babel_4279_v1 AS SELECT test_babel_4279_t1.[ABC.nfds] from test_babel_4279_t1; +GO + +CREATE VIEW test_babel_4279_v2 AS SELECT [test_babel_4279_t1].[ABC.nfds] ,test_babel_4279_t1.[DEf.j] from test_babel_4279_t1; +GO + +CREATE DATABASE [test_babel_4279_d.1]; +GO + +USE [test_babel_4279_d.1]; +GO + +CREATE SCHEMA test_babel_4279_s1; +GO + +CREATE TABLE test_babel_4279_s1.test_babel_4279_st1([ABC.nfds] INT, [DEf.j] INT); +GO + +CREATE VIEW test_babel_4279_sv1 AS SELECT [test_babel_4279_s1].[test_babel_4279_st1].[ABC.nfds] from test_babel_4279_s1.test_babel_4279_st1; +GO + +USE MASTER +GO + +CREATE VIEW test_babel_4279_v3 AS SELECT [test_babel_4279_d.1].[test_babel_4279_s1].[test_babel_4279_st1].[ABC.nfds] from [test_babel_4279_d.1].[test_babel_4279_s1].[test_babel_4279_st1]; +GO + +CREATE TABLE test_babel_4279_t2(您您对您对您对您对您对您对您对您对您对您您您 INT, 对您对您对您对您对您对您对您 INT); +GO + +CREATE VIEW test_babel_4279_v4 AS SELECT test_babel_4279_t2.[您您对您对您对您对您对您对您对您对您对您您您] from test_babel_4279_t2; +GO + +CREATE VIEW test_babel_4279_v5 AS SELECT ぁあ.[您您对您对您对您对您对您对您对您对您对您您您] from test_babel_4279_t2 AS ぁあ; +GO + +CREATE SCHEMA "tngdf'"; +GO + +CREATE TABLE "tngdf'".[sc,sdg"fdsngjds']("AB[C" INT); +GO + +CREATE VIEW test_babel_4279_v6 AS SELECT "tngdf'".[sc,sdg"fdsngjds']."AB[C" from "tngdf'".[sc,sdg"fdsngjds']; +GO + +CREATE TABLE test_babel_4279_t3(ABCD INT); +GO + +CREATE VIEW test_babel_4279_v7 AS SELECT test_babel_4279_t3.ABCD FROM test_babel_4279_t3; +GO + +CREATE TABLE test_babel_4279_t4([ぁあ'"] INT); +GO + +CREATE VIEW test_babel_4279_v8 AS SELECT test_babel_4279_t4.[ぁあ'"] FROM test_babel_4279_t4; +GO diff --git a/test/JDBC/input/BABEL-4279-vu-verify.mix b/test/JDBC/input/BABEL-4279-vu-verify.mix new file mode 100644 index 0000000000..2988963e17 --- /dev/null +++ b/test/JDBC/input/BABEL-4279-vu-verify.mix @@ -0,0 +1,27 @@ +-- psql +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v1'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v2'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_sv1'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v3'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v4'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v5'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v6'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v7'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v8'; +GO diff --git a/test/JDBC/input/BABEL-4279.mix b/test/JDBC/input/BABEL-4279.mix new file mode 100644 index 0000000000..f6f10813d2 --- /dev/null +++ b/test/JDBC/input/BABEL-4279.mix @@ -0,0 +1,149 @@ +-- tsql +CREATE TABLE test_babel_4279_t1([ABC.nfds] INT, [DEf.j] INT); +GO + +CREATE VIEW test_babel_4279_v1 AS SELECT test_babel_4279_t1.[ABC.nfds] from test_babel_4279_t1; +GO + +CREATE VIEW test_babel_4279_v2 AS SELECT [test_babel_4279_t1].[ABC.nfds] ,test_babel_4279_t1.[DEf.j] from test_babel_4279_t1; +GO + +CREATE DATABASE ["test_babel_4279_d.1"]; +GO + +USE ["test_babel_4279_d.1"]; +GO + +CREATE SCHEMA test_babel_4279_s1; +GO + +CREATE TABLE test_babel_4279_s1.test_babel_4279_st1([ABC.nfds] INT, [DEf.j] INT); +GO + +CREATE VIEW test_babel_4279_sv1 AS SELECT [test_babel_4279_s1].[test_babel_4279_st1].[ABC.nfds] from test_babel_4279_s1.test_babel_4279_st1; +GO + +USE MASTER +GO + +CREATE VIEW test_babel_4279_v3 AS SELECT ["test_babel_4279_d.1"].[test_babel_4279_s1].[test_babel_4279_st1].[ABC.nfds] from ["test_babel_4279_d.1"].[test_babel_4279_s1].[test_babel_4279_st1]; +GO + +CREATE TABLE test_babel_4279_t2(您您对您对您对您对您对您对您对您对您对您您您 INT, 对您对您对您对您对您对您对您 INT); +GO + +CREATE VIEW test_babel_4279_v4 AS SELECT test_babel_4279_t2.[您您对您对您对您对您对您对您对您对您对您您您] from test_babel_4279_t2; +GO + +CREATE VIEW test_babel_4279_v5 AS SELECT ぁあ.[您您对您对您对您对您对您对您对您对您对您您您] from test_babel_4279_t2 AS ぁあ; +GO + +CREATE SCHEMA "tngdf'"; +GO + +CREATE TABLE "tngdf'".[sc,sdg"fdsngjds']("AB[C" INT); +GO + +CREATE VIEW test_babel_4279_v6 AS SELECT "tngdf'".[sc,sdg"fdsngjds']."AB[C" from "tngdf'".[sc,sdg"fdsngjds']; +GO + +CREATE TABLE test_babel_4279_t3(ABCD INT); +GO + +CREATE VIEW test_babel_4279_v7 AS SELECT test_babel_4279_t3.ABCD FROM test_babel_4279_t3; +GO + +CREATE TABLE test_babel_4279_t4([ぁあ'"] INT); +GO + +CREATE VIEW test_babel_4279_v8 AS SELECT test_babel_4279_t4.[ぁあ'"] FROM test_babel_4279_t4; +GO + +-- psql +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v1'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v2'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_sv1'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v3'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v4'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v5'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v6'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v7'; +GO + +SELECT pg_catalog.pg_get_viewdef(oid, true) FROM pg_class WHERE relname = 'test_babel_4279_v8'; +GO + +-- tsql +DROP VIEW test_babel_4279_v1; +GO + +DROP VIEW test_babel_4279_v2; +GO + +DROP VIEW test_babel_4279_v3; +GO + +DROP TABLE test_babel_4279_t1; +GO + +USE ["test_babel_4279_d.1"]; +GO + +DROP VIEW test_babel_4279_sv1; +GO + +DROP TABLE test_babel_4279_s1.test_babel_4279_st1; +GO + +DROP SCHEMA test_babel_4279_s1; +GO + +USE MASTER; +GO + +DROP DATABASE ["test_babel_4279_d.1"]; +GO + +DROP VIEW test_babel_4279_v4; +GO + +DROP VIEW test_babel_4279_v5; +GO + +DROP TABLE test_babel_4279_t2; +GO + +DROP VIEW test_babel_4279_v6; +GO + +DROP TABLE "tngdf'".[sc,sdg"fdsngjds']; +GO + +DROP SCHEMA "tngdf'"; +GO + +DROP VIEW test_babel_4279_v7; +GO + +DROP TABLE test_babel_4279_t3; +GO + +DROP VIEW test_babel_4279_v8; +GO + +DROP TABLE test_babel_4279_t4; +GO diff --git a/test/JDBC/jdbc_schedule b/test/JDBC/jdbc_schedule index a2dda3bb77..520643ad73 100644 --- a/test/JDBC/jdbc_schedule +++ b/test/JDBC/jdbc_schedule @@ -149,3 +149,8 @@ ignore#!#load_road ignore#!#load_tenk ignore#!#load_stud_emp ignore#!#load_student + +# These tests are running in multidb mode in upgrade and singledb mode in JDBC +ignore#!#BABEL-4279-vu-prepare +ignore#!#BABEL-4279-vu-verify +ignore#!#BABEL-4279-vu-cleanup diff --git a/test/JDBC/upgrade/latest/schedule b/test/JDBC/upgrade/latest/schedule index 8158b2fe86..9295a86c26 100644 --- a/test/JDBC/upgrade/latest/schedule +++ b/test/JDBC/upgrade/latest/schedule @@ -467,4 +467,5 @@ BABEL-4410 BABEL-4231 sys_asymmetric_keys sys_certificates -sys_database_permissions \ No newline at end of file +sys_database_permissions +BABEL-4279