summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorPavan Deolasee2017-08-25 06:39:42 +0000
committerPavan Deolasee2017-08-25 06:39:42 +0000
commitc613160bfb202465a2143e867281146eb7f8928f (patch)
tree5f3e5f77f39da0962dbd74ceb80aa34290e5c72c /src/test
parent333a544a96e100664e64575be59b89ac9a71e418 (diff)
Make adjustment to foreign_key test case
Accept some diffs which look sane and in-line with the upstream errors. Also comment out a few tests which explictly test subtransactions, something we don't currently support.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/foreign_key.out43
-rw-r--r--src/test/regress/sql/foreign_key.sql28
2 files changed, 39 insertions, 32 deletions
diff --git a/src/test/regress/expected/foreign_key.out b/src/test/regress/expected/foreign_key.out
index 8e91bb7a87..59e951906f 100644
--- a/src/test/regress/expected/foreign_key.out
+++ b/src/test/regress/expected/foreign_key.out
@@ -931,16 +931,21 @@ create table pktable_base(base1 int not null) DISTRIBUTE BY REPLICATION;
create table pktable(ptest1 inet, primary key(base1, ptest1)) inherits (pktable_base);
-- just generally bad types (with and without column references on the referenced table)
create table fktable(ftest1 cidr, ftest2 int[], foreign key (ftest1, ftest2) references pktable);
-ERROR: Hash/Modulo distribution column does not refer to hash/modulo distribution column in referenced table.
+ERROR: foreign key constraint "fktable_ftest1_fkey" cannot be implemented
+DETAIL: Key columns "ftest1" and "base1" are of incompatible types: cidr and integer.
create table fktable(ftest1 cidr, ftest2 int[], foreign key (ftest1, ftest2) references pktable(base1, ptest1)) DISTRIBUTE BY REPLICATION;
-ERROR: Hash/Modulo distribution column does not refer to hash/modulo distribution column in referenced table.
+ERROR: foreign key constraint "fktable_ftest1_fkey" cannot be implemented
+DETAIL: Key columns "ftest1" and "base1" are of incompatible types: cidr and integer.
-- let's mix up which columns reference which
create table fktable(ftest1 int, ftest2 inet, foreign key(ftest2, ftest1) references pktable) DISTRIBUTE BY REPLICATION;
-ERROR: Hash/Modulo distribution column does not refer to hash/modulo distribution column in referenced table.
+ERROR: foreign key constraint "fktable_ftest2_fkey" cannot be implemented
+DETAIL: Key columns "ftest2" and "base1" are of incompatible types: inet and integer.
create table fktable(ftest1 int, ftest2 inet, foreign key(ftest2, ftest1) references pktable(base1, ptest1)) DISTRIBUTE BY REPLICATION;
-ERROR: Hash/Modulo distribution column does not refer to hash/modulo distribution column in referenced table.
+ERROR: foreign key constraint "fktable_ftest2_fkey" cannot be implemented
+DETAIL: Key columns "ftest2" and "base1" are of incompatible types: inet and integer.
create table fktable(ftest1 int, ftest2 inet, foreign key(ftest1, ftest2) references pktable(ptest1, base1));
-ERROR: Hash/Modulo distribution column does not refer to hash/modulo distribution column in referenced table.
+ERROR: foreign key constraint "fktable_ftest1_fkey" cannot be implemented
+DETAIL: Key columns "ftest1" and "ptest1" are of incompatible types: integer and inet.
drop table pktable;
drop table pktable_base;
-- 2 columns (1 table), mismatched types
@@ -1398,20 +1403,20 @@ delete from t1 where a = 1;
create table pktable2(f1 int primary key);
create table fktable2(f1 int references pktable2 deferrable initially deferred);
insert into pktable2 values(1);
-begin;
-insert into fktable2 values(1);
-savepoint x;
-delete from fktable2;
-rollback to x;
-commit;
-begin;
-insert into fktable2 values(2);
-savepoint x;
-delete from fktable2;
-rollback to x;
-commit; -- fail
-ERROR: insert or update on table "fktable2" violates foreign key constraint "fktable2_f1_fkey"
-DETAIL: Key (f1)=(2) is not present in table "pktable2".
+-- Since subtransactions are not supported in XL, these tests make no sense
+-- begin;
+-- insert into fktable2 values(1);
+-- savepoint x;
+-- delete from fktable2;
+-- rollback to x;
+-- commit;
+--
+-- begin;
+-- insert into fktable2 values(2);
+-- savepoint x;
+-- delete from fktable2;
+-- rollback to x;
+-- commit; -- fail
--
-- Test that we prevent dropping FK constraint with pending trigger events
--
diff --git a/src/test/regress/sql/foreign_key.sql b/src/test/regress/sql/foreign_key.sql
index f8f0b566fb..2fcd7d6040 100644
--- a/src/test/regress/sql/foreign_key.sql
+++ b/src/test/regress/sql/foreign_key.sql
@@ -1030,19 +1030,21 @@ create table pktable2(f1 int primary key);
create table fktable2(f1 int references pktable2 deferrable initially deferred);
insert into pktable2 values(1);
-begin;
-insert into fktable2 values(1);
-savepoint x;
-delete from fktable2;
-rollback to x;
-commit;
-
-begin;
-insert into fktable2 values(2);
-savepoint x;
-delete from fktable2;
-rollback to x;
-commit; -- fail
+-- Since subtransactions are not supported in XL, these tests make no sense
+
+-- begin;
+-- insert into fktable2 values(1);
+-- savepoint x;
+-- delete from fktable2;
+-- rollback to x;
+-- commit;
+--
+-- begin;
+-- insert into fktable2 values(2);
+-- savepoint x;
+-- delete from fktable2;
+-- rollback to x;
+-- commit; -- fail
--
-- Test that we prevent dropping FK constraint with pending trigger events