diff --git a/contrib/babelfishpg_tsql/src/pl_handler.c b/contrib/babelfishpg_tsql/src/pl_handler.c index beed18ffaa..8bcb502b62 100644 --- a/contrib/babelfishpg_tsql/src/pl_handler.c +++ b/contrib/babelfishpg_tsql/src/pl_handler.c @@ -1022,8 +1022,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); } @@ -1111,8 +1109,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 (rowversion_column_name) validate_rowversion_table_constraint(c, rowversion_column_name); } @@ -1192,9 +1188,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-1206-vu-prepare.out b/test/JDBC/expected/BABEL-1206-vu-prepare.out index dfb1e9f653..bf14f212a0 100644 --- a/test/JDBC/expected/BABEL-1206-vu-prepare.out +++ b/test/JDBC/expected/BABEL-1206-vu-prepare.out @@ -38,13 +38,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 ('abc'); @@ -56,5 +53,5 @@ insert into babel_1206_vu_prepare_t4 values ('abc'); 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 87a469d9f2..ce4a8d6762 100644 --- a/test/JDBC/expected/BABEL-1206.out +++ b/test/JDBC/expected/BABEL-1206.out @@ -92,7 +92,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-after-14_12-before-15-vu-cleanup.out b/test/JDBC/expected/BABEL-621-after-14_12-before-15-vu-cleanup.out new file mode 100644 index 0000000000..984b6c8676 --- /dev/null +++ b/test/JDBC/expected/BABEL-621-after-14_12-before-15-vu-cleanup.out @@ -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 diff --git a/test/JDBC/expected/BABEL-621-after-14_12-before-15-vu-prepare.out b/test/JDBC/expected/BABEL-621-after-14_12-before-15-vu-prepare.out new file mode 100644 index 0000000000..5878a79d2d --- /dev/null +++ b/test/JDBC/expected/BABEL-621-after-14_12-before-15-vu-prepare.out @@ -0,0 +1,114 @@ +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 +~~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-after-14_12-before-15-vu-verify.out b/test/JDBC/expected/BABEL-621-after-14_12-before-15-vu-verify.out new file mode 100644 index 0000000000..cc987f7bfd --- /dev/null +++ b/test/JDBC/expected/BABEL-621-after-14_12-before-15-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 8ae31ccdd0..d31d521d5a 100644 --- a/test/JDBC/expected/BABEL-621-vu-prepare.out +++ b/test/JDBC/expected/BABEL-621-vu-prepare.out @@ -13,10 +13,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 @@ -24,16 +20,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 dd2ba47ae7..1cdb382670 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 6dc9140b88..760c26510e 100644 --- a/test/JDBC/expected/BABEL-UNSUPPORTED.out +++ b/test/JDBC/expected/BABEL-UNSUPPORTED.out @@ -1653,7 +1653,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 @@ -1680,7 +1680,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 @@ -1709,7 +1709,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_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/expected/BABEL_3571-15_5-or-15_6-or-16_1-or-16_2-vu-verify.out b/test/JDBC/expected/BABEL_3571-15_5-or-15_6-or-16_1-or-16_2-vu-verify.out index 1b319876b0..4ef89e2f84 100644 --- a/test/JDBC/expected/BABEL_3571-15_5-or-15_6-or-16_1-or-16_2-vu-verify.out +++ b/test/JDBC/expected/BABEL_3571-15_5-or-15_6-or-16_1-or-16_2-vu-verify.out @@ -260,7 +260,7 @@ GO -- drop constraint -ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_unique_idx +ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_unique_idxbabel_31d1688ab21096b897da1cf1ce0e5d29b GO INSERT INTO babel_3571_23 VALUES (NULL, NULL, 0X91) @@ -280,7 +280,7 @@ GO -ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_pkey +ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_pkeybabel_3571_23255e6842fcddf74ed00701a8a0eedc5c INSERT INTO babel_3571_23 VALUES (NULL, NULL, 0X0001) GO ~~ROW COUNT: 1~~ diff --git a/test/JDBC/expected/BABEL_3571-before-15-5-vu-verify.out b/test/JDBC/expected/BABEL_3571-before-15-5-vu-verify.out index 6c0cc7b7f6..d1bad14db4 100644 --- a/test/JDBC/expected/BABEL_3571-before-15-5-vu-verify.out +++ b/test/JDBC/expected/BABEL_3571-before-15-5-vu-verify.out @@ -260,7 +260,7 @@ GO -- drop constraint -ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_unique_idx +ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_unique_idxbabel_31d1688ab21096b897da1cf1ce0e5d29b GO INSERT INTO babel_3571_23 VALUES (NULL, NULL, 0X91) @@ -280,7 +280,7 @@ GO -ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_pkey +ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_pkeybabel_3571_23255e6842fcddf74ed00701a8a0eedc5c INSERT INTO babel_3571_23 VALUES (NULL, NULL, 0X0001) GO ~~ROW COUNT: 1~~ diff --git a/test/JDBC/expected/BABEL_3571.out b/test/JDBC/expected/BABEL_3571.out index 5555e0fc17..539217695c 100644 --- a/test/JDBC/expected/BABEL_3571.out +++ b/test/JDBC/expected/BABEL_3571.out @@ -384,7 +384,7 @@ INSERT INTO babel_3571_3 VALUES (NULL, '', 0x9999) GO ~~ERROR (Code: 2627)~~ -~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_3_unique_idxbabel_35df79da2a42216884edca5a4a798829ce")~~ +~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_3_unique_idx")~~ INSERT INTO babel_3571_3 VALUES (9999, NULL, 0x9999) @@ -408,7 +408,7 @@ INSERT INTO babel_3571_3 VALUES (8888, 'newsomething', 0x1234) GO ~~ERROR (Code: 2627)~~ -~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_3_pkeybabel_3571_34773fbee6e7b68a5cb6b0b6273b17de0")~~ +~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_3_pkey")~~ SELECT indexdef FROM pg_indexes @@ -422,8 +422,8 @@ CREATE UNIQUE INDEX babel_3571_1_id2_key ON master_dbo.babel_3571_1 USING btree CREATE UNIQUE INDEX babel_3571_1_pkey ON master_dbo.babel_3571_1 USING btree (id3 NULLS FIRST) CREATE UNIQUE INDEX babel_3571_2_id1_id2_key ON master_dbo.babel_3571_2 USING btree (id1 NULLS FIRST, id2 DESC NULLS LAST) NULLS NOT DISTINCT CREATE UNIQUE INDEX babel_3571_2_pkey ON master_dbo.babel_3571_2 USING btree (id3 NULLS FIRST) -CREATE UNIQUE INDEX babel_3571_3_pkeybabel_3571_34773fbee6e7b68a5cb6b0b6273b17de0 ON master_dbo.babel_3571_3 USING btree (id3 NULLS FIRST) -CREATE UNIQUE INDEX babel_3571_3_unique_idxbabel_35df79da2a42216884edca5a4a798829ce ON master_dbo.babel_3571_3 USING btree (id1 DESC NULLS LAST, id2 NULLS FIRST) NULLS NOT DISTINCT +CREATE UNIQUE INDEX babel_3571_3_pkey ON master_dbo.babel_3571_3 USING btree (id3 NULLS FIRST) +CREATE UNIQUE INDEX babel_3571_3_unique_idx ON master_dbo.babel_3571_3 USING btree (id1 DESC NULLS LAST, id2 NULLS FIRST) NULLS NOT DISTINCT ~~END~~ @@ -502,7 +502,7 @@ int#!#varchar#!#varbinary ~~START~~ text Query Text: SELECT * FROM babel_3571_3 ORDER BY id1 -Index Scan Backward using babel_3571_3_unique_idxbabel_35df79da2a42216884edca5a4a798829ce on babel_3571_3 (actual rows=6 loops=1) +Index Scan Backward using babel_3571_3_unique_idx on babel_3571_3 (actual rows=6 loops=1) ~~END~~ SET BABELFISH_STATISTICS PROFILE OFF; @@ -538,7 +538,7 @@ INSERT INTO babel_3571_3 VALUES (NULL, NULL, 0X0001) GO ~~ERROR (Code: 2627)~~ -~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_3_pkeybabel_3571_34773fbee6e7b68a5cb6b0b6273b17de0")~~ +~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_3_pkey")~~ SELECT indexdef FROM pg_indexes @@ -552,7 +552,7 @@ CREATE UNIQUE INDEX babel_3571_1_id2_key ON master_dbo.babel_3571_1 USING btree CREATE UNIQUE INDEX babel_3571_1_pkey ON master_dbo.babel_3571_1 USING btree (id3 NULLS FIRST) CREATE UNIQUE INDEX babel_3571_2_id1_id2_key ON master_dbo.babel_3571_2 USING btree (id1 NULLS FIRST, id2 DESC NULLS LAST) NULLS NOT DISTINCT CREATE UNIQUE INDEX babel_3571_2_pkey ON master_dbo.babel_3571_2 USING btree (id3 NULLS FIRST) -CREATE UNIQUE INDEX babel_3571_3_pkeybabel_3571_34773fbee6e7b68a5cb6b0b6273b17de0 ON master_dbo.babel_3571_3 USING btree (id3 NULLS FIRST) +CREATE UNIQUE INDEX babel_3571_3_pkey ON master_dbo.babel_3571_3 USING btree (id3 NULLS FIRST) ~~END~~ @@ -830,7 +830,7 @@ ALTER TABLE babel_3571_1 ADD CONSTRAINT babel_3571_constraint UNIQUE (id) GO ~~ERROR (Code: 1505)~~ -~~ERROR (Message: could not create unique index "babel_3571_constraintbabel_3571c746e4b45548ea46bfc9090993bb46c3")~~ +~~ERROR (Message: could not create unique index "babel_3571_constraint")~~ CREATE UNIQUE INDEX babel_3571_idx ON babel_3571_1(id) GO @@ -852,7 +852,7 @@ INSERT INTO babel_3571_1 VALUES (NULL) GO ~~ERROR (Code: 2627)~~ -~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_constraintbabel_3571c746e4b45548ea46bfc9090993bb46c3")~~ +~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_constraint")~~ DROP TABLE babel_3571_1 GO diff --git a/test/JDBC/expected/BABEL_4817-vu-prepare.out b/test/JDBC/expected/BABEL_4817-vu-prepare.out index f94bd83343..404c297e69 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 7c091b70a7..f0f28eb02c 100644 --- a/test/JDBC/expected/BABEL_4817-vu-verify.out +++ b/test/JDBC/expected/BABEL_4817-vu-verify.out @@ -50,8 +50,8 @@ Index Name fetched from sys.in#!#index_column_i#!#column_i#!#key_ordina#!#is_des char#!#char#!#char#!#char#!#char#!#char babel_4817_t2_idxbabel_4817_t2#!#2 #!#1 #!#0 #!#0 #!#1 babel_4817_t2_idxbabel_4817_t2#!#1 #!#5 #!#1 #!#0 #!#0 -babel_4817_t2_pkbabel_4817_t24#!#1 #!#3 #!#1 #!#0 #!#0 -babel_4817_t2_pkbabel_4817_t24#!#2 #!#7 #!#2 #!#0 #!#0 +babel_4817_t2_pkkkkkkkkkkkkkkk#!#1 #!#3 #!#1 #!#0 #!#0 +babel_4817_t2_pkkkkkkkkkkkkkkk#!#2 #!#7 #!#2 #!#0 #!#0 babel_4817_t2_unique_indexbabe#!#1 #!#2 #!#1 #!#1 #!#0 babel_4817_t2_unique_indexbabe#!#3 #!#4 #!#0 #!#0 #!#1 babel_4817_t2_unique_indexbabe#!#2 #!#8 #!#2 #!#0 #!#0 diff --git a/test/JDBC/expected/BABEL_4940.out b/test/JDBC/expected/BABEL_4940.out index b83b6ddb0d..3a50382a7e 100644 --- a/test/JDBC/expected/BABEL_4940.out +++ b/test/JDBC/expected/BABEL_4940.out @@ -50,7 +50,7 @@ GO -- table constraint multiple column CREATE TABLE babel_4940_t6(id INT, id1 INT) GO -ALTER TABLE babel_4940_t6 ADD CONSTRAINT c PRIMARY KEY(id, id1 DESC) +ALTER TABLE babel_4940_t6 ADD CONSTRAINT c1 PRIMARY KEY(id, id1 DESC) GO DECLARE @i INT=0; WHILE (@i<1000) @@ -66,6 +66,8 @@ GO SELECT set_config('babelfishpg_tsql.explain_costs', 'off', false) SELECT set_config('babelfishpg_tsql.explain_timing', 'off', false) SELECT set_config('babelfishpg_tsql.explain_summary', 'off', false) +SELECT set_config('enable_seqscan', 'off', false); +SELECT set_config('enable_bitmapscan', 'off', false); SET BABELFISH_STATISTICS PROFILE ON; GO ~~START~~ @@ -83,6 +85,16 @@ text off ~~END~~ +~~START~~ +text +off +~~END~~ + +~~START~~ +text +off +~~END~~ + SELECT TOP 10 * FROM babel_4940_t1 ORDER BY id GO @@ -296,7 +308,7 @@ int text Query Text: SELECT TOP 10 * FROM babel_4940_t5 ORDER BY id Limit (actual rows=10 loops=1) - -> Index Only Scan using cbabel_4940_t54a8a08f09d37b73795649038408b5f33 on babel_4940_t5 (actual rows=10 loops=1) + -> Index Only Scan using c on babel_4940_t5 (actual rows=10 loops=1) Heap Fetches: 10 ~~END~~ @@ -320,7 +332,7 @@ int text Query Text: SELECT TOP 10 * FROM babel_4940_t5 ORDER BY id DESC Limit (actual rows=10 loops=1) - -> Index Only Scan Backward using cbabel_4940_t54a8a08f09d37b73795649038408b5f33 on babel_4940_t5 (actual rows=10 loops=1) + -> Index Only Scan Backward using c on babel_4940_t5 (actual rows=10 loops=1) Heap Fetches: 10 ~~END~~ @@ -344,7 +356,7 @@ int#!#int text Query Text: SELECT TOP 10 * FROM babel_4940_t6 ORDER BY id, id1 DESC Limit (actual rows=10 loops=1) - -> Index Only Scan using cbabel_4940_t64a8a08f09d37b73795649038408b5f33 on babel_4940_t6 (actual rows=10 loops=1) + -> Index Only Scan using c1 on babel_4940_t6 (actual rows=10 loops=1) Heap Fetches: 10 ~~END~~ @@ -368,7 +380,7 @@ int#!#int text Query Text: SELECT TOP 10 * FROM babel_4940_t6 ORDER BY id DESC, id1 ASC Limit (actual rows=10 loops=1) - -> Index Only Scan Backward using cbabel_4940_t64a8a08f09d37b73795649038408b5f33 on babel_4940_t6 (actual rows=10 loops=1) + -> Index Only Scan Backward using c1 on babel_4940_t6 (actual rows=10 loops=1) Heap Fetches: 10 ~~END~~ diff --git a/test/JDBC/expected/ISC-Check-Constraints-vu-verify.out b/test/JDBC/expected/ISC-Check-Constraints-vu-verify.out index 7e65a122c1..7539b8e54d 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 0614ed8925..c2c79833c6 100644 --- a/test/JDBC/expected/ISC-Table_Constraints-vu-verify.out +++ b/test/JDBC/expected/ISC-Table_Constraints-vu-verify.out @@ -240,7 +240,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 0b624ba44e..ea66ecc865 100644 --- a/test/JDBC/expected/babel_621.out +++ b/test/JDBC/expected/babel_621.out @@ -17,16 +17,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 @@ -34,16 +26,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-UNSUPPORTED.out b/test/JDBC/expected/non_default_server_collation/chinese_prc_ci_as/BABEL-UNSUPPORTED.out index fa0c9f3436..b91bd56f02 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 @@ -1661,7 +1661,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 @@ -1688,7 +1688,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 @@ -1717,7 +1717,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/non_default_server_collation/japanese_ci_as/test_like_for_AI-vu-verify.out b/test/JDBC/expected/non_default_server_collation/japanese_ci_as/test_like_for_AI-vu-verify.out index 8674fdff41..08e8cded62 100644 --- a/test/JDBC/expected/non_default_server_collation/japanese_ci_as/test_like_for_AI-vu-verify.out +++ b/test/JDBC/expected/non_default_server_collation/japanese_ci_as/test_like_for_AI-vu-verify.out @@ -2284,13 +2284,13 @@ INSERT INTO test_like_for_AI_prepare_employee_CI_AI (id, name) VALUES (6, 'Bob') GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_ci_ai" violates check constraint "check_name_starts_with_atest_liecd1958c3e7903956f04af7a57787ee2")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_ci_ai" violates check constraint "check_name_starts_with_a")~~ INSERT INTO test_like_for_AI_prepare_employee_CI_AI (id, name) VALUES (7, 'ôob'); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_ci_ai" violates check constraint "check_name_starts_with_atest_liecd1958c3e7903956f04af7a57787ee2")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_ci_ai" violates check constraint "check_name_starts_with_a")~~ SELECT * FROM test_like_for_AI_prepare_employee_CI_AI; @@ -4475,25 +4475,25 @@ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (2, 'ådAm GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (3, 'ädam'); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (4, 'adam'); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (5, 'ædam'); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ -- This insert will fail due to the check constraint @@ -4501,13 +4501,13 @@ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (6, 'Bob') GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (7, 'ôob'); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ SELECT * FROM test_like_for_AI_prepare_employee_CS_AI; diff --git a/test/JDBC/expected/parallel_query/BABEL_3571.out b/test/JDBC/expected/parallel_query/BABEL_3571.out index c5ca5520b4..736f7e4274 100644 --- a/test/JDBC/expected/parallel_query/BABEL_3571.out +++ b/test/JDBC/expected/parallel_query/BABEL_3571.out @@ -396,7 +396,7 @@ INSERT INTO babel_3571_3 VALUES (NULL, '', 0x9999) GO ~~ERROR (Code: 2627)~~ -~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_3_unique_idxbabel_35df79da2a42216884edca5a4a798829ce")~~ +~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_3_unique_idx")~~ INSERT INTO babel_3571_3 VALUES (9999, NULL, 0x9999) @@ -420,7 +420,7 @@ INSERT INTO babel_3571_3 VALUES (8888, 'newsomething', 0x1234) GO ~~ERROR (Code: 2627)~~ -~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_3_pkeybabel_3571_34773fbee6e7b68a5cb6b0b6273b17de0")~~ +~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_3_pkey")~~ SELECT indexdef FROM pg_indexes @@ -434,8 +434,8 @@ CREATE UNIQUE INDEX babel_3571_1_id2_key ON master_dbo.babel_3571_1 USING btree CREATE UNIQUE INDEX babel_3571_1_pkey ON master_dbo.babel_3571_1 USING btree (id3 NULLS FIRST) CREATE UNIQUE INDEX babel_3571_2_id1_id2_key ON master_dbo.babel_3571_2 USING btree (id1 NULLS FIRST, id2 DESC NULLS LAST) NULLS NOT DISTINCT CREATE UNIQUE INDEX babel_3571_2_pkey ON master_dbo.babel_3571_2 USING btree (id3 NULLS FIRST) -CREATE UNIQUE INDEX babel_3571_3_pkeybabel_3571_34773fbee6e7b68a5cb6b0b6273b17de0 ON master_dbo.babel_3571_3 USING btree (id3 NULLS FIRST) -CREATE UNIQUE INDEX babel_3571_3_unique_idxbabel_35df79da2a42216884edca5a4a798829ce ON master_dbo.babel_3571_3 USING btree (id1 DESC NULLS LAST, id2 NULLS FIRST) NULLS NOT DISTINCT +CREATE UNIQUE INDEX babel_3571_3_pkey ON master_dbo.babel_3571_3 USING btree (id3 NULLS FIRST) +CREATE UNIQUE INDEX babel_3571_3_unique_idx ON master_dbo.babel_3571_3 USING btree (id1 DESC NULLS LAST, id2 NULLS FIRST) NULLS NOT DISTINCT ~~END~~ @@ -526,7 +526,7 @@ Gather (actual rows=6 loops=1) Workers Planned: 1 Workers Launched: 1 Single Copy: true - -> Index Scan Backward using babel_3571_3_unique_idxbabel_35df79da2a42216884edca5a4a798829ce on babel_3571_3 (actual rows=6 loops=1) + -> Index Scan Backward using babel_3571_3_unique_idx on babel_3571_3 (actual rows=6 loops=1) ~~END~~ SET BABELFISH_STATISTICS PROFILE OFF; @@ -562,7 +562,7 @@ INSERT INTO babel_3571_3 VALUES (NULL, NULL, 0X0001) GO ~~ERROR (Code: 2627)~~ -~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_3_pkeybabel_3571_34773fbee6e7b68a5cb6b0b6273b17de0")~~ +~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_3_pkey")~~ SELECT indexdef FROM pg_indexes @@ -576,7 +576,7 @@ CREATE UNIQUE INDEX babel_3571_1_id2_key ON master_dbo.babel_3571_1 USING btree CREATE UNIQUE INDEX babel_3571_1_pkey ON master_dbo.babel_3571_1 USING btree (id3 NULLS FIRST) CREATE UNIQUE INDEX babel_3571_2_id1_id2_key ON master_dbo.babel_3571_2 USING btree (id1 NULLS FIRST, id2 DESC NULLS LAST) NULLS NOT DISTINCT CREATE UNIQUE INDEX babel_3571_2_pkey ON master_dbo.babel_3571_2 USING btree (id3 NULLS FIRST) -CREATE UNIQUE INDEX babel_3571_3_pkeybabel_3571_34773fbee6e7b68a5cb6b0b6273b17de0 ON master_dbo.babel_3571_3 USING btree (id3 NULLS FIRST) +CREATE UNIQUE INDEX babel_3571_3_pkey ON master_dbo.babel_3571_3 USING btree (id3 NULLS FIRST) ~~END~~ @@ -866,7 +866,7 @@ ALTER TABLE babel_3571_1 ADD CONSTRAINT babel_3571_constraint UNIQUE (id) GO ~~ERROR (Code: 1505)~~ -~~ERROR (Message: could not create unique index "babel_3571_constraintbabel_3571c746e4b45548ea46bfc9090993bb46c3")~~ +~~ERROR (Message: could not create unique index "babel_3571_constraint")~~ CREATE UNIQUE INDEX babel_3571_idx ON babel_3571_1(id) GO @@ -888,7 +888,7 @@ INSERT INTO babel_3571_1 VALUES (NULL) GO ~~ERROR (Code: 2627)~~ -~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_constraintbabel_3571c746e4b45548ea46bfc9090993bb46c3")~~ +~~ERROR (Message: duplicate key value violates unique constraint "babel_3571_constraint")~~ DROP TABLE babel_3571_1 GO diff --git a/test/JDBC/expected/parallel_query/BABEL_4940.out b/test/JDBC/expected/parallel_query/BABEL_4940.out index 7f6b3c94fe..79942141e9 100644 --- a/test/JDBC/expected/parallel_query/BABEL_4940.out +++ b/test/JDBC/expected/parallel_query/BABEL_4940.out @@ -50,7 +50,7 @@ GO -- table constraint multiple column CREATE TABLE babel_4940_t6(id INT, id1 INT) GO -ALTER TABLE babel_4940_t6 ADD CONSTRAINT c PRIMARY KEY(id, id1 DESC) +ALTER TABLE babel_4940_t6 ADD CONSTRAINT c1 PRIMARY KEY(id, id1 DESC) GO DECLARE @i INT=0; WHILE (@i<1000) @@ -66,6 +66,8 @@ GO SELECT set_config('babelfishpg_tsql.explain_costs', 'off', false) SELECT set_config('babelfishpg_tsql.explain_timing', 'off', false) SELECT set_config('babelfishpg_tsql.explain_summary', 'off', false) +SELECT set_config('enable_seqscan', 'off', false); +SELECT set_config('enable_bitmapscan', 'off', false); SET BABELFISH_STATISTICS PROFILE ON; GO ~~START~~ @@ -83,6 +85,16 @@ text off ~~END~~ +~~START~~ +text +off +~~END~~ + +~~START~~ +text +off +~~END~~ + SELECT TOP 10 * FROM babel_4940_t1 ORDER BY id GO @@ -332,7 +344,7 @@ Gather (actual rows=10 loops=1) Workers Launched: 1 Single Copy: true -> Limit (actual rows=10 loops=1) - -> Index Only Scan using cbabel_4940_t54a8a08f09d37b73795649038408b5f33 on babel_4940_t5 (actual rows=10 loops=1) + -> Index Only Scan using c on babel_4940_t5 (actual rows=10 loops=1) Heap Fetches: 10 ~~END~~ @@ -360,7 +372,7 @@ Gather (actual rows=10 loops=1) Workers Launched: 1 Single Copy: true -> Limit (actual rows=10 loops=1) - -> Index Only Scan Backward using cbabel_4940_t54a8a08f09d37b73795649038408b5f33 on babel_4940_t5 (actual rows=10 loops=1) + -> Index Only Scan Backward using c on babel_4940_t5 (actual rows=10 loops=1) Heap Fetches: 10 ~~END~~ @@ -388,7 +400,7 @@ Gather (actual rows=10 loops=1) Workers Launched: 1 Single Copy: true -> Limit (actual rows=10 loops=1) - -> Index Only Scan using cbabel_4940_t64a8a08f09d37b73795649038408b5f33 on babel_4940_t6 (actual rows=10 loops=1) + -> Index Only Scan using c1 on babel_4940_t6 (actual rows=10 loops=1) Heap Fetches: 10 ~~END~~ @@ -416,7 +428,7 @@ Gather (actual rows=10 loops=1) Workers Launched: 1 Single Copy: true -> Limit (actual rows=10 loops=1) - -> Index Only Scan Backward using cbabel_4940_t64a8a08f09d37b73795649038408b5f33 on babel_4940_t6 (actual rows=10 loops=1) + -> Index Only Scan Backward using c1 on babel_4940_t6 (actual rows=10 loops=1) Heap Fetches: 10 ~~END~~ diff --git a/test/JDBC/expected/parallel_query/test_like_for_AI-vu-verify.out b/test/JDBC/expected/parallel_query/test_like_for_AI-vu-verify.out index 6fbe17afee..55a20594c9 100644 --- a/test/JDBC/expected/parallel_query/test_like_for_AI-vu-verify.out +++ b/test/JDBC/expected/parallel_query/test_like_for_AI-vu-verify.out @@ -2285,13 +2285,13 @@ INSERT INTO test_like_for_AI_prepare_employee_CI_AI (id, name) VALUES (6, 'Bob') GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_ci_ai" violates check constraint "check_name_starts_with_atest_liecd1958c3e7903956f04af7a57787ee2")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_ci_ai" violates check constraint "check_name_starts_with_a")~~ INSERT INTO test_like_for_AI_prepare_employee_CI_AI (id, name) VALUES (7, 'ôob'); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_ci_ai" violates check constraint "check_name_starts_with_atest_liecd1958c3e7903956f04af7a57787ee2")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_ci_ai" violates check constraint "check_name_starts_with_a")~~ SELECT * FROM test_like_for_AI_prepare_employee_CI_AI; @@ -4476,25 +4476,25 @@ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (2, 'ådAm GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (3, 'ädam'); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (4, 'adam'); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (5, 'ædam'); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ -- This insert will fail due to the check constraint @@ -4502,13 +4502,13 @@ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (6, 'Bob') GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (7, 'ôob'); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ SELECT * FROM test_like_for_AI_prepare_employee_CS_AI; diff --git a/test/JDBC/expected/test_like_for_AI-vu-verify.out b/test/JDBC/expected/test_like_for_AI-vu-verify.out index c6977bfcaa..3e3f0b227f 100644 --- a/test/JDBC/expected/test_like_for_AI-vu-verify.out +++ b/test/JDBC/expected/test_like_for_AI-vu-verify.out @@ -2285,13 +2285,13 @@ INSERT INTO test_like_for_AI_prepare_employee_CI_AI (id, name) VALUES (6, 'Bob') GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_ci_ai" violates check constraint "check_name_starts_with_atest_liecd1958c3e7903956f04af7a57787ee2")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_ci_ai" violates check constraint "check_name_starts_with_a")~~ INSERT INTO test_like_for_AI_prepare_employee_CI_AI (id, name) VALUES (7, 'ôob'); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_ci_ai" violates check constraint "check_name_starts_with_atest_liecd1958c3e7903956f04af7a57787ee2")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_ci_ai" violates check constraint "check_name_starts_with_a")~~ SELECT * FROM test_like_for_AI_prepare_employee_CI_AI; @@ -4476,25 +4476,25 @@ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (2, 'ådAm GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (3, 'ädam'); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (4, 'adam'); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (5, 'ædam'); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ -- This insert will fail due to the check constraint @@ -4502,13 +4502,13 @@ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (6, 'Bob') GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ INSERT INTO test_like_for_AI_prepare_employee_CS_AI (id, name) VALUES (7, 'ôob'); GO ~~ERROR (Code: 547)~~ -~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_atest_li9c0556d54bbcccb196d33f13188c8740")~~ +~~ERROR (Message: new row for relation "test_like_for_ai_prepare_employee_cs_ai" violates check constraint "check_name_starts_with_a")~~ SELECT * FROM test_like_for_AI_prepare_employee_CS_AI; diff --git a/test/JDBC/input/BABEL-1206-vu-prepare.sql b/test/JDBC/input/BABEL-1206-vu-prepare.sql index 09f8a710ab..f76e76528f 100644 --- a/test/JDBC/input/BABEL-1206-vu-prepare.sql +++ b/test/JDBC/input/BABEL-1206-vu-prepare.sql @@ -32,13 +32,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 ('abc'); 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-after-14_12-before-15-vu-cleanup.sql b/test/JDBC/input/BABEL-621-after-14_12-before-15-vu-cleanup.sql new file mode 100644 index 0000000000..5ad2c5a451 --- /dev/null +++ b/test/JDBC/input/BABEL-621-after-14_12-before-15-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-after-14_12-before-15-vu-prepare.sql b/test/JDBC/input/BABEL-621-after-14_12-before-15-vu-prepare.sql new file mode 100644 index 0000000000..6855a420b6 --- /dev/null +++ b/test/JDBC/input/BABEL-621-after-14_12-before-15-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-after-14_12-before-15-vu-verify.sql b/test/JDBC/input/BABEL-621-after-14_12-before-15-vu-verify.sql new file mode 100644 index 0000000000..d099bd4947 --- /dev/null +++ b/test/JDBC/input/BABEL-621-after-14_12-before-15-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_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) **********/ diff --git a/test/JDBC/input/BABEL_3571-15_5-or-15_6-or-16_1-or-16_2-vu-verify.sql b/test/JDBC/input/BABEL_3571-15_5-or-15_6-or-16_1-or-16_2-vu-verify.sql index 39c20a67ae..be5aaa3902 100644 --- a/test/JDBC/input/BABEL_3571-15_5-or-15_6-or-16_1-or-16_2-vu-verify.sql +++ b/test/JDBC/input/BABEL_3571-15_5-or-15_6-or-16_1-or-16_2-vu-verify.sql @@ -138,7 +138,7 @@ GO -- drop constraint -ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_unique_idx +ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_unique_idxbabel_31d1688ab21096b897da1cf1ce0e5d29b GO INSERT INTO babel_3571_23 VALUES (NULL, NULL, 0X91) @@ -149,8 +149,8 @@ INSERT INTO babel_3571_23 VALUES (NULL, NULL, 0X0001) GO -ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_pkey +ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_pkeybabel_3571_23255e6842fcddf74ed00701a8a0eedc5c INSERT INTO babel_3571_23 VALUES (NULL, NULL, 0X0001) GO diff --git a/test/JDBC/input/BABEL_3571-before-15-5-vu-verify.sql b/test/JDBC/input/BABEL_3571-before-15-5-vu-verify.sql index 39c20a67ae..be5aaa3902 100644 --- a/test/JDBC/input/BABEL_3571-before-15-5-vu-verify.sql +++ b/test/JDBC/input/BABEL_3571-before-15-5-vu-verify.sql @@ -138,7 +138,7 @@ GO -- drop constraint -ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_unique_idx +ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_unique_idxbabel_31d1688ab21096b897da1cf1ce0e5d29b GO INSERT INTO babel_3571_23 VALUES (NULL, NULL, 0X91) @@ -149,8 +149,8 @@ INSERT INTO babel_3571_23 VALUES (NULL, NULL, 0X0001) GO -ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_pkey +ALTER TABLE babel_3571_23 DROP CONSTRAINT babel_3571_23_pkeybabel_3571_23255e6842fcddf74ed00701a8a0eedc5c INSERT INTO babel_3571_23 VALUES (NULL, NULL, 0X0001) GO diff --git a/test/JDBC/input/BABEL_4817-vu-prepare.mix b/test/JDBC/input/BABEL_4817-vu-prepare.mix index f94bd83343..404c297e69 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/input/BABEL_4940.sql b/test/JDBC/input/BABEL_4940.sql index a1da16fd6b..d6174764be 100644 --- a/test/JDBC/input/BABEL_4940.sql +++ b/test/JDBC/input/BABEL_4940.sql @@ -51,7 +51,7 @@ GO -- table constraint multiple column CREATE TABLE babel_4940_t6(id INT, id1 INT) GO -ALTER TABLE babel_4940_t6 ADD CONSTRAINT c PRIMARY KEY(id, id1 DESC) +ALTER TABLE babel_4940_t6 ADD CONSTRAINT c1 PRIMARY KEY(id, id1 DESC) GO DECLARE @i INT=0; WHILE (@i<1000) @@ -67,6 +67,8 @@ GO SELECT set_config('babelfishpg_tsql.explain_costs', 'off', false) SELECT set_config('babelfishpg_tsql.explain_timing', 'off', false) SELECT set_config('babelfishpg_tsql.explain_summary', 'off', false) +SELECT set_config('enable_seqscan', 'off', false); +SELECT set_config('enable_bitmapscan', 'off', false); SET BABELFISH_STATISTICS PROFILE ON; GO diff --git a/test/JDBC/jdbc_schedule b/test/JDBC/jdbc_schedule index 52a0d57144..1b52211a1f 100644 --- a/test/JDBC/jdbc_schedule +++ b/test/JDBC/jdbc_schedule @@ -252,6 +252,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-after-14_12-before-15-vu-prepare +ignore#!#BABEL-621-after-14_12-before-15-vu-verify +ignore#!#BABEL-621-after-14_12-before-15-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/14_12/schedule b/test/JDBC/upgrade/14_12/schedule index 5e9c3481f9..942f5635c4 100644 --- a/test/JDBC/upgrade/14_12/schedule +++ b/test/JDBC/upgrade/14_12/schedule @@ -87,7 +87,7 @@ sys-trigger_nestlevel schema_resolution_proc BABEL-404 BABEL-493 -BABEL-621-before-15_7-or-16_3 +BABEL-621-after-14_12-before-15 BABEL-775 BABEL-1206 BABEL-1251 @@ -429,7 +429,6 @@ BABEL-730-before-15_6-or-16_1 BABEL-492-before-15_6 babel-4517 babel-3254 -BABEL_3571-before-15-5 BABEL-4641 BABEL-4863 babel_test_int4_numeric_oper_before_16_3 diff --git a/test/python/expected/pyodbc/ddl_func_proc.out b/test/python/expected/pyodbc/ddl_func_proc.out index ef39905e97..9b854748cb 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) @@ -206,7 +206,7 @@ CREATE TYPE [dbo].[@myrettable_routines_fc7] AS TABLE( ) 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 711c63c544..0812587ed7 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 @@ -183,8 +183,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 @@ -273,7 +273,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