Add test case for Issue #27
authorPallavi Sontakke <[email protected]>
Thu, 28 Jul 2016 06:23:10 +0000 (11:53 +0530)
committerPallavi Sontakke <[email protected]>
Thu, 28 Jul 2016 06:23:10 +0000 (11:53 +0530)
Distribution column can be dropped for MODULO distribution tables.

src/test/regress/expected/xl_alter_table.out
src/test/regress/expected/xl_reported_bugs.out
src/test/regress/sql/xl_alter_table.sql
src/test/regress/sql/xl_reported_bugs.sql

index dcee7dfb56c94380a4eb38a3f45567bd3e8a2304..6d578b898ab19bf51b7be25cab35197473926d6d 100755 (executable)
@@ -78,7 +78,6 @@ ALTER TABLE xl_at3h DELETE NODE (datanode_2);
 ALTER TABLE xl_at3h ADD NODE (datanode_2);
 ALTER TABLE xl_at3h DISTRIBUTE BY REPLICATION; 
 -- MODULO Distributed table:
--- Distribution column cannot be dropped (BUG: It can be dropped now. Test Fails). 
 CREATE TABLE xl_at2m (
     product_no INT8,
     product_id INT2
@@ -100,7 +99,6 @@ ALTER TABLE xl_at2m RENAME COLUMN product_id TO product_identifier;
 ALTER TABLE xl_at2m RENAME TO xl_at3m;
 ALTER TABLE xl_at3m DELETE NODE (datanode_2);
 ALTER TABLE xl_at3m ADD NODE (datanode_2);
-ALTER TABLE xl_at3m DROP COLUMN product_identifier;--bug - distribution column can be dropped.
 ALTER TABLE xl_at3m DISTRIBUTE BY REPLICATION;
 DROP TABLE xl_at;
 DROP TABLE xl_at1;
index e8b8bd6f2d914f7ca9d9fd1b12bf7bf68c97f0ca..d48802d6c9181614e0ea9662fe5f3788f7f830dc 100644 (file)
@@ -1,3 +1,12 @@
+-- #27
+-- Distribution column can be dropped for MODULO distribution tables.
+CREATE TABLE xl_at2m (
+    product_no INT8,
+    product_id INT2
+) DISTRIBUTE BY MODULO (product_id);
+ALTER TABLE xl_at2m DROP COLUMN product_id;
+ERROR:  Distribution column cannot be dropped
+DROP TABLE xl_at2m;
 -- #6
 -- REFRESH MATERIALISED VIEW CONCURRENTLY gives error
 CREATE TABLE t (a int, b int);
index add68854a5c70ee84c6f428217eb0b6a4adf9914..1f1c112b2b10c976c5bb85729a4b5b4e8446a322 100755 (executable)
@@ -131,7 +131,6 @@ ALTER TABLE xl_at3h ADD NODE (datanode_2);
 ALTER TABLE xl_at3h DISTRIBUTE BY REPLICATION; 
 
 -- MODULO Distributed table:
--- Distribution column cannot be dropped (BUG: It can be dropped now. Test Fails). 
 
 CREATE TABLE xl_at2m (
     product_no INT8,
@@ -172,8 +171,6 @@ ALTER TABLE xl_at3m DELETE NODE (datanode_2);
 
 ALTER TABLE xl_at3m ADD NODE (datanode_2);
 
-ALTER TABLE xl_at3m DROP COLUMN product_identifier;--bug - distribution column can be dropped.
-
 ALTER TABLE xl_at3m DISTRIBUTE BY REPLICATION;
 
 DROP TABLE xl_at;
index 5114159faa7f05eeff56799c01fdaf9bd17c18e4..986c0a860af1b3c872a9da6db1ccec517f99ad0a 100644 (file)
@@ -1,3 +1,11 @@
+-- #27
+-- Distribution column can be dropped for MODULO distribution tables.
+CREATE TABLE xl_at2m (
+    product_no INT8,
+    product_id INT2
+) DISTRIBUTE BY MODULO (product_id);
+ALTER TABLE xl_at2m DROP COLUMN product_id;
+DROP TABLE xl_at2m;
 -- #6
 -- REFRESH MATERIALISED VIEW CONCURRENTLY gives error
 CREATE TABLE t (a int, b int);