From 8059dcccd76dc1dc69fda8605b254f0ea251cc54 Mon Sep 17 00:00:00 2001 From: Tanzeel Khan Date: Tue, 14 May 2024 13:36:05 +0000 Subject: [PATCH 1/4] fix drop constraint Signed-off-by: Tanzeel Khan --- contrib/babelfishpg_tsql/src/pl_handler.c | 7 - test/JDBC/expected/BABEL_2047.out | 706 ++++++++++++++++++++++ test/JDBC/input/BABEL_2047.sql | 591 ++++++++++++++++++ 3 files changed, 1297 insertions(+), 7 deletions(-) create mode 100644 test/JDBC/expected/BABEL_2047.out create mode 100644 test/JDBC/input/BABEL_2047.sql diff --git a/contrib/babelfishpg_tsql/src/pl_handler.c b/contrib/babelfishpg_tsql/src/pl_handler.c index be89903320..eee1b9d445 100644 --- a/contrib/babelfishpg_tsql/src/pl_handler.c +++ b/contrib/babelfishpg_tsql/src/pl_handler.c @@ -844,8 +844,6 @@ pltsql_post_parse_analyze(ParseState *pstate, Query *query, JumbleState *jstate) { Constraint *c = (Constraint *) element; - c->conname = construct_unique_index_name(c->conname, stmt->relation->relname); - if (rowversion_column_name) validate_rowversion_table_constraint(c, rowversion_column_name); } @@ -933,8 +931,6 @@ pltsql_post_parse_analyze(ParseState *pstate, Query *query, JumbleState *jstate) { Constraint *c = castNode(Constraint, cmd->def); - c->conname = construct_unique_index_name(c->conname, atstmt->relation->relname); - if (escape_hatch_unique_constraint != EH_IGNORE && c->contype == CONSTR_UNIQUE && is_nullable_constraint(c, relid)) @@ -1024,9 +1020,6 @@ pltsql_post_parse_analyze(ParseState *pstate, Query *query, JumbleState *jstate) } } break; - case AT_DropConstraint: - cmd->name = construct_unique_index_name(cmd->name, atstmt->relation->relname); - break; default: break; } diff --git a/test/JDBC/expected/BABEL_2047.out b/test/JDBC/expected/BABEL_2047.out new file mode 100644 index 0000000000..f101e62403 --- /dev/null +++ b/test/JDBC/expected/BABEL_2047.out @@ -0,0 +1,706 @@ + + +-- 1. TABLE NAME and CONSTRAINT less than 64 + -- a. PRIMARY KEY + -- b. UNIQUE + -- c. CHECK + -- d. FOREIGN +-- 2. TABLE NAME and CONSTRAINT greater than 64 + -- a. PRIMARY KEY + -- b. UNIQUE + -- c. CHECK + -- d. FOREIGN +-- For each sub section + --> CREATE TABLE --> NAMED CONSTRAINT --> TABLE CONSTRAINT + --> COLUMN CONSTRAINT + --> UNNAMED CONSTRAINT --> TABLE CONSTRAINT + --> COLUMN CONSTRAINT + --> ALTER TABLE --> TABLE CONSTRAINT + --> COLUMN CONSTRAINT + --> DROP ALL CONSTRAINTS +sp_babelfish_configure 'babelfishpg_tsql.escape_hatch_unique_constraint', 'ignore' +GO + +-- +-- +/********** PRIMARY KEY (<64) **********/ +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1 (id INT, CONSTRAINT BABEL_2047_namedTableConstraint PRIMARY KEY(id)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2 (id INT CONSTRAINT BABEL_2047_namedColumnConstraint PRIMARY KEY) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3 (id INT, PRIMARY KEY(id)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4 (id INT PRIMARY KEY) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5 (id INT) +GO +ALTER TABLE BABEL_2047_t5 ADD id1 INT PRIMARY KEY +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6 (id INT) +GO +ALTER TABLE BABEL_2047_t6 ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table PRIMARY KEY(id) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +babel_2047_t1#!#babel_2047_namedtableconstraint +babel_2047_t2#!#babel_2047_namedcolumnconstraint +babel_2047_t3#!#babel_2047_t3_pkey +babel_2047_t4#!#babel_2047_t4_pkey +babel_2047_t5#!#babel_2047_t5_pkey +babel_2047_t6#!#babel_2047_namedtableconstraint_alter_table +~~END~~ + + +ALTER TABLE BABEL_2047_t1 DROP CONSTRAINT BABEL_2047_namedTableConstraint +GO +ALTER TABLE BABEL_2047_t2 DROP CONSTRAINT BABEL_2047_namedColumnConstraint +GO +ALTER TABLE BABEL_2047_t3 DROP CONSTRAINT babel_2047_t3_pkey +GO +ALTER TABLE BABEL_2047_t4 DROP CONSTRAINT babel_2047_t4_pkey +GO +ALTER TABLE BABEL_2047_t5 DROP CONSTRAINT babel_2047_t5_pkey +GO +ALTER TABLE BABEL_2047_t6 DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +~~END~~ + + +DROP TABLE BABEL_2047_t1, BABEL_2047_t2, BABEL_2047_t3, BABEL_2047_t4, BABEL_2047_t5, BABEL_2047_t6 +GO + +# +# +# + +/********** END OF PRIMARY KEY (<64) **********/ +/********** UNIQUE (<64) **********/ +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1 (id INT, CONSTRAINT BABEL_2047_namedTableConstraint UNIQUE(id)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2 (id INT CONSTRAINT BABEL_2047_namedColumnConstraint UNIQUE) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3 (id INT, UNIQUE(id)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4 (id INT UNIQUE) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5 (id INT) +GO +ALTER TABLE BABEL_2047_t5 ADD id1 INT UNIQUE +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6 (id INT) +GO +ALTER TABLE BABEL_2047_t6 ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table UNIQUE(id) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +babel_2047_t1#!#babel_2047_namedtableconstraint +babel_2047_t2#!#babel_2047_namedcolumnconstraint +babel_2047_t3#!#babel_2047_t3_id_key +babel_2047_t4#!#babel_2047_t4_id_key +babel_2047_t5#!#babel_2047_t5_id1_key +babel_2047_t6#!#babel_2047_namedtableconstraint_alter_table +~~END~~ + + +ALTER TABLE BABEL_2047_t1 DROP CONSTRAINT BABEL_2047_namedTableConstraint +GO +ALTER TABLE BABEL_2047_t2 DROP CONSTRAINT BABEL_2047_namedColumnConstraint +GO +ALTER TABLE BABEL_2047_t3 DROP CONSTRAINT babel_2047_t3_id_key +GO +ALTER TABLE BABEL_2047_t4 DROP CONSTRAINT babel_2047_t4_id_key +GO +ALTER TABLE BABEL_2047_t5 DROP CONSTRAINT babel_2047_t5_id1_key +GO +ALTER TABLE BABEL_2047_t6 DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +~~END~~ + + +DROP TABLE BABEL_2047_t1, BABEL_2047_t2, BABEL_2047_t3, BABEL_2047_t4, BABEL_2047_t5, BABEL_2047_t6 +GO + +# +# +# + +/********** END OF UNIQUE (<64) **********/ +/********** CHECK (<64) **********/ +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1 (id INT, CONSTRAINT BABEL_2047_namedTableConstraint CHECK(id > 0)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2 (id INT CONSTRAINT BABEL_2047_namedColumnConstraint CHECK(id > 0)) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3 (id INT, CHECK(id > 0)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4 (id INT CHECK(id > 0)) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5 (id INT) +GO +ALTER TABLE BABEL_2047_t5 ADD id1 INT CHECK(id > 0) +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6 (id INT) +GO +ALTER TABLE BABEL_2047_t6 ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table CHECK(id > 0) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +babel_2047_t1#!#babel_2047_namedtableconstraint +babel_2047_t2#!#babel_2047_namedcolumnconstraint +babel_2047_t3#!#babel_2047_t3_id_check +babel_2047_t4#!#babel_2047_t4_id_check +babel_2047_t5#!#babel_2047_t5_id_check +babel_2047_t6#!#babel_2047_namedtableconstraint_alter_table +~~END~~ + + +ALTER TABLE BABEL_2047_t1 DROP CONSTRAINT BABEL_2047_namedTableConstraint +GO +ALTER TABLE BABEL_2047_t2 DROP CONSTRAINT BABEL_2047_namedColumnConstraint +GO +ALTER TABLE BABEL_2047_t3 DROP CONSTRAINT babel_2047_t3_id_check +GO +ALTER TABLE BABEL_2047_t4 DROP CONSTRAINT babel_2047_t4_id_check +GO +ALTER TABLE BABEL_2047_t5 DROP CONSTRAINT babel_2047_t5_id_check +GO +ALTER TABLE BABEL_2047_t6 DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +~~END~~ + + +DROP TABLE BABEL_2047_t1, BABEL_2047_t2, BABEL_2047_t3, BABEL_2047_t4, BABEL_2047_t5, BABEL_2047_t6 +GO + +# +# +# + +/********** END OF CHECK (<64) **********/ +/********** FOREIGN KEY (<64) **********/ +CREATE TABLE BABEL_2047_FOERIGN_TABLE (id INT UNIQUE) +GO + +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1 (id INT, CONSTRAINT BABEL_2047_namedTableConstraint FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2 (id INT CONSTRAINT BABEL_2047_namedColumnConstraint FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3 (id INT, FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4 (id INT FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5 (id INT) +GO +ALTER TABLE BABEL_2047_t5 ADD id1 INT REFERENCES BABEL_2047_FOERIGN_TABLE(id) +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6 (id INT) +GO +ALTER TABLE BABEL_2047_t6 ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +babel_2047_foerign_table#!#babel_2047_foerign_table_id_key +babel_2047_t1#!#babel_2047_namedtableconstraint +babel_2047_t2#!#babel_2047_namedcolumnconstraint +babel_2047_t3#!#babel_2047_t3_id_fkey +babel_2047_t4#!#babel_2047_t4_id_fkey +babel_2047_t5#!#babel_2047_t5_id1_fkey +babel_2047_t6#!#babel_2047_namedtableconstraint_alter_table +~~END~~ + + +ALTER TABLE BABEL_2047_t1 DROP CONSTRAINT BABEL_2047_namedTableConstraint +GO +ALTER TABLE BABEL_2047_t2 DROP CONSTRAINT BABEL_2047_namedColumnConstraint +GO +ALTER TABLE BABEL_2047_t3 DROP CONSTRAINT BABEL_2047_t3_id_fkey +GO +ALTER TABLE BABEL_2047_t4 DROP CONSTRAINT BABEL_2047_t4_id_fkey +GO +ALTER TABLE BABEL_2047_t5 DROP CONSTRAINT BABEL_2047_t5_id1_fkey +GO +ALTER TABLE BABEL_2047_t6 DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +babel_2047_foerign_table#!#babel_2047_foerign_table_id_key +~~END~~ + + +DROP TABLE BABEL_2047_t1, BABEL_2047_t2, BABEL_2047_t3, BABEL_2047_t4, BABEL_2047_t5, BABEL_2047_t6, BABEL_2047_FOERIGN_TABLE +GO + +# +# +# +# +# +# + +/********** END OF FOREIGN KEY (<64) **********/ +/* RERUN ALL TESTS BUT WITH TABLENAME & CONSTRAINT NAME LENGTH GREATER THAN 64*/ +/********** PRIMARY KEY (>=64) **********/ +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL PRIMARY KEY(id)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL PRIMARY KEY) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, PRIMARY KEY(id)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT PRIMARY KEY) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT) +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD id1 INT PRIMARY KEY +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL(id INT) +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL PRIMARY KEY(id) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +babel_2047_t1_bbbbbbbbbaaaaaaaa18ca0034dacfc6dfc795fbe9e7bfec6a#!#babel_2047_namedtableconstraintf1c674741d14fa73138f4d0797423ce3 +babel_2047_t2_bbbbbbbbbaaaaaaaa4922fc912877af45fb768d7654686b86#!#babel_2047_namedcolumnconstrain3740326be7c2fb708f9381ba7fe19b5e +babel_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926f9a3346cc#!#babel_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926f9a3_pkey +babel_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2cfb384746#!#babel_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2cfb3_pkey +babel_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e8701b6a68#!#babel_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e8701_pkey +babel_2047_t6_bbbbbbbbbaaaaaaaa12496cf727a649e1f502c608cd498c29#!#babel_2047_namedtableconstraint10bacf92104ff237c853d7cb29d58a3c +~~END~~ + + +ALTER TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926f9a3_pkey +GO +ALTER TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2cfb3_pkey +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e8701_pkey +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +~~END~~ + + +DROP TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO + +# +# +# + +/********** END OF PRIMARY KEY (>=64) **********/ +/********** UNIQUE (>=64) **********/ +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL UNIQUE(id)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL UNIQUE) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, UNIQUE(id)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT UNIQUE) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT) +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD id1 INT UNIQUE +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT) +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL UNIQUE(id) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +babel_2047_t1_bbbbbbbbbaaaaaaaa18ca0034dacfc6dfc795fbe9e7bfec6a#!#babel_2047_namedtableconstraintf1c674741d14fa73138f4d0797423ce3 +babel_2047_t2_bbbbbbbbbaaaaaaaa4922fc912877af45fb768d7654686b86#!#babel_2047_namedcolumnconstrain3740326be7c2fb708f9381ba7fe19b5e +babel_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926f9a3346cc#!#babel_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926f9_id_key +babel_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2cfb384746#!#babel_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2cf_id_key +babel_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e8701b6a68#!#babel_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e8_id1_key +babel_2047_t6_bbbbbbbbbaaaaaaaa12496cf727a649e1f502c608cd498c29#!#babel_2047_namedtableconstraint10bacf92104ff237c853d7cb29d58a3c +~~END~~ + + +ALTER TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926f9_id_key +GO +ALTER TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2cf_id_key +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e8_id1_key +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +~~END~~ + + +DROP TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO + +# +# +# + +/********** END OF UNIQUE (>=64) **********/ +/********** CHECK (>=64) **********/ +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL CHECK(id > 0)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL CHECK(id > 0)) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, CHECK(id > 0)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT CHECK(id > 0)) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT) +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD id1 INT CHECK(id > 0) +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT) +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL CHECK(id > 0) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +babel_2047_t1_bbbbbbbbbaaaaaaaa18ca0034dacfc6dfc795fbe9e7bfec6a#!#babel_2047_namedtableconstraintf1c674741d14fa73138f4d0797423ce3 +babel_2047_t2_bbbbbbbbbaaaaaaaa4922fc912877af45fb768d7654686b86#!#babel_2047_namedcolumnconstrain3740326be7c2fb708f9381ba7fe19b5e +babel_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926f9a3346cc#!#babel_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926_id_check +babel_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2cfb384746#!#babel_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2_id_check +babel_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e8701b6a68#!#babel_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e_id_check +babel_2047_t6_bbbbbbbbbaaaaaaaa12496cf727a649e1f502c608cd498c29#!#babel_2047_namedtableconstraint10bacf92104ff237c853d7cb29d58a3c +~~END~~ + + +ALTER TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926_id_check +GO +ALTER TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2_id_check +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e_id_check +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +~~END~~ + + +DROP TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO + +# +# +# + +/********** END OF CHECK (>=64) **********/ +/********** FOREIGN KEY (>=64) **********/ +CREATE TABLE BABEL_2047_FOERIGN_TABLE (id INT UNIQUE) +GO + +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT) +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD id1 INT REFERENCES BABEL_2047_FOERIGN_TABLE(id) +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT) +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +babel_2047_foerign_table#!#babel_2047_foerign_table_id_key +babel_2047_t1_bbbbbbbbbaaaaaaaa18ca0034dacfc6dfc795fbe9e7bfec6a#!#babel_2047_namedtableconstraintf1c674741d14fa73138f4d0797423ce3 +babel_2047_t2_bbbbbbbbbaaaaaaaa4922fc912877af45fb768d7654686b86#!#babel_2047_namedcolumnconstrain3740326be7c2fb708f9381ba7fe19b5e +babel_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926f9a3346cc#!#babel_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926f_id_fkey +babel_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2cfb384746#!#babel_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2c_id_fkey +babel_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e8701b6a68#!#babel_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e_id1_fkey +babel_2047_t6_bbbbbbbbbaaaaaaaa12496cf727a649e1f502c608cd498c29#!#babel_2047_namedtableconstraint10bacf92104ff237c853d7cb29d58a3c +~~END~~ + + +ALTER TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926f_id_fkey +GO +ALTER TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2c_id_fkey +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e_id1_fkey +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO +~~START~~ +varchar#!#varchar +babel_2047_foerign_table#!#babel_2047_foerign_table_id_key +~~END~~ + + +DROP TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_FOERIGN_TABLE +GO + diff --git a/test/JDBC/input/BABEL_2047.sql b/test/JDBC/input/BABEL_2047.sql new file mode 100644 index 0000000000..1b635354c4 --- /dev/null +++ b/test/JDBC/input/BABEL_2047.sql @@ -0,0 +1,591 @@ +-- 1. TABLE NAME and CONSTRAINT less than 64 + -- a. PRIMARY KEY + -- b. UNIQUE + -- c. CHECK + -- d. FOREIGN +-- 2. TABLE NAME and CONSTRAINT greater than 64 + -- a. PRIMARY KEY + -- b. UNIQUE + -- c. CHECK + -- d. FOREIGN + +-- For each sub section + --> CREATE TABLE --> NAMED CONSTRAINT --> TABLE CONSTRAINT + --> COLUMN CONSTRAINT + --> UNNAMED CONSTRAINT --> TABLE CONSTRAINT + --> COLUMN CONSTRAINT + --> ALTER TABLE --> TABLE CONSTRAINT + --> COLUMN CONSTRAINT + --> DROP ALL CONSTRAINTS + +sp_babelfish_configure 'babelfishpg_tsql.escape_hatch_unique_constraint', 'ignore' +GO +-- +-- +/********** PRIMARY KEY (<64) **********/ + +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1 (id INT, CONSTRAINT BABEL_2047_namedTableConstraint PRIMARY KEY(id)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2 (id INT CONSTRAINT BABEL_2047_namedColumnConstraint PRIMARY KEY) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3 (id INT, PRIMARY KEY(id)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4 (id INT PRIMARY KEY) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5 (id INT) +GO +ALTER TABLE BABEL_2047_t5 ADD id1 INT PRIMARY KEY +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6 (id INT) +GO +ALTER TABLE BABEL_2047_t6 ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table PRIMARY KEY(id) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +ALTER TABLE BABEL_2047_t1 DROP CONSTRAINT BABEL_2047_namedTableConstraint +GO +ALTER TABLE BABEL_2047_t2 DROP CONSTRAINT BABEL_2047_namedColumnConstraint +GO +ALTER TABLE BABEL_2047_t3 DROP CONSTRAINT babel_2047_t3_pkey +GO +ALTER TABLE BABEL_2047_t4 DROP CONSTRAINT babel_2047_t4_pkey +GO +ALTER TABLE BABEL_2047_t5 DROP CONSTRAINT babel_2047_t5_pkey +GO +ALTER TABLE BABEL_2047_t6 DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +DROP TABLE BABEL_2047_t1, BABEL_2047_t2, BABEL_2047_t3, BABEL_2047_t4, BABEL_2047_t5, BABEL_2047_t6 +GO + +/********** END OF PRIMARY KEY (<64) **********/ +# +# +# +/********** UNIQUE (<64) **********/ + +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1 (id INT, CONSTRAINT BABEL_2047_namedTableConstraint UNIQUE(id)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2 (id INT CONSTRAINT BABEL_2047_namedColumnConstraint UNIQUE) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3 (id INT, UNIQUE(id)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4 (id INT UNIQUE) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5 (id INT) +GO +ALTER TABLE BABEL_2047_t5 ADD id1 INT UNIQUE +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6 (id INT) +GO +ALTER TABLE BABEL_2047_t6 ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table UNIQUE(id) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +ALTER TABLE BABEL_2047_t1 DROP CONSTRAINT BABEL_2047_namedTableConstraint +GO +ALTER TABLE BABEL_2047_t2 DROP CONSTRAINT BABEL_2047_namedColumnConstraint +GO +ALTER TABLE BABEL_2047_t3 DROP CONSTRAINT babel_2047_t3_id_key +GO +ALTER TABLE BABEL_2047_t4 DROP CONSTRAINT babel_2047_t4_id_key +GO +ALTER TABLE BABEL_2047_t5 DROP CONSTRAINT babel_2047_t5_id1_key +GO +ALTER TABLE BABEL_2047_t6 DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +DROP TABLE BABEL_2047_t1, BABEL_2047_t2, BABEL_2047_t3, BABEL_2047_t4, BABEL_2047_t5, BABEL_2047_t6 +GO + +/********** END OF UNIQUE (<64) **********/ +# +# +# +/********** CHECK (<64) **********/ + +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1 (id INT, CONSTRAINT BABEL_2047_namedTableConstraint CHECK(id > 0)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2 (id INT CONSTRAINT BABEL_2047_namedColumnConstraint CHECK(id > 0)) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3 (id INT, CHECK(id > 0)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4 (id INT CHECK(id > 0)) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5 (id INT) +GO +ALTER TABLE BABEL_2047_t5 ADD id1 INT CHECK(id > 0) +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6 (id INT) +GO +ALTER TABLE BABEL_2047_t6 ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table CHECK(id > 0) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +ALTER TABLE BABEL_2047_t1 DROP CONSTRAINT BABEL_2047_namedTableConstraint +GO +ALTER TABLE BABEL_2047_t2 DROP CONSTRAINT BABEL_2047_namedColumnConstraint +GO +ALTER TABLE BABEL_2047_t3 DROP CONSTRAINT babel_2047_t3_id_check +GO +ALTER TABLE BABEL_2047_t4 DROP CONSTRAINT babel_2047_t4_id_check +GO +ALTER TABLE BABEL_2047_t5 DROP CONSTRAINT babel_2047_t5_id_check +GO +ALTER TABLE BABEL_2047_t6 DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +DROP TABLE BABEL_2047_t1, BABEL_2047_t2, BABEL_2047_t3, BABEL_2047_t4, BABEL_2047_t5, BABEL_2047_t6 +GO + +/********** END OF CHECK (<64) **********/ +# +# +# +/********** FOREIGN KEY (<64) **********/ + +CREATE TABLE BABEL_2047_FOERIGN_TABLE (id INT UNIQUE) +GO + +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1 (id INT, CONSTRAINT BABEL_2047_namedTableConstraint FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2 (id INT CONSTRAINT BABEL_2047_namedColumnConstraint FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3 (id INT, FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4 (id INT FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5 (id INT) +GO +ALTER TABLE BABEL_2047_t5 ADD id1 INT REFERENCES BABEL_2047_FOERIGN_TABLE(id) +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6 (id INT) +GO +ALTER TABLE BABEL_2047_t6 ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +ALTER TABLE BABEL_2047_t1 DROP CONSTRAINT BABEL_2047_namedTableConstraint +GO +ALTER TABLE BABEL_2047_t2 DROP CONSTRAINT BABEL_2047_namedColumnConstraint +GO +ALTER TABLE BABEL_2047_t3 DROP CONSTRAINT BABEL_2047_t3_id_fkey +GO +ALTER TABLE BABEL_2047_t4 DROP CONSTRAINT BABEL_2047_t4_id_fkey +GO +ALTER TABLE BABEL_2047_t5 DROP CONSTRAINT BABEL_2047_t5_id1_fkey +GO +ALTER TABLE BABEL_2047_t6 DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +DROP TABLE BABEL_2047_t1, BABEL_2047_t2, BABEL_2047_t3, BABEL_2047_t4, BABEL_2047_t5, BABEL_2047_t6, BABEL_2047_FOERIGN_TABLE +GO + +/********** END OF FOREIGN KEY (<64) **********/ +# +# +# +# +# +/* RERUN ALL TESTS BUT WITH TABLENAME & CONSTRAINT NAME LENGTH GREATER THAN 64*/ +# +/********** PRIMARY KEY (>=64) **********/ + +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL PRIMARY KEY(id)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL PRIMARY KEY) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, PRIMARY KEY(id)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT PRIMARY KEY) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT) +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD id1 INT PRIMARY KEY +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL(id INT) +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL PRIMARY KEY(id) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +ALTER TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926f9a3_pkey +GO +ALTER TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2cfb3_pkey +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e8701_pkey +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +DROP TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO + +/********** END OF PRIMARY KEY (>=64) **********/ +# +# +# +/********** UNIQUE (>=64) **********/ + +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL UNIQUE(id)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL UNIQUE) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, UNIQUE(id)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT UNIQUE) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT) +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD id1 INT UNIQUE +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT) +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL UNIQUE(id) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +ALTER TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926f9_id_key +GO +ALTER TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2cf_id_key +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e8_id1_key +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +DROP TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO + +/********** END OF UNIQUE (>=64) **********/ +# +# +# +/********** CHECK (>=64) **********/ + +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL CHECK(id > 0)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL CHECK(id > 0)) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, CHECK(id > 0)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT CHECK(id > 0)) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT) +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD id1 INT CHECK(id > 0) +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT) +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL CHECK(id > 0) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +ALTER TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926_id_check +GO +ALTER TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2_id_check +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e_id_check +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +DROP TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO + +/********** END OF CHECK (>=64) **********/ +# +# +# +/********** FOREIGN KEY (>=64) **********/ + +CREATE TABLE BABEL_2047_FOERIGN_TABLE (id INT UNIQUE) +GO + +-- named table constraint in create table +CREATE TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- named column constraint in create table +CREATE TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- un-named table constraint in create table +CREATE TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT, FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- un-named column constraint in create table +CREATE TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id)) +GO +-- table constraint created using alter table +CREATE TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT) +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD id1 INT REFERENCES BABEL_2047_FOERIGN_TABLE(id) +GO +-- column constraint created using alter table +CREATE TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL (id INT) +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL ADD CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL FOREIGN KEY (id) REFERENCES BABEL_2047_FOERIGN_TABLE(id) +GO + + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +ALTER TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedColumnConstraint_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO +ALTER TABLE BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t3_bbbbbbbbbaaaaaaaa9469c367a71f3fb0297b926f_id_fkey +GO +ALTER TABLE BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t4_bbbbbbbbbaaaaaaaa58a9a6b9518e4a7ba04c4c2c_id_fkey +GO +ALTER TABLE BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_t5_bbbbbbbbbaaaaaaaa269e00d41fb4d6aec4e518e_id1_fkey +GO +ALTER TABLE BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL DROP CONSTRAINT BABEL_2047_namedTableConstraint_alter_table_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL +GO + +-- look into pg_catalog and sys catalog for names +SELECT + CAST(c.relname AS VARCHAR(64)) AS tableName, + CAST(i.conname AS VARCHAR(64)) AS constraintName +FROM pg_constraint i + JOIN pg_class c ON (c.oid = i.conrelid) +WHERE + c.relname like '%babel_2047%' +ORDER BY + tableName ASC, constraintName ASC; +GO + +DROP TABLE BABEL_2047_t1_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t2_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t3_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t4_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t5_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_t6_BBBBBBBBBAAAAAAAAABBBBBBBBEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLL, BABEL_2047_FOERIGN_TABLE +GO + +/********** END OF FOREIGN KEY (>=64) **********/ From 0b41e94d6e338c88e3f6a173c20fdfec1e2ff5bd Mon Sep 17 00:00:00 2001 From: Tanzeel Khan Date: Wed, 15 May 2024 08:54:47 +0000 Subject: [PATCH 2/4] update old test cases Signed-off-by: Tanzeel Khan --- test/JDBC/expected/BABEL-1206-vu-prepare.out | 13 +- test/JDBC/expected/BABEL-1206.out | 2 +- test/JDBC/expected/BABEL-1715-vu-prepare.out | 4 +- test/JDBC/expected/BABEL-1715-vu-verify.out | 4 +- test/JDBC/expected/BABEL-1715.out | 4 +- .../BABEL-621-before-14_13-vu-cleanup.out | 45 +++++++ .../BABEL-621-before-14_13-vu-prepare.out | 126 ++++++++++++++++++ .../BABEL-621-before-14_13-vu-verify.out | 15 +++ test/JDBC/expected/BABEL-621-vu-cleanup.out | 4 - test/JDBC/expected/BABEL-621-vu-prepare.out | 12 -- ...CHECK-CONSTRAINT-before-14_6-vu-verify.out | 2 +- .../BABEL-CHECK-CONSTRAINT-vu-verify.out | 4 +- .../BABEL-TABLEOPTIONS-vu-prepare.out | 2 +- test/JDBC/expected/BABEL-UNSUPPORTED.out | 6 +- test/JDBC/expected/BABEL_4817-vu-prepare.out | 2 +- test/JDBC/expected/BABEL_4817-vu-verify.out | 4 +- .../ISC-Check-Constraints-vu-verify.out | 4 +- .../ISC-Table_Constraints-vu-verify.out | 2 +- test/JDBC/expected/TestErrorFunctions.out | 4 +- test/JDBC/expected/babel_621.out | 16 --- .../BABEL-1206-vu-prepare.out | 11 +- test/JDBC/input/BABEL-1206-vu-prepare.sql | 11 +- test/JDBC/input/BABEL-1715-vu-prepare.sql | 4 +- .../BABEL-621-before-14_13-vu-cleanup.sql | 41 ++++++ .../BABEL-621-before-14_13-vu-prepare.sql | 102 ++++++++++++++ .../BABEL-621-before-14_13-vu-verify.sql | 7 + .../input/BABEL-TABLEOPTIONS-vu-prepare.sql | 2 +- test/JDBC/input/BABEL_4817-vu-prepare.mix | 2 +- test/JDBC/jdbc_schedule | 3 + test/JDBC/upgrade/13_4/schedule | 2 +- test/JDBC/upgrade/13_5/schedule | 2 +- test/JDBC/upgrade/13_6/schedule | 2 +- test/JDBC/upgrade/13_7/schedule | 2 +- test/JDBC/upgrade/13_8/schedule | 2 +- test/JDBC/upgrade/13_9/schedule | 2 +- test/JDBC/upgrade/14_10/schedule | 2 +- test/JDBC/upgrade/14_11/schedule | 2 +- test/JDBC/upgrade/14_3/schedule | 2 +- test/JDBC/upgrade/14_5/schedule | 2 +- test/JDBC/upgrade/14_6/schedule | 2 +- test/JDBC/upgrade/14_7/schedule | 2 +- test/JDBC/upgrade/14_8/schedule | 2 +- test/JDBC/upgrade/14_9/schedule | 2 +- 43 files changed, 392 insertions(+), 94 deletions(-) create mode 100644 test/JDBC/expected/BABEL-621-before-14_13-vu-cleanup.out create mode 100644 test/JDBC/expected/BABEL-621-before-14_13-vu-prepare.out create mode 100644 test/JDBC/expected/BABEL-621-before-14_13-vu-verify.out create mode 100644 test/JDBC/input/BABEL-621-before-14_13-vu-cleanup.sql create mode 100644 test/JDBC/input/BABEL-621-before-14_13-vu-prepare.sql create mode 100644 test/JDBC/input/BABEL-621-before-14_13-vu-verify.sql diff --git a/test/JDBC/expected/BABEL-1206-vu-prepare.out b/test/JDBC/expected/BABEL-1206-vu-prepare.out index 10fc3f3ef6..bec8e9d074 100644 --- a/test/JDBC/expected/BABEL-1206-vu-prepare.out +++ b/test/JDBC/expected/BABEL-1206-vu-prepare.out @@ -41,13 +41,10 @@ go CREATE TABLE babel_1206_vu_prepare_t4( [DistinctApplicationID] [bigint] IDENTITY(1,1) NOT NULL, - [Description] [nvarchar](1024) NOT NULL, - [DescriptionHash] AS (hashbytes('MD5',[Description])) PERSISTED NOT NULL, - CONSTRAINT babel_1206_vu_prepare_t4_i3 UNIQUE NONCLUSTERED - ( - [DescriptionHash] ASC - ) - ) ON [PRIMARY] + [Description] [nvarchar](1024) NOT NULL CONSTRAINT babel_1206_vu_prepare_t4_i3 UNIQUE NONCLUSTERED, + [DescriptionHash] AS (hashbytes('MD5',[Description])) PERSISTED NOT NULL +) +ON [PRIMARY] go insert into babel_1206_vu_prepare_t4 values (0xaaa); @@ -59,5 +56,5 @@ insert into babel_1206_vu_prepare_t4 values (0xaaa); go ~~ERROR (Code: 2627)~~ -~~ERROR (Message: duplicate key value violates unique constraint "babel_1206_vu_prepare_t4_i3babeaa1c56a90ff7306469195c2b5d1e115d")~~ +~~ERROR (Message: duplicate key value violates unique constraint "babel_1206_vu_prepare_t4_i3")~~ diff --git a/test/JDBC/expected/BABEL-1206.out b/test/JDBC/expected/BABEL-1206.out index 279356024d..3befbdfa42 100644 --- a/test/JDBC/expected/BABEL-1206.out +++ b/test/JDBC/expected/BABEL-1206.out @@ -95,7 +95,7 @@ insert into babel_1206_t3 values (0xaaa); go ~~ERROR (Code: 2627)~~ -~~ERROR (Message: duplicate key value violates unique constraint "babel_1206_t3_i3babel_1206_t36b8d8d363edb759764e0add37a7a2ded")~~ +~~ERROR (Message: duplicate key value violates unique constraint "babel_1206_t3_i3")~~ drop table babel_1265_t1; diff --git a/test/JDBC/expected/BABEL-1715-vu-prepare.out b/test/JDBC/expected/BABEL-1715-vu-prepare.out index 072385ea18..761fc4dd6c 100644 --- a/test/JDBC/expected/BABEL-1715-vu-prepare.out +++ b/test/JDBC/expected/BABEL-1715-vu-prepare.out @@ -1,7 +1,7 @@ use master; go -CREATE TABLE babel_1715_vu_prepare_t1 (a int, b int CONSTRAINT uk_a PRIMARY KEY (a)); +CREATE TABLE babel_1715_vu_prepare_t1 (a int CONSTRAINT uk_a PRIMARY KEY, b int); go INSERT INTO babel_1715_vu_prepare_t1 VALUES (1, 1); @@ -12,7 +12,7 @@ GO ~~ROW COUNT: 1~~ -CREATE TABLE babel_1715_vu_prepare_t2 (a int, b as a+1 CONSTRAINT uk_a PRIMARY KEY (a)); +CREATE TABLE babel_1715_vu_prepare_t2 (a int CONSTRAINT uk_a1 PRIMARY KEY, b as a+1); go INSERT INTO babel_1715_vu_prepare_t2 (a) VALUES (1); diff --git a/test/JDBC/expected/BABEL-1715-vu-verify.out b/test/JDBC/expected/BABEL-1715-vu-verify.out index 2730b6fff3..50ef2d4be5 100644 --- a/test/JDBC/expected/BABEL-1715-vu-verify.out +++ b/test/JDBC/expected/BABEL-1715-vu-verify.out @@ -5,14 +5,14 @@ INSERT INTO babel_1715_vu_prepare_t1 VALUES (2, 3); GO ~~ERROR (Code: 2627)~~ -~~ERROR (Message: duplicate key value violates unique constraint "uk_ababel_1715_vu_prepare_t1309394cc13ed0160c093d0a0f82cb1c0")~~ +~~ERROR (Message: duplicate key value violates unique constraint "uk_a")~~ INSERT INTO babel_1715_vu_prepare_t2 (a) VALUES (2); GO ~~ERROR (Code: 2627)~~ -~~ERROR (Message: duplicate key value violates unique constraint "uk_ababel_1715_vu_prepare_t2309394cc13ed0160c093d0a0f82cb1c0")~~ +~~ERROR (Message: duplicate key value violates unique constraint "uk_a1")~~ CREATE TABLE babel_1715_vu_prepare_invalid1 (a int b int); diff --git a/test/JDBC/expected/BABEL-1715.out b/test/JDBC/expected/BABEL-1715.out index 8b33a84254..217e764538 100644 --- a/test/JDBC/expected/BABEL-1715.out +++ b/test/JDBC/expected/BABEL-1715.out @@ -14,7 +14,7 @@ INSERT INTO t1715 VALUES (2, 3); go ~~ERROR (Code: 2627)~~ -~~ERROR (Message: duplicate key value violates unique constraint "uk_at1715309394cc13ed0160c093d0a0f82cb1c0")~~ +~~ERROR (Message: duplicate key value violates unique constraint "uk_a")~~ drop table t1715; go @@ -33,7 +33,7 @@ INSERT INTO t1715_2 (a) VALUES (2); go ~~ERROR (Code: 2627)~~ -~~ERROR (Message: duplicate key value violates unique constraint "uk_at1715_2309394cc13ed0160c093d0a0f82cb1c0")~~ +~~ERROR (Message: duplicate key value violates unique constraint "uk_a")~~ drop table t1715_2; go diff --git a/test/JDBC/expected/BABEL-621-before-14_13-vu-cleanup.out b/test/JDBC/expected/BABEL-621-before-14_13-vu-cleanup.out new file mode 100644 index 0000000000..5806e52d13 --- /dev/null +++ b/test/JDBC/expected/BABEL-621-before-14_13-vu-cleanup.out @@ -0,0 +1,45 @@ +DROP INDEX idx on babel_621_vu_prepare_table_1; +DROP INDEX idx on babel_621_vu_prepare_table_2; +GO + +DROP INDEX uniq on babel_621_vu_prepare_table_3; +GO +~~ERROR (Code: 3723)~~ + +~~ERROR (Message: cannot drop index uniqbabel_621_vu_prepare_table_d6716c55a366d04accd1036436eb2a86 because constraint uniqbabel_621_vu_prepare_table_d6716c55a366d04accd1036436eb2a86 on table babel_621_vu_prepare_table_3 requires it)~~ + + +DROP INDEX very_long_index_name_on_a_table_1234567890_1234567890_1234567890_1234567890_1234567890 on babel_621_vu_prepare_table_with_long_index_name; +GO + +DROP INDEX very_long_index_name_on_a_table_1234567890_1234567890_1234567890_1234567890_1234567890 on babel_621_table_with_long_name_1234567890_1234567890_1234567890_1234567890_1234567890; +GO + +DROP TABLE babel_621_vu_prepare_table_1; +GO +DROP TABLE babel_621_vu_prepare_table_2; +GO +DROP TABLE babel_621_vu_prepare_table_3; +GO +DROP TABLE babel_621_vu_prepare_table_4; +GO +DROP TABLE babel_621_vu_prepare_table_with_long_index_name; +GO +DROP TABLE babel_621_vu_prepare_second_table_with_long_index_name; +GO +DROP TABLE babel_621_table_with_long_name_1234567890_1234567890_1234567890_1234567890_1234567890; +GO +DROP TABLE babel_621_second_table_with_long_name_1234567890_1234567890_1234567890_1234567890_1234567890; +GO +DROP TABLE babel_621_vu_prepare_table_6; +GO +DROP TABLE table_6; +GO +DROP TABLE table_7; +GO +DROP TABLE babel_621_vu_prepare_table_7; +GO +DROP TABLE babel_621_vu_prepare_table_8; +GO +DROP TABLE babel_621_vu_prepare_table_10; +GO diff --git a/test/JDBC/expected/BABEL-621-before-14_13-vu-prepare.out b/test/JDBC/expected/BABEL-621-before-14_13-vu-prepare.out new file mode 100644 index 0000000000..a2aac80f51 --- /dev/null +++ b/test/JDBC/expected/BABEL-621-before-14_13-vu-prepare.out @@ -0,0 +1,126 @@ +EXECUTE sp_babelfish_configure 'escape_hatch_unique_constraint', 'ignore' +go + +create table babel_621_vu_prepare_table_1 (a int); +go +create table babel_621_vu_prepare_table_2 (a int); +go +create index idx on babel_621_vu_prepare_table_1(a); +go +create index idx on babel_621_vu_prepare_table_2(a); +go + +create table babel_621_vu_prepare_table_3 (a int); +go +alter table babel_621_vu_prepare_table_3 add constraint uniq unique (a); +go +create index uniq on babel_621_vu_prepare_table_3(a); +go +~~ERROR (Code: 2714)~~ + +~~ERROR (Message: relation "uniqbabel_621_vu_prepare_table_d6716c55a366d04accd1036436eb2a86" already exists)~~ + + +create table babel_621_vu_prepare_table_4 (a int); +go +create index uniq_table_4 on babel_621_vu_prepare_table_4(a); +go +alter table babel_621_vu_prepare_table_4 add constraint uniq_table_4 unique (a); +go +~~ERROR (Code: 2714)~~ + +~~ERROR (Message: relation "uniq_table_4babel_621_vu_prepardeacd0a0f930dee973c93a41c32c3ffc" already exists)~~ + +alter table babel_621_vu_prepare_table_4 drop constraint uniq_table_4; +go +~~ERROR (Code: 3728)~~ + +~~ERROR (Message: constraint "uniq_table_4babel_621_vu_prepardeacd0a0f930dee973c93a41c32c3ffc" of relation "babel_621_vu_prepare_table_4" does not exist)~~ + + +-- Very long index name +create table babel_621_vu_prepare_table_with_long_index_name (a int); +go +create index very_long_index_name_on_a_table_1234567890_1234567890_1234567890_1234567890_1234567890 on babel_621_vu_prepare_table_with_long_index_name(a); +go + +create table babel_621_vu_prepare_second_table_with_long_index_name (a int); +go +create index very_long_index_name_on_a_table_1234567890_1234567890_1234567890_1234567890_1234567890 on babel_621_vu_prepare_second_table_with_long_index_name(a); +go + +-- Very long table name and very long index name +create table babel_621_table_with_long_name_1234567890_1234567890_1234567890_1234567890_1234567890 (a int); +go +create index very_long_index_name_on_a_table_1234567890_1234567890_1234567890_1234567890_1234567890 on babel_621_table_with_long_name_1234567890_1234567890_1234567890_1234567890_1234567890(a); +go + +create table babel_621_second_table_with_long_name_1234567890_1234567890_1234567890_1234567890_1234567890 (a int); +go +create index very_long_index_name_on_a_table_1234567890_1234567890_1234567890_1234567890_1234567890 on babel_621_second_table_with_long_name_1234567890_1234567890_1234567890_1234567890_1234567890(a); +go + +-- Situation where simple concatenation of table and index name does not work +-- E.g. table_a + index_a == table_b + index_b +create table babel_621_vu_prepare_table_6 (a int); +go +create index idx_ on babel_621_vu_prepare_table_6(a); +go + +create table table_6 (a int); +go +create index idx_babel_621_vu_prepare_ on table_6(a); +go +-- Situation where simple concatenation of index and table name does not work (reverse of previous) +-- E.g. index_a + table_a == index_b + table_b +create table table_7 (a int); +go +create index idx_babel_621_vu_prepare_ on table_7(a); +go + +create table babel_621_vu_prepare_table_7 (a int); +go +create index idx_ on babel_621_vu_prepare_table_7(a); +go + +-- +create table babel_621_vu_prepare_table_8 ( + a int, + value int, + constraint constraint_8 unique nonclustered + ( + value asc + ) + ) +go +alter table babel_621_vu_prepare_table_8 drop constraint constraint_8; +go +insert into babel_621_vu_prepare_table_8 values(1, 1); +insert into babel_621_vu_prepare_table_8 values(2, 1); +go +~~ROW COUNT: 1~~ + +~~ROW COUNT: 1~~ + + +create table babel_621_vu_prepare_table_10 +( + a int, + b int, + c int +) +go +create unique index idx on babel_621_vu_prepare_table_10 (a, b); +go +insert into babel_621_vu_prepare_table_10 values(1, 1, 1); +insert into babel_621_vu_prepare_table_10 values(1, 2, 1); +insert into babel_621_vu_prepare_table_10 values(1, 2, 2); +go +~~ROW COUNT: 1~~ + +~~ROW COUNT: 1~~ + +~~ERROR (Code: 2627)~~ + +~~ERROR (Message: duplicate key value violates unique constraint "idxbabel_621_vu_prepare_table_147dc0d6e295169e8ba6e11ebeb1c6472")~~ + diff --git a/test/JDBC/expected/BABEL-621-before-14_13-vu-verify.out b/test/JDBC/expected/BABEL-621-before-14_13-vu-verify.out new file mode 100644 index 0000000000..cc987f7bfd --- /dev/null +++ b/test/JDBC/expected/BABEL-621-before-14_13-vu-verify.out @@ -0,0 +1,15 @@ +select a, value from babel_621_vu_prepare_table_8 order by a; +go +~~START~~ +int#!#int +1#!#1 +2#!#1 +~~END~~ + + +drop index idx on babel_621_vu_prepare_table_10; +go +insert into babel_621_vu_prepare_table_10 values(1, 2, 2); +go +~~ROW COUNT: 1~~ + diff --git a/test/JDBC/expected/BABEL-621-vu-cleanup.out b/test/JDBC/expected/BABEL-621-vu-cleanup.out index 5806e52d13..984b6c8676 100644 --- a/test/JDBC/expected/BABEL-621-vu-cleanup.out +++ b/test/JDBC/expected/BABEL-621-vu-cleanup.out @@ -4,10 +4,6 @@ GO DROP INDEX uniq on babel_621_vu_prepare_table_3; GO -~~ERROR (Code: 3723)~~ - -~~ERROR (Message: cannot drop index uniqbabel_621_vu_prepare_table_d6716c55a366d04accd1036436eb2a86 because constraint uniqbabel_621_vu_prepare_table_d6716c55a366d04accd1036436eb2a86 on table babel_621_vu_prepare_table_3 requires it)~~ - DROP INDEX very_long_index_name_on_a_table_1234567890_1234567890_1234567890_1234567890_1234567890 on babel_621_vu_prepare_table_with_long_index_name; GO diff --git a/test/JDBC/expected/BABEL-621-vu-prepare.out b/test/JDBC/expected/BABEL-621-vu-prepare.out index a2aac80f51..5878a79d2d 100644 --- a/test/JDBC/expected/BABEL-621-vu-prepare.out +++ b/test/JDBC/expected/BABEL-621-vu-prepare.out @@ -16,10 +16,6 @@ alter table babel_621_vu_prepare_table_3 add constraint uniq unique (a); go create index uniq on babel_621_vu_prepare_table_3(a); go -~~ERROR (Code: 2714)~~ - -~~ERROR (Message: relation "uniqbabel_621_vu_prepare_table_d6716c55a366d04accd1036436eb2a86" already exists)~~ - create table babel_621_vu_prepare_table_4 (a int); go @@ -27,16 +23,8 @@ create index uniq_table_4 on babel_621_vu_prepare_table_4(a); go alter table babel_621_vu_prepare_table_4 add constraint uniq_table_4 unique (a); go -~~ERROR (Code: 2714)~~ - -~~ERROR (Message: relation "uniq_table_4babel_621_vu_prepardeacd0a0f930dee973c93a41c32c3ffc" already exists)~~ - alter table babel_621_vu_prepare_table_4 drop constraint uniq_table_4; go -~~ERROR (Code: 3728)~~ - -~~ERROR (Message: constraint "uniq_table_4babel_621_vu_prepardeacd0a0f930dee973c93a41c32c3ffc" of relation "babel_621_vu_prepare_table_4" does not exist)~~ - -- Very long index name create table babel_621_vu_prepare_table_with_long_index_name (a int); diff --git a/test/JDBC/expected/BABEL-CHECK-CONSTRAINT-before-14_6-vu-verify.out b/test/JDBC/expected/BABEL-CHECK-CONSTRAINT-before-14_6-vu-verify.out index ed7414295b..4c5b48dac5 100644 --- a/test/JDBC/expected/BABEL-CHECK-CONSTRAINT-before-14_6-vu-verify.out +++ b/test/JDBC/expected/BABEL-CHECK-CONSTRAINT-before-14_6-vu-verify.out @@ -2,5 +2,5 @@ ALTER TABLE [dbo].[alter_table_check_constraint] ADD CONSTRAINT [check_col1] CHE GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: check constraint "check_col1alter_table_check_con0f71bca531f50db1bd071ab46c3097ea" of relation "alter_table_check_constraint" is violated by some row)~~ +~~ERROR (Message: check constraint "check_col1" of relation "alter_table_check_constraint" is violated by some row)~~ diff --git a/test/JDBC/expected/BABEL-CHECK-CONSTRAINT-vu-verify.out b/test/JDBC/expected/BABEL-CHECK-CONSTRAINT-vu-verify.out index 84bc1d6c8f..7f5f929d3b 100644 --- a/test/JDBC/expected/BABEL-CHECK-CONSTRAINT-vu-verify.out +++ b/test/JDBC/expected/BABEL-CHECK-CONSTRAINT-vu-verify.out @@ -3,7 +3,7 @@ ALTER TABLE [dbo].[alter_table_check_constraint] ADD CONSTRAINT [check_col1] CHE GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: check constraint "check_col1alter_table_check_con0f71bca531f50db1bd071ab46c3097ea" of relation "alter_table_check_constraint" is violated by some row)~~ +~~ERROR (Message: check constraint "check_col1" of relation "alter_table_check_constraint" is violated by some row)~~ ALTER TABLE check_constraint ADD CONSTRAINT [check_a] CHECK (a not like N'123%') @@ -18,7 +18,7 @@ INSERT INTO check_constraint VALUES ('1234'), ('123123') GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "check_constraint" violates check constraint "check_acheck_constraint719599f27c48404560d418ff018273e1")~~ +~~ERROR (Message: new row for relation "check_constraint" violates check constraint "check_a")~~ INSERT INTO create_check_constraint VALUES ('abcdEFg') diff --git a/test/JDBC/expected/BABEL-TABLEOPTIONS-vu-prepare.out b/test/JDBC/expected/BABEL-TABLEOPTIONS-vu-prepare.out index 681c11d5dc..fff8c6dda2 100644 --- a/test/JDBC/expected/BABEL-TABLEOPTIONS-vu-prepare.out +++ b/test/JDBC/expected/BABEL-TABLEOPTIONS-vu-prepare.out @@ -1,4 +1,4 @@ -CREATE TABLE babel_tableoptions_vu_prepare_t1 (a INT, CONSTRAINT pk PRIMARY KEY CLUSTERED (a ASC)) WITH +CREATE TABLE babel_tableoptions_vu_prepare_t1 (a INT, CONSTRAINT pk_99 PRIMARY KEY CLUSTERED (a ASC)) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, diff --git a/test/JDBC/expected/BABEL-UNSUPPORTED.out b/test/JDBC/expected/BABEL-UNSUPPORTED.out index 5b8d94f026..550c77bf00 100644 --- a/test/JDBC/expected/BABEL-UNSUPPORTED.out +++ b/test/JDBC/expected/BABEL-UNSUPPORTED.out @@ -1665,7 +1665,7 @@ INSERT INTO t_unsupported_cac1 VALUES (0, 0); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "t_unsupported_cac1" violates check constraint "chk1t_unsupported_cac1848ea8bb1121ee393ad72ae0d412d8d2")~~ +~~ERROR (Message: new row for relation "t_unsupported_cac1" violates check constraint "chk1")~~ DROP TABLE t_unsupported_cac1 GO @@ -1692,7 +1692,7 @@ ALTER TABLE t_unsupported_cec1 ADD constraint chk1 check (a > 0) GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: check constraint "chk1t_unsupported_cec1848ea8bb1121ee393ad72ae0d412d8d2" of relation "t_unsupported_cec1" is violated by some row)~~ +~~ERROR (Message: check constraint "chk1" of relation "t_unsupported_cec1" is violated by some row)~~ ALTER TABLE t_unsupported_cec1 CHECK constraint chk1 GO @@ -1721,7 +1721,7 @@ ALTER TABLE t_unsupported_cec1 ADD constraint chk1 check (a > 0) GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: check constraint "chk1t_unsupported_cec1848ea8bb1121ee393ad72ae0d412d8d2" of relation "t_unsupported_cec1" is violated by some row)~~ +~~ERROR (Message: check constraint "chk1" of relation "t_unsupported_cec1" is violated by some row)~~ ALTER TABLE t_unsupported_cec1 CHECK constraint chk1 GO diff --git a/test/JDBC/expected/BABEL_4817-vu-prepare.out b/test/JDBC/expected/BABEL_4817-vu-prepare.out index d4303de388..9ad7542bb5 100644 --- a/test/JDBC/expected/BABEL_4817-vu-prepare.out +++ b/test/JDBC/expected/BABEL_4817-vu-prepare.out @@ -14,7 +14,7 @@ GO -- tsql CREATE TABLE babel_4817_t2 (col1 INT, col2 INT NOT NULL, col3 AS col1*col2, col4 INT, col5 INT, col6 INT, col7 INT NOT NULL IDENTITY, col8 INT NOT NULL) GO -ALTER TABLE babel_4817_t2 ADD CONSTRAINT babel_4817_t2_pk PRIMARY KEY NONCLUSTERED (col3, col7); +ALTER TABLE babel_4817_t2 ADD CONSTRAINT babel_4817_t2_pkkkkkkkkkkkkkkk PRIMARY KEY NONCLUSTERED (col3, col7); GO -- clustered is ignored CREATE UNIQUE NONCLUSTERED INDEX babel_4817_t2_unique_index ON dbo.babel_4817_t2 (col2 DESC, col8) INCLUDE (col4); diff --git a/test/JDBC/expected/BABEL_4817-vu-verify.out b/test/JDBC/expected/BABEL_4817-vu-verify.out index 825dd29555..a9098c0a65 100644 --- a/test/JDBC/expected/BABEL_4817-vu-verify.out +++ b/test/JDBC/expected/BABEL_4817-vu-verify.out @@ -42,8 +42,8 @@ Index Name fetched from sys.in#!#index_i#!#index_column_i#!#column_i#!#key_ordin ~~START~~ char#!#char#!#char#!#char#!#char#!#char#!#char -babel_4817_t2_pkbabel_4817_t24#!#2 #!#1 #!#3 #!#1 #!#0 #!#0 -babel_4817_t2_pkbabel_4817_t24#!#2 #!#2 #!#7 #!#2 #!#0 #!#0 +babel_4817_t2_pkkkkkkkkkkkkkkk#!#2 #!#1 #!#3 #!#1 #!#0 #!#0 +babel_4817_t2_pkkkkkkkkkkkkkkk#!#2 #!#2 #!#7 #!#2 #!#0 #!#0 babel_4817_t2_unique_indexbabe#!#3 #!#1 #!#2 #!#1 #!#1 #!#0 babel_4817_t2_unique_indexbabe#!#3 #!#3 #!#4 #!#0 #!#0 #!#1 babel_4817_t2_unique_indexbabe#!#3 #!#2 #!#8 #!#2 #!#0 #!#0 diff --git a/test/JDBC/expected/ISC-Check-Constraints-vu-verify.out b/test/JDBC/expected/ISC-Check-Constraints-vu-verify.out index 7a3cadc637..38d7de8710 100644 --- a/test/JDBC/expected/ISC-Check-Constraints-vu-verify.out +++ b/test/JDBC/expected/ISC-Check-Constraints-vu-verify.out @@ -22,8 +22,8 @@ select * from information_schema.check_constraints order by "CONSTRAINT_NAME","C go ~~START~~ nvarchar#!#nvarchar#!#varchar#!#nvarchar -isc_check_constraints_db1#!#dbo#!#constraint1test_null987b8e55c77de33d095778885ecd84f4#!#((a > 10)) -isc_check_constraints_db1#!#dbo#!#constraint2test_nullba039d416ebe51c75b9d6d571d9a6f74#!#(((a <= 20) AND (b > a) AND ((a >= 40) AND (a <= 50)))) +isc_check_constraints_db1#!#dbo#!#constraint1#!#((a > 10)) +isc_check_constraints_db1#!#dbo#!#constraint2#!#(((a <= 20) AND (b > a) AND ((a >= 40) AND (a <= 50)))) isc_check_constraints_db1#!#dbo#!#test_datetime_c_date_check#!#((c_date < '2001-01-01')) isc_check_constraints_db1#!#dbo#!#test_datetime_c_datetime_check#!#((c_datetime < '2020-10-20 09:00:00')) isc_check_constraints_db1#!#dbo#!#test_datetime_c_datetime2_check#!#(((c_datetime2 < '2020-10-20 09:00:00') AND (c_datetime2 < CAST('2020-10-20 09:00:00' AS datetime2(6))))) diff --git a/test/JDBC/expected/ISC-Table_Constraints-vu-verify.out b/test/JDBC/expected/ISC-Table_Constraints-vu-verify.out index a3a21ce0ad..b338b2fc99 100644 --- a/test/JDBC/expected/ISC-Table_Constraints-vu-verify.out +++ b/test/JDBC/expected/ISC-Table_Constraints-vu-verify.out @@ -236,7 +236,7 @@ SELECT * FROM isc_tbl_constraints_v1 GO ~~START~~ nvarchar#!#nvarchar#!#varchar#!#nvarchar#!#nvarchar#!#varchar#!#varchar#!#varchar#!#varchar -master#!#dbo#!#chk_1234tbl_fk6cf0677d00f904ff46edc8dbed867549#!#master#!#dbo#!#tbl_fk#!#CHECK#!#NO#!#NO +master#!#dbo#!#chk_1234#!#master#!#dbo#!#tbl_fk#!#CHECK#!#NO#!#NO master#!#dbo#!#tbl_fk_a_fkey#!#master#!#dbo#!#tbl_fk#!#FOREIGN KEY#!#NO#!#NO master#!#sch1#!#tbl_fk_a_fkey#!#master#!#sch1#!#tbl_fk#!#FOREIGN KEY#!#NO#!#NO master#!#dbo#!#tbl_fk_pkey#!#master#!#dbo#!#tbl_fk#!#PRIMARY KEY#!#NO#!#NO diff --git a/test/JDBC/expected/TestErrorFunctions.out b/test/JDBC/expected/TestErrorFunctions.out index fb322aa2ec..0fa1f4cbc4 100644 --- a/test/JDBC/expected/TestErrorFunctions.out +++ b/test/JDBC/expected/TestErrorFunctions.out @@ -223,7 +223,7 @@ INSERT INTO errorFuncTable VALUES (5, 2, 'one') go ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "errorfunctable" violates check constraint "ck_a_gt_berrorfunctablee59e418278eefa47185bf50958adfcb4")~~ +~~ERROR (Message: new row for relation "errorfunctable" violates check constraint "ck_a_gt_b")~~ BEGIN TRY @@ -241,7 +241,7 @@ END CATCH go ~~START~~ int#!#nvarchar#!#int#!#nvarchar#!#int#!#int -2#!#new row for relation "errorfunctable" violates check constraint "ck_a_gt_berrorfunctablee59e418278eefa47185bf50958adfcb4"#!#547#!##!#16#!#1 +2#!#new row for relation "errorfunctable" violates check constraint "ck_a_gt_b"#!#547#!##!#16#!#1 ~~END~~ diff --git a/test/JDBC/expected/babel_621.out b/test/JDBC/expected/babel_621.out index 28601c2a8d..c76b6b5ddb 100644 --- a/test/JDBC/expected/babel_621.out +++ b/test/JDBC/expected/babel_621.out @@ -20,16 +20,8 @@ alter table table_3 add constraint uniq unique (a); go create index uniq on table_3(a); go -~~ERROR (Code: 2714)~~ - -~~ERROR (Message: relation "uniqtable_3ceb6b355c65c1ee318991aead0f652e4" already exists)~~ - drop index uniq on table_3; go -~~ERROR (Code: 3723)~~ - -~~ERROR (Message: cannot drop index uniqtable_3ceb6b355c65c1ee318991aead0f652e4 because constraint uniqtable_3ceb6b355c65c1ee318991aead0f652e4 on table table_3 requires it)~~ - -- create table table_4 (a int); go @@ -37,16 +29,8 @@ create index uniq_table_4 on table_4(a); go alter table table_4 add constraint uniq_table_4 unique (a); go -~~ERROR (Code: 2714)~~ - -~~ERROR (Message: relation "uniq_table_4table_40bc519c02c847b83a833f1f3715ff0fd" already exists)~~ - alter table table_4 drop constraint uniq_table_4; go -~~ERROR (Code: 3728)~~ - -~~ERROR (Message: constraint "uniq_table_4table_40bc519c02c847b83a833f1f3715ff0fd" of relation "table_4" does not exist)~~ - -- Test that `sp_rename` is NOT available. If it is available, we need more tests with index/constraints renames -- We expect this test to break when `sp_rename` will be implemented diff --git a/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/BABEL-1206-vu-prepare.out b/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/BABEL-1206-vu-prepare.out index 35a889db97..171f606662 100644 --- a/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/BABEL-1206-vu-prepare.out +++ b/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/BABEL-1206-vu-prepare.out @@ -43,13 +43,10 @@ go CREATE TABLE babel_1206_vu_prepare_t4( [DistinctApplicationID] [bigint] IDENTITY(1,1) NOT NULL, - [Description] [nvarchar](1024) NOT NULL, - [DescriptionHash] AS (hashbytes('MD5',[Description])) PERSISTED NOT NULL, - CONSTRAINT babel_1206_vu_prepare_t4_i3 UNIQUE NONCLUSTERED - ( - [DescriptionHash] ASC - ) - ) ON [PRIMARY] + [Description] [nvarchar](1024) NOT NULL CONSTRAINT babel_1206_vu_prepare_t4_i3 UNIQUE NONCLUSTERED, + [DescriptionHash] AS (hashbytes('MD5',[Description])) PERSISTED NOT NULL +) +ON [PRIMARY] go insert into babel_1206_vu_prepare_t4 values (0xaaa); diff --git a/test/JDBC/input/BABEL-1206-vu-prepare.sql b/test/JDBC/input/BABEL-1206-vu-prepare.sql index 7ce45bf8e4..96e99202ca 100644 --- a/test/JDBC/input/BABEL-1206-vu-prepare.sql +++ b/test/JDBC/input/BABEL-1206-vu-prepare.sql @@ -35,13 +35,10 @@ go CREATE TABLE babel_1206_vu_prepare_t4( [DistinctApplicationID] [bigint] IDENTITY(1,1) NOT NULL, - [Description] [nvarchar](1024) NOT NULL, - [DescriptionHash] AS (hashbytes('MD5',[Description])) PERSISTED NOT NULL, - CONSTRAINT babel_1206_vu_prepare_t4_i3 UNIQUE NONCLUSTERED - ( - [DescriptionHash] ASC - ) - ) ON [PRIMARY] + [Description] [nvarchar](1024) NOT NULL CONSTRAINT babel_1206_vu_prepare_t4_i3 UNIQUE NONCLUSTERED, + [DescriptionHash] AS (hashbytes('MD5',[Description])) PERSISTED NOT NULL +) +ON [PRIMARY] go insert into babel_1206_vu_prepare_t4 values (0xaaa); diff --git a/test/JDBC/input/BABEL-1715-vu-prepare.sql b/test/JDBC/input/BABEL-1715-vu-prepare.sql index 24107371fe..d93ebd5eed 100644 --- a/test/JDBC/input/BABEL-1715-vu-prepare.sql +++ b/test/JDBC/input/BABEL-1715-vu-prepare.sql @@ -1,14 +1,14 @@ use master; go -CREATE TABLE babel_1715_vu_prepare_t1 (a int, b int CONSTRAINT uk_a PRIMARY KEY (a)); +CREATE TABLE babel_1715_vu_prepare_t1 (a int CONSTRAINT uk_a PRIMARY KEY, b int); go INSERT INTO babel_1715_vu_prepare_t1 VALUES (1, 1); INSERT INTO babel_1715_vu_prepare_t1 VALUES (2, 2); GO -CREATE TABLE babel_1715_vu_prepare_t2 (a int, b as a+1 CONSTRAINT uk_a PRIMARY KEY (a)); +CREATE TABLE babel_1715_vu_prepare_t2 (a int CONSTRAINT uk_a1 PRIMARY KEY, b as a+1); go INSERT INTO babel_1715_vu_prepare_t2 (a) VALUES (1); diff --git a/test/JDBC/input/BABEL-621-before-14_13-vu-cleanup.sql b/test/JDBC/input/BABEL-621-before-14_13-vu-cleanup.sql new file mode 100644 index 0000000000..5ad2c5a451 --- /dev/null +++ b/test/JDBC/input/BABEL-621-before-14_13-vu-cleanup.sql @@ -0,0 +1,41 @@ +DROP INDEX idx on babel_621_vu_prepare_table_1; +DROP INDEX idx on babel_621_vu_prepare_table_2; +GO + +DROP INDEX uniq on babel_621_vu_prepare_table_3; +GO + +DROP INDEX very_long_index_name_on_a_table_1234567890_1234567890_1234567890_1234567890_1234567890 on babel_621_vu_prepare_table_with_long_index_name; +GO + +DROP INDEX very_long_index_name_on_a_table_1234567890_1234567890_1234567890_1234567890_1234567890 on babel_621_table_with_long_name_1234567890_1234567890_1234567890_1234567890_1234567890; +GO + +DROP TABLE babel_621_vu_prepare_table_1; +GO +DROP TABLE babel_621_vu_prepare_table_2; +GO +DROP TABLE babel_621_vu_prepare_table_3; +GO +DROP TABLE babel_621_vu_prepare_table_4; +GO +DROP TABLE babel_621_vu_prepare_table_with_long_index_name; +GO +DROP TABLE babel_621_vu_prepare_second_table_with_long_index_name; +GO +DROP TABLE babel_621_table_with_long_name_1234567890_1234567890_1234567890_1234567890_1234567890; +GO +DROP TABLE babel_621_second_table_with_long_name_1234567890_1234567890_1234567890_1234567890_1234567890; +GO +DROP TABLE babel_621_vu_prepare_table_6; +GO +DROP TABLE table_6; +GO +DROP TABLE table_7; +GO +DROP TABLE babel_621_vu_prepare_table_7; +GO +DROP TABLE babel_621_vu_prepare_table_8; +GO +DROP TABLE babel_621_vu_prepare_table_10; +GO \ No newline at end of file diff --git a/test/JDBC/input/BABEL-621-before-14_13-vu-prepare.sql b/test/JDBC/input/BABEL-621-before-14_13-vu-prepare.sql new file mode 100644 index 0000000000..6855a420b6 --- /dev/null +++ b/test/JDBC/input/BABEL-621-before-14_13-vu-prepare.sql @@ -0,0 +1,102 @@ +EXECUTE sp_babelfish_configure 'escape_hatch_unique_constraint', 'ignore' +go + +create table babel_621_vu_prepare_table_1 (a int); +go +create table babel_621_vu_prepare_table_2 (a int); +go +create index idx on babel_621_vu_prepare_table_1(a); +go +create index idx on babel_621_vu_prepare_table_2(a); +go + +create table babel_621_vu_prepare_table_3 (a int); +go +alter table babel_621_vu_prepare_table_3 add constraint uniq unique (a); +go +create index uniq on babel_621_vu_prepare_table_3(a); +go + +create table babel_621_vu_prepare_table_4 (a int); +go +create index uniq_table_4 on babel_621_vu_prepare_table_4(a); +go +alter table babel_621_vu_prepare_table_4 add constraint uniq_table_4 unique (a); +go +alter table babel_621_vu_prepare_table_4 drop constraint uniq_table_4; +go + +-- Very long index name +create table babel_621_vu_prepare_table_with_long_index_name (a int); +go +create index very_long_index_name_on_a_table_1234567890_1234567890_1234567890_1234567890_1234567890 on babel_621_vu_prepare_table_with_long_index_name(a); +go + +create table babel_621_vu_prepare_second_table_with_long_index_name (a int); +go +create index very_long_index_name_on_a_table_1234567890_1234567890_1234567890_1234567890_1234567890 on babel_621_vu_prepare_second_table_with_long_index_name(a); +go + +-- Very long table name and very long index name +create table babel_621_table_with_long_name_1234567890_1234567890_1234567890_1234567890_1234567890 (a int); +go +create index very_long_index_name_on_a_table_1234567890_1234567890_1234567890_1234567890_1234567890 on babel_621_table_with_long_name_1234567890_1234567890_1234567890_1234567890_1234567890(a); +go + +create table babel_621_second_table_with_long_name_1234567890_1234567890_1234567890_1234567890_1234567890 (a int); +go +create index very_long_index_name_on_a_table_1234567890_1234567890_1234567890_1234567890_1234567890 on babel_621_second_table_with_long_name_1234567890_1234567890_1234567890_1234567890_1234567890(a); +go + +-- Situation where simple concatenation of table and index name does not work +-- E.g. table_a + index_a == table_b + index_b +create table babel_621_vu_prepare_table_6 (a int); +go +create index idx_ on babel_621_vu_prepare_table_6(a); +go + +create table table_6 (a int); +go +create index idx_babel_621_vu_prepare_ on table_6(a); +go +-- Situation where simple concatenation of index and table name does not work (reverse of previous) +-- E.g. index_a + table_a == index_b + table_b +create table table_7 (a int); +go +create index idx_babel_621_vu_prepare_ on table_7(a); +go + +create table babel_621_vu_prepare_table_7 (a int); +go +create index idx_ on babel_621_vu_prepare_table_7(a); +go + +-- +create table babel_621_vu_prepare_table_8 ( + a int, + value int, + constraint constraint_8 unique nonclustered + ( + value asc + ) + ) +go +alter table babel_621_vu_prepare_table_8 drop constraint constraint_8; +go +insert into babel_621_vu_prepare_table_8 values(1, 1); +insert into babel_621_vu_prepare_table_8 values(2, 1); +go + +create table babel_621_vu_prepare_table_10 +( + a int, + b int, + c int +) +go +create unique index idx on babel_621_vu_prepare_table_10 (a, b); +go +insert into babel_621_vu_prepare_table_10 values(1, 1, 1); +insert into babel_621_vu_prepare_table_10 values(1, 2, 1); +insert into babel_621_vu_prepare_table_10 values(1, 2, 2); +go \ No newline at end of file diff --git a/test/JDBC/input/BABEL-621-before-14_13-vu-verify.sql b/test/JDBC/input/BABEL-621-before-14_13-vu-verify.sql new file mode 100644 index 0000000000..d099bd4947 --- /dev/null +++ b/test/JDBC/input/BABEL-621-before-14_13-vu-verify.sql @@ -0,0 +1,7 @@ +select a, value from babel_621_vu_prepare_table_8 order by a; +go + +drop index idx on babel_621_vu_prepare_table_10; +go +insert into babel_621_vu_prepare_table_10 values(1, 2, 2); +go \ No newline at end of file diff --git a/test/JDBC/input/BABEL-TABLEOPTIONS-vu-prepare.sql b/test/JDBC/input/BABEL-TABLEOPTIONS-vu-prepare.sql index f97ec953dc..0f0ccfc7be 100644 --- a/test/JDBC/input/BABEL-TABLEOPTIONS-vu-prepare.sql +++ b/test/JDBC/input/BABEL-TABLEOPTIONS-vu-prepare.sql @@ -1,4 +1,4 @@ -CREATE TABLE babel_tableoptions_vu_prepare_t1 (a INT, CONSTRAINT pk PRIMARY KEY CLUSTERED (a ASC)) WITH +CREATE TABLE babel_tableoptions_vu_prepare_t1 (a INT, CONSTRAINT pk_99 PRIMARY KEY CLUSTERED (a ASC)) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, diff --git a/test/JDBC/input/BABEL_4817-vu-prepare.mix b/test/JDBC/input/BABEL_4817-vu-prepare.mix index d4303de388..9ad7542bb5 100644 --- a/test/JDBC/input/BABEL_4817-vu-prepare.mix +++ b/test/JDBC/input/BABEL_4817-vu-prepare.mix @@ -14,7 +14,7 @@ GO -- tsql CREATE TABLE babel_4817_t2 (col1 INT, col2 INT NOT NULL, col3 AS col1*col2, col4 INT, col5 INT, col6 INT, col7 INT NOT NULL IDENTITY, col8 INT NOT NULL) GO -ALTER TABLE babel_4817_t2 ADD CONSTRAINT babel_4817_t2_pk PRIMARY KEY NONCLUSTERED (col3, col7); +ALTER TABLE babel_4817_t2 ADD CONSTRAINT babel_4817_t2_pkkkkkkkkkkkkkkk PRIMARY KEY NONCLUSTERED (col3, col7); GO -- clustered is ignored CREATE UNIQUE NONCLUSTERED INDEX babel_4817_t2_unique_index ON dbo.babel_4817_t2 (col2 DESC, col8) INCLUDE (col4); diff --git a/test/JDBC/jdbc_schedule b/test/JDBC/jdbc_schedule index 49eb4ca371..0cc883ab15 100644 --- a/test/JDBC/jdbc_schedule +++ b/test/JDBC/jdbc_schedule @@ -158,6 +158,9 @@ ignore#!#BABEL-4863-before-16_3-or-15_7-or-14_12-vu-cleanup ignore#!#babel_726-before-14_12-or-15_7-or-16_3-vu-prepare ignore#!#babel_726-before-14_12-or-15_7-or-16_3-vu-verify ignore#!#babel_726-before-14_12-or-15_7-or-16_3-vu-cleanup +ignore#!#BABEL-621-before-14_13-vu-prepare +ignore#!#BABEL-621-before-14_13-vu-verify +ignore#!#BABEL-621-before-14_13-vu-cleanup # These tests are running in multidb mode in upgrade and singledb mode in JDBC ignore#!#BABEL-4279-vu-prepare diff --git a/test/JDBC/upgrade/13_4/schedule b/test/JDBC/upgrade/13_4/schedule index 4cebd88367..5a32dd68c5 100644 --- a/test/JDBC/upgrade/13_4/schedule +++ b/test/JDBC/upgrade/13_4/schedule @@ -103,7 +103,7 @@ Test-sp_helpdbfixedrole Test-sp_helpsrvrolemember BABEL-404 BABEL-493 -BABEL-621 +BABEL-621-before-14_13 BABEL-775 BABEL-1206-before-15-5-or-14-10 BABEL-1251 diff --git a/test/JDBC/upgrade/13_5/schedule b/test/JDBC/upgrade/13_5/schedule index 10a9057f15..c67fce9174 100644 --- a/test/JDBC/upgrade/13_5/schedule +++ b/test/JDBC/upgrade/13_5/schedule @@ -150,7 +150,7 @@ Test-sp_helpdbfixedrole Test-sp_helpsrvrolemember BABEL-404 BABEL-493 -BABEL-621 +BABEL-621-before-14_13 BABEL-775 BABEL-1206-before-15-5-or-14-10 BABEL-1251 diff --git a/test/JDBC/upgrade/13_6/schedule b/test/JDBC/upgrade/13_6/schedule index 817a3e87c2..9ece31a8ea 100644 --- a/test/JDBC/upgrade/13_6/schedule +++ b/test/JDBC/upgrade/13_6/schedule @@ -168,7 +168,7 @@ Test-sp_helpdbfixedrole Test-sp_helpsrvrolemember BABEL-404 BABEL-493 -BABEL-621 +BABEL-621-before-14_13 BABEL-775 BABEL-1206-before-15-5-or-14-10 BABEL-1251 diff --git a/test/JDBC/upgrade/13_7/schedule b/test/JDBC/upgrade/13_7/schedule index 56ea667f23..9adba6b066 100644 --- a/test/JDBC/upgrade/13_7/schedule +++ b/test/JDBC/upgrade/13_7/schedule @@ -166,7 +166,7 @@ Test-sp_helpdbfixedrole Test-sp_helpsrvrolemember BABEL-404 BABEL-493 -BABEL-621 +BABEL-621-before-14_13 BABEL-775 BABEL-1206-before-15-5-or-14-10 BABEL-1251 diff --git a/test/JDBC/upgrade/13_8/schedule b/test/JDBC/upgrade/13_8/schedule index 56ea667f23..9adba6b066 100644 --- a/test/JDBC/upgrade/13_8/schedule +++ b/test/JDBC/upgrade/13_8/schedule @@ -166,7 +166,7 @@ Test-sp_helpdbfixedrole Test-sp_helpsrvrolemember BABEL-404 BABEL-493 -BABEL-621 +BABEL-621-before-14_13 BABEL-775 BABEL-1206-before-15-5-or-14-10 BABEL-1251 diff --git a/test/JDBC/upgrade/13_9/schedule b/test/JDBC/upgrade/13_9/schedule index 7fc422ba12..62f21a348a 100644 --- a/test/JDBC/upgrade/13_9/schedule +++ b/test/JDBC/upgrade/13_9/schedule @@ -165,7 +165,7 @@ Test-sp_helpdbfixedrole Test-sp_helpsrvrolemember BABEL-404 BABEL-493 -BABEL-621 +BABEL-621-before-14_13 BABEL-775 BABEL-1206-before-15-5-or-14-10 BABEL-1251 diff --git a/test/JDBC/upgrade/14_10/schedule b/test/JDBC/upgrade/14_10/schedule index 0ba20d3f58..edd97ab399 100644 --- a/test/JDBC/upgrade/14_10/schedule +++ b/test/JDBC/upgrade/14_10/schedule @@ -86,7 +86,7 @@ sys-trigger_nestlevel schema_resolution_proc BABEL-404 BABEL-493 -BABEL-621 +BABEL-621-before-14_13 BABEL-775 BABEL-1206 BABEL-1251 diff --git a/test/JDBC/upgrade/14_11/schedule b/test/JDBC/upgrade/14_11/schedule index 070cbebc0a..59aebed18b 100644 --- a/test/JDBC/upgrade/14_11/schedule +++ b/test/JDBC/upgrade/14_11/schedule @@ -85,7 +85,7 @@ sys-trigger_nestlevel schema_resolution_proc BABEL-404 BABEL-493 -BABEL-621 +BABEL-621-before-14_13 BABEL-775 BABEL-1206 BABEL-1251 diff --git a/test/JDBC/upgrade/14_3/schedule b/test/JDBC/upgrade/14_3/schedule index a7d51da537..04c17a9612 100644 --- a/test/JDBC/upgrade/14_3/schedule +++ b/test/JDBC/upgrade/14_3/schedule @@ -166,7 +166,7 @@ Test-sp_helpdbfixedrole Test-sp_helpsrvrolemember BABEL-404 BABEL-493 -BABEL-621 +BABEL-621-before-14_13 BABEL-775 BABEL-1206-before-15-5-or-14-10 BABEL-1251 diff --git a/test/JDBC/upgrade/14_5/schedule b/test/JDBC/upgrade/14_5/schedule index 4f64efa0cd..0c376f3352 100644 --- a/test/JDBC/upgrade/14_5/schedule +++ b/test/JDBC/upgrade/14_5/schedule @@ -85,7 +85,7 @@ sys-trigger_nestlevel schema_resolution_proc BABEL-404 BABEL-493 -BABEL-621 +BABEL-621-before-14_13 BABEL-775 BABEL-1206-before-15-5-or-14-10 BABEL-1251 diff --git a/test/JDBC/upgrade/14_6/schedule b/test/JDBC/upgrade/14_6/schedule index 65e27872f0..f79198b3d7 100644 --- a/test/JDBC/upgrade/14_6/schedule +++ b/test/JDBC/upgrade/14_6/schedule @@ -83,7 +83,7 @@ sys-trigger_nestlevel schema_resolution_proc BABEL-404 BABEL-493 -BABEL-621 +BABEL-621-before-14_13 BABEL-775 BABEL-1206-before-15-5-or-14-10 BABEL-1251 diff --git a/test/JDBC/upgrade/14_7/schedule b/test/JDBC/upgrade/14_7/schedule index 0920be474a..80d4424a46 100644 --- a/test/JDBC/upgrade/14_7/schedule +++ b/test/JDBC/upgrade/14_7/schedule @@ -86,7 +86,7 @@ sys-trigger_nestlevel schema_resolution_proc BABEL-404 BABEL-493 -BABEL-621 +BABEL-621-before-14_13 BABEL-775 BABEL-1206-before-15-5-or-14-10 BABEL-1251 diff --git a/test/JDBC/upgrade/14_8/schedule b/test/JDBC/upgrade/14_8/schedule index 2112c9887a..2b4642b3d5 100644 --- a/test/JDBC/upgrade/14_8/schedule +++ b/test/JDBC/upgrade/14_8/schedule @@ -86,7 +86,7 @@ sys-trigger_nestlevel schema_resolution_proc BABEL-404 BABEL-493 -BABEL-621 +BABEL-621-before-14_13 BABEL-775 BABEL-1206-before-15-5-or-14-10 BABEL-1251 diff --git a/test/JDBC/upgrade/14_9/schedule b/test/JDBC/upgrade/14_9/schedule index 09e62f3670..dfa55f5b53 100644 --- a/test/JDBC/upgrade/14_9/schedule +++ b/test/JDBC/upgrade/14_9/schedule @@ -86,7 +86,7 @@ sys-trigger_nestlevel schema_resolution_proc BABEL-404 BABEL-493 -BABEL-621 +BABEL-621-before-14_13 BABEL-775 BABEL-1206-before-15-5-or-14-10 BABEL-1251 From b1dd3a656593648d68b016d29e9638c49b7f6299 Mon Sep 17 00:00:00 2001 From: Tanzeel Khan Date: Thu, 16 May 2024 12:19:13 +0000 Subject: [PATCH 3/4] update some more test file expected output Signed-off-by: Tanzeel Khan --- .github/workflows/odbc-tests.yml | 2 +- .../chinese_prc_ci_as/BABEL-UNSUPPORTED.out | 6 +++--- test/python/expected/pyodbc/ddl_func_proc.out | 4 ++-- test/python/expected/pyodbc/ddl_tables_index.out | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/odbc-tests.yml b/.github/workflows/odbc-tests.yml index bd8572c6fd..f519036cdb 100644 --- a/.github/workflows/odbc-tests.yml +++ b/.github/workflows/odbc-tests.yml @@ -58,7 +58,7 @@ jobs: if: steps.install-extensions.outcome == 'success' && steps.install-unix-odbc-driver.outcome=='success' run: | cd ~ - wget https://ftp.postgresql.org/pub/odbc/versions/src/psqlodbc-16.00.0000.tar.gz + wget https://ftp.postgresql.org/pub/odbc/versions.old/src/psqlodbc-16.00.0000.tar.gz tar -zxvf psqlodbc-16.00.0000.tar.gz cd psqlodbc-16.00.0000 ./configure diff --git a/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/BABEL-UNSUPPORTED.out b/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/BABEL-UNSUPPORTED.out index 8c1b0dd732..9b7596e307 100644 --- a/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/BABEL-UNSUPPORTED.out +++ b/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/BABEL-UNSUPPORTED.out @@ -1673,7 +1673,7 @@ INSERT INTO t_unsupported_cac1 VALUES (0, 0); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "t_unsupported_cac1" violates check constraint "chk1t_unsupported_cac1848ea8bb1121ee393ad72ae0d412d8d2")~~ +~~ERROR (Message: new row for relation "t_unsupported_cac1" violates check constraint "chk1t_unsupported_cac1")~~ DROP TABLE t_unsupported_cac1 GO @@ -1700,7 +1700,7 @@ ALTER TABLE t_unsupported_cec1 ADD constraint chk1 check (a > 0) GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: check constraint "chk1t_unsupported_cec1848ea8bb1121ee393ad72ae0d412d8d2" of relation "t_unsupported_cec1" is violated by some row)~~ +~~ERROR (Message: check constraint "chk1" of relation "t_unsupported_cec1" is violated by some row)~~ ALTER TABLE t_unsupported_cec1 CHECK constraint chk1 GO @@ -1729,7 +1729,7 @@ ALTER TABLE t_unsupported_cec1 ADD constraint chk1 check (a > 0) GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: check constraint "chk1t_unsupported_cec1848ea8bb1121ee393ad72ae0d412d8d2" of relation "t_unsupported_cec1" is violated by some row)~~ +~~ERROR (Message: check constraint "chk1" of relation "t_unsupported_cec1" is violated by some row)~~ ALTER TABLE t_unsupported_cec1 CHECK constraint chk1 GO diff --git a/test/python/expected/pyodbc/ddl_func_proc.out b/test/python/expected/pyodbc/ddl_func_proc.out index 18668576b8..56745598f4 100644 --- a/test/python/expected/pyodbc/ddl_func_proc.out +++ b/test/python/expected/pyodbc/ddl_func_proc.out @@ -7,7 +7,7 @@ CREATE TABLE [dbo].[routines_customers]( [city] [char](50) NULL, [state] [char](25) NULL, [zip_code] [char](10) NULL, - CONSTRAINT [customers_pkroutines_customers248e85dd01b015e3396e8567c240879b] PRIMARY KEY NONCLUSTERED + CONSTRAINT [customers_pk] PRIMARY KEY NONCLUSTERED ( [customer_id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) @@ -197,7 +197,7 @@ BEGIN END; GO -ALTER TABLE [dbo].[routines_customers] ADD CONSTRAINT [customers_pkroutines_customers248e85dd01b015e3396e8567c240879b] PRIMARY KEY NONCLUSTERED +ALTER TABLE [dbo].[routines_customers] ADD CONSTRAINT [customers_pk] PRIMARY KEY NONCLUSTERED ( [customer_id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) diff --git a/test/python/expected/pyodbc/ddl_tables_index.out b/test/python/expected/pyodbc/ddl_tables_index.out index c8140963e2..ab0e39671f 100644 --- a/test/python/expected/pyodbc/ddl_tables_index.out +++ b/test/python/expected/pyodbc/ddl_tables_index.out @@ -34,7 +34,7 @@ CREATE TABLE [dbo].[babel_4817_t2]( [col6] [int] NULL, [col7] [int] IDENTITY(1,1) NOT NULL, [col8] [int] NOT NULL, - CONSTRAINT [babel_4817_t2_pkbabel_4817_t2405f712bf0a4067d413068dcbaf9fc11] PRIMARY KEY NONCLUSTERED + CONSTRAINT [babel_4817_t2_pk] PRIMARY KEY NONCLUSTERED ( [col3] ASC, [col7] ASC @@ -185,8 +185,8 @@ CREATE TABLE [dbo].[test_null]( [b] [int] NULL ) ON [PRIMARY] -ALTER TABLE [dbo].[test_null] WITH CHECK ADD CONSTRAINT [constraint1test_null987b8e55c77de33d095778885ecd84f4] CHECK (((a > 10))) -ALTER TABLE [dbo].[test_null] CHECK CONSTRAINT [constraint1test_null987b8e55c77de33d095778885ecd84f4] +ALTER TABLE [dbo].[test_null] WITH CHECK ADD CONSTRAINT [constraint1] CHECK (((a > 10))) +ALTER TABLE [dbo].[test_null] CHECK CONSTRAINT [constraint1] ALTER TABLE [dbo].[test_null] WITH CHECK ADD CONSTRAINT [test_null_a_check] CHECK (((a IS NOT NULL))) ALTER TABLE [dbo].[test_null] CHECK CONSTRAINT [test_null_a_check] GO @@ -275,7 +275,7 @@ GO SET ANSI_PADDING ON -ALTER TABLE [dbo].[babel_4817_t2] ADD CONSTRAINT [babel_4817_t2_pkbabel_4817_t2405f712bf0a4067d413068dcbaf9fc11] PRIMARY KEY NONCLUSTERED +ALTER TABLE [dbo].[babel_4817_t2] ADD CONSTRAINT [babel_4817_t2_pk] PRIMARY KEY NONCLUSTERED ( [col3] ASC, [col7] ASC From 7c19f36d1f353fadea250c68a55c120dec985be8 Mon Sep 17 00:00:00 2001 From: Tanzeel Khan Date: Thu, 16 May 2024 13:18:35 +0000 Subject: [PATCH 4/4] update some more test cases expected file Signed-off-by: Tanzeel Khan --- .../chinese_prc_ci_as/BABEL-UNSUPPORTED.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/BABEL-UNSUPPORTED.out b/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/BABEL-UNSUPPORTED.out index 9b7596e307..6fe87fabdc 100644 --- a/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/BABEL-UNSUPPORTED.out +++ b/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/BABEL-UNSUPPORTED.out @@ -1673,7 +1673,7 @@ INSERT INTO t_unsupported_cac1 VALUES (0, 0); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "t_unsupported_cac1" violates check constraint "chk1t_unsupported_cac1")~~ +~~ERROR (Message: new row for relation "t_unsupported_cac1" violates check constraint "chk1")~~ DROP TABLE t_unsupported_cac1 GO