Fix alter_table test case
authorPavan Deolasee <[email protected]>
Tue, 29 Aug 2017 06:05:30 +0000 (11:35 +0530)
committerPavan Deolasee <[email protected]>
Tue, 29 Aug 2017 06:05:30 +0000 (11:35 +0530)
Because of XL's strict requirement on column ordering and positioning, change
the test case to avoid DROP COLUMN commands. This kinda makes the test case
useless because the sole purpose of the test was to test if things stand up
well when there is a mismatch in column numbering. Given the current
restriction, there is no other option to make these changes.

src/test/regress/expected/alter_table.out
src/test/regress/sql/alter_table.sql

index dd3a0f3a84ab790012a3b163e90b69bc19d9a5f2..f8f1494d14832d85f86baf4c6132f6d273108c1c 100644 (file)
@@ -3381,12 +3381,14 @@ INFO:  partition constraint for table "part_5" is implied by existing constraint
 -- Check the case where attnos of the partitioning columns in the table being
 -- attached differs from the parent.  It should not affect the constraint-
 -- checking logic that allows to skip the scan.
+-- XL does not allow change in column ordering or numbering. So these tests
+-- currently do not make much sense. Change them anyways to avoid the error
 CREATE TABLE part_6 (
-       c int,
+--     c int,
        LIKE list_parted2,
        CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 6)
 );
-ALTER TABLE part_6 DROP c;
+-- ALTER TABLE part_6 DROP c;
 ALTER TABLE list_parted2 ATTACH PARTITION part_6 FOR VALUES IN (6);
 INFO:  partition constraint for table "part_6" is implied by existing constraints
 -- Similar to above, but the table being attached is a partitioned table
@@ -3397,14 +3399,14 @@ CREATE TABLE part_7 (
        CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 7)
 ) PARTITION BY LIST (b);
 CREATE TABLE part_7_a_null (
-       c int,
-       d int,
-       e int,
+--     c int,
+--     d int,
+--     e int,
        LIKE list_parted2,  -- 'a' will have attnum = 4
        CONSTRAINT check_b CHECK (b IS NULL OR b = 'a'),
        CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 7)
 );
-ALTER TABLE part_7_a_null DROP c, DROP d, DROP e;
+-- ALTER TABLE part_7_a_null DROP c, DROP d, DROP e;
 ALTER TABLE part_7 ATTACH PARTITION part_7_a_null FOR VALUES IN ('a', null);
 INFO:  partition constraint for table "part_7_a_null" is implied by existing constraints
 ALTER TABLE list_parted2 ATTACH PARTITION part_7 FOR VALUES IN (7);
index 7e67762a442719374ce6a244d99a72e7126696fc..55261e2d00d237d8d40a6abd648e073f9d4dc593 100644 (file)
@@ -2198,12 +2198,14 @@ ALTER TABLE list_parted2 ATTACH PARTITION part_5 FOR VALUES IN (5);
 -- Check the case where attnos of the partitioning columns in the table being
 -- attached differs from the parent.  It should not affect the constraint-
 -- checking logic that allows to skip the scan.
+-- XL does not allow change in column ordering or numbering. So these tests
+-- currently do not make much sense. Change them anyways to avoid the error
 CREATE TABLE part_6 (
-       c int,
+--     c int,
        LIKE list_parted2,
        CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 6)
 );
-ALTER TABLE part_6 DROP c;
+-- ALTER TABLE part_6 DROP c;
 ALTER TABLE list_parted2 ATTACH PARTITION part_6 FOR VALUES IN (6);
 
 -- Similar to above, but the table being attached is a partitioned table
@@ -2214,14 +2216,14 @@ CREATE TABLE part_7 (
        CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 7)
 ) PARTITION BY LIST (b);
 CREATE TABLE part_7_a_null (
-       c int,
-       d int,
-       e int,
+--     c int,
+--     d int,
+--     e int,
        LIKE list_parted2,  -- 'a' will have attnum = 4
        CONSTRAINT check_b CHECK (b IS NULL OR b = 'a'),
        CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 7)
 );
-ALTER TABLE part_7_a_null DROP c, DROP d, DROP e;
+-- ALTER TABLE part_7_a_null DROP c, DROP d, DROP e;
 ALTER TABLE part_7 ATTACH PARTITION part_7_a_null FOR VALUES IN ('a', null);
 ALTER TABLE list_parted2 ATTACH PARTITION part_7 FOR VALUES IN (7);