summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPallavi Sontakke2016-02-02 09:17:30 +0000
committerPavan Deolasee2016-10-18 09:48:13 +0000
commit9edf4b08ea07ea699b98b6aba80d2e0d8476ec2d (patch)
tree21260308b55a3e7a3f6f429487272b9554e28d88
parent49deb1dc61b2f8d93209affcdcc98c065bd53b29 (diff)
Test output and sql changes
Change comments on FQS of query as per behavior #59 Separate out an issue #67 from xc_copy
-rw-r--r--src/test/regress/expected/xc_FQS.out8
-rw-r--r--src/test/regress/input/xc_copy.source90
-rw-r--r--src/test/regress/input/xl_bugs.source94
-rw-r--r--src/test/regress/output/xc_copy.source83
-rw-r--r--src/test/regress/output/xl_bugs.source86
-rw-r--r--src/test/regress/parallel_schedule1
-rw-r--r--src/test/regress/sql/xc_FQS.sql8
7 files changed, 189 insertions, 181 deletions
diff --git a/src/test/regress/expected/xc_FQS.out b/src/test/regress/expected/xc_FQS.out
index 016d476b9c..41ec56b786 100644
--- a/src/test/regress/expected/xc_FQS.out
+++ b/src/test/regress/expected/xc_FQS.out
@@ -601,7 +601,7 @@ explain (verbose on, nodes off, costs off) select * from tab1_hash order by val;
Output: val, val2
(7 rows)
--- should not get FQSed because of DISTINCT clause
+-- should get FQSed because DISTINCT clause contains distkey
select distinct val, val2 from tab1_hash where val2 = 8;
val | val2
-----+------
@@ -622,7 +622,7 @@ explain (verbose on, nodes off, costs off) select distinct val, val2 from tab1_h
Filter: (tab1_hash.val2 = 8)
(9 rows)
--- should not get FQSed because of GROUP clause
+-- should get FQSed because GROUP BY clause uses distkey
select val, val2 from tab1_hash where val2 = 8 group by val, val2;
val | val2
-----+------
@@ -1010,7 +1010,7 @@ explain (verbose on, nodes off, costs off) select * from tab1_modulo order by va
Output: val, val2
(7 rows)
--- should not get FQSed because of DISTINCT clause
+-- should get FQSed because DISTINCT clause contains distkey
select distinct val, val2 from tab1_modulo where val2 = 8;
val | val2
-----+------
@@ -1031,7 +1031,7 @@ explain (verbose on, nodes off, costs off) select distinct val, val2 from tab1_m
Filter: (tab1_modulo.val2 = 8)
(9 rows)
--- should not get FQSed because of GROUP clause
+-- should get FQSed because GROUP BY clause uses distkey
select val, val2 from tab1_modulo where val2 = 8 group by val, val2;
val | val2
-----+------
diff --git a/src/test/regress/input/xc_copy.source b/src/test/regress/input/xc_copy.source
index 5079ce8176..2b8a1f813e 100644
--- a/src/test/regress/input/xc_copy.source
+++ b/src/test/regress/input/xc_copy.source
@@ -2,96 +2,6 @@
-- XC_COPY
--
--- COPY tests for a Postgres-XL cluster
-
-create or replace function pgxc_nodetype() returns varchar as
-$$
-declare
- pgxc_class_entries int;
-begin
- select into pgxc_class_entries count(*) from pgxc_class ;
- if pgxc_class_entries > 0 then
- return ' Node type: C';
- else
- return ' Node type: D';
- end if;
-end $$ language plpgsql;
-
-
-create function deffunc() returns bytea as
-$$
-begin
- return E'\\023\\000\\\\''!|''';
-end $$ language plpgsql;
-
-
-create or replace function deffunc_bytea() returns bytea as
-$$
-begin
- return E'\0123';
-end $$ language plpgsql;
-
-create or replace function deffunc_str() returns varchar as
-$$
-begin
- return E'\\.\\000"\\''!|''\\N' || pgxc_nodetype();
-end $$ language plpgsql;
-
-create or replace function deffunc_str_i() returns varchar immutable as
-$$
-begin
- return E'\\.\\000"\\''!|''' || pgxc_nodetype();
-end $$ language plpgsql;
-
-create or replace function deffunc_nullstring() returns varchar as
-$$
-begin
- return E'\\N';
-end $$ language plpgsql;
-
-create table xccopydef(idseq serial, id1 int,
- def1 bytea default deffunc(),
- def2 bytea default E'\\000'::bytea,
- def3 varchar default deffunc_str(),
- def4 varchar default deffunc_str_i(),
- def5 varchar default deffunc_nullstring(),
- def6 bytea default deffunc_bytea(),
- id2 varchar,
- def7 float default length(deffunc_str()) + 0.433);
-
-
-copy xccopydef (id1, id2) from stdin (delimiter '|');
-3 | \\\\x135
-\N| abcd
-\.
-
-copy xccopydef (id1, id2) from stdin (format 'csv');
-3 , \\\\x135
-, abcd
-\.
-
-
-insert into xccopydef (id1, id2) values (NULL, NULL);
-insert into xccopydef (id1) values (4567);
-
-select * from xccopydef order by idseq;
-
-copy xccopydef (id1, id2) to '@abs_builddir@/results/copydefout.data' (format 'binary');
-
-truncate xccopydef;
-
-copy xccopydef (id1, id2) from '@abs_builddir@/results/copydefout.data' (format 'binary');
-
-select * from xccopydef order by idseq;
-
-drop table xccopydef;
-drop function pgxc_nodetype();
-drop function deffunc();
-drop function deffunc_bytea();
-drop function deffunc_str();
-drop function deffunc_str_i();
-drop function deffunc_nullstring();
-
-- Tests related to COPY for a Postgres-XL cluster
-- Create a table not using the first node of cluster
SELECT create_table_nodes('xc_copy_1(a int, b int)', '{2}'::int[], 'replication', NULL);
diff --git a/src/test/regress/input/xl_bugs.source b/src/test/regress/input/xl_bugs.source
new file mode 100644
index 0000000000..db1f0f8730
--- /dev/null
+++ b/src/test/regress/input/xl_bugs.source
@@ -0,0 +1,94 @@
+--
+-- XC_COPY
+--
+
+-- COPY tests for a Postgres-XL cluster
+
+create or replace function pgxc_nodetype() returns varchar as
+$$
+declare
+ pgxc_class_entries int;
+begin
+ select into pgxc_class_entries count(*) from pgxc_class ;
+ if pgxc_class_entries > 0 then
+ return ' Node type: C';
+ else
+ return ' Node type: D';
+ end if;
+end $$ language plpgsql;
+
+
+create function deffunc() returns bytea as
+$$
+begin
+ return E'\\023\\000\\\\''!|''';
+end $$ language plpgsql;
+
+
+create or replace function deffunc_bytea() returns bytea as
+$$
+begin
+ return E'\0123';
+end $$ language plpgsql;
+
+create or replace function deffunc_str() returns varchar as
+$$
+begin
+ return E'\\.\\000"\\''!|''\\N' || pgxc_nodetype();
+end $$ language plpgsql;
+
+create or replace function deffunc_str_i() returns varchar immutable as
+$$
+begin
+ return E'\\.\\000"\\''!|''' || pgxc_nodetype();
+end $$ language plpgsql;
+
+create or replace function deffunc_nullstring() returns varchar as
+$$
+begin
+ return E'\\N';
+end $$ language plpgsql;
+
+create table xccopydef(idseq serial, id1 int,
+ def1 bytea default deffunc(),
+ def2 bytea default E'\\000'::bytea,
+ def3 varchar default deffunc_str(),
+ def4 varchar default deffunc_str_i(),
+ def5 varchar default deffunc_nullstring(),
+ def6 bytea default deffunc_bytea(),
+ id2 varchar,
+ def7 float default length(deffunc_str()) + 0.433);
+
+
+copy xccopydef (id1, id2) from stdin (delimiter '|');
+3 | \\\\x135
+\N| abcd
+\.
+
+copy xccopydef (id1, id2) from stdin (format 'csv');
+3 , \\\\x135
+, abcd
+\.
+
+
+insert into xccopydef (id1, id2) values (NULL, NULL);
+insert into xccopydef (id1) values (4567);
+
+select * from xccopydef order by idseq;
+
+copy xccopydef (id1, id2) to '@abs_builddir@/results/copydefout.data' (format 'binary');
+
+truncate xccopydef;
+
+copy xccopydef (id1, id2) from '@abs_builddir@/results/copydefout.data' (format 'binary');
+
+select * from xccopydef order by idseq;
+
+drop table xccopydef;
+drop function pgxc_nodetype();
+drop function deffunc();
+drop function deffunc_bytea();
+drop function deffunc_str();
+drop function deffunc_str_i();
+drop function deffunc_nullstring();
+
diff --git a/src/test/regress/output/xc_copy.source b/src/test/regress/output/xc_copy.source
index f119354274..f3375376da 100644
--- a/src/test/regress/output/xc_copy.source
+++ b/src/test/regress/output/xc_copy.source
@@ -1,89 +1,6 @@
--
-- XC_COPY
--
--- COPY tests for a Postgres-XL cluster
-create or replace function pgxc_nodetype() returns varchar as
-$$
-declare
- pgxc_class_entries int;
-begin
- select into pgxc_class_entries count(*) from pgxc_class ;
- if pgxc_class_entries > 0 then
- return ' Node type: C';
- else
- return ' Node type: D';
- end if;
-end $$ language plpgsql;
-create function deffunc() returns bytea as
-$$
-begin
- return E'\\023\\000\\\\''!|''';
-end $$ language plpgsql;
-create or replace function deffunc_bytea() returns bytea as
-$$
-begin
- return E'\0123';
-end $$ language plpgsql;
-create or replace function deffunc_str() returns varchar as
-$$
-begin
- return E'\\.\\000"\\''!|''\\N' || pgxc_nodetype();
-end $$ language plpgsql;
-create or replace function deffunc_str_i() returns varchar immutable as
-$$
-begin
- return E'\\.\\000"\\''!|''' || pgxc_nodetype();
-end $$ language plpgsql;
-create or replace function deffunc_nullstring() returns varchar as
-$$
-begin
- return E'\\N';
-end $$ language plpgsql;
-create table xccopydef(idseq serial, id1 int,
- def1 bytea default deffunc(),
- def2 bytea default E'\\000'::bytea,
- def3 varchar default deffunc_str(),
- def4 varchar default deffunc_str_i(),
- def5 varchar default deffunc_nullstring(),
- def6 bytea default deffunc_bytea(),
- id2 varchar,
- def7 float default length(deffunc_str()) + 0.433);
-copy xccopydef (id1, id2) from stdin (delimiter '|');
-copy xccopydef (id1, id2) from stdin (format 'csv');
-insert into xccopydef (id1, id2) values (NULL, NULL);
-insert into xccopydef (id1) values (4567);
-select * from xccopydef order by idseq;
- idseq | id1 | def1 | def2 | def3 | def4 | def5 | def6 | id2 | def7
--------+------+------------------+------+-----------------------------+---------------------------+------+--------+-----------+--------
- 1 | 3 | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | \\x135 | 27.433
- 2 | | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | abcd | 27.433
- 3 | 3 | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | \\\\x135 | 27.433
- 4 | | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | abcd | 27.433
- 5 | | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: C | \N | \x0a33 | | 27.433
- 6 | 4567 | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: C | \N | \x0a33 | | 27.433
-(6 rows)
-
-copy xccopydef (id1, id2) to '@abs_builddir@/results/copydefout.data' (format 'binary');
-truncate xccopydef;
-copy xccopydef (id1, id2) from '@abs_builddir@/results/copydefout.data' (format 'binary');
-select * from xccopydef order by idseq;
- idseq | id1 | def1 | def2 | def3 | def4 | def5 | def6 | id2 | def7
--------+------+------------------+------+-----------------------------+---------------------------+------+--------+-----------+--------
- 7 | 3 | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | \\x135 | 27.433
- 8 | | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | abcd | 27.433
- 9 | 3 | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | \\\\x135 | 27.433
- 10 | | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | abcd | 27.433
- 11 | | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | | 27.433
- 12 | 4567 | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | | 27.433
-(6 rows)
-
-drop table xccopydef;
-drop function pgxc_nodetype();
-drop function deffunc();
-drop function deffunc_bytea();
-drop function deffunc_str();
-drop function deffunc_str_i();
-drop function deffunc_nullstring();
-- Tests related to COPY for a Postgres-XL cluster
-- Create a table not using the first node of cluster
SELECT create_table_nodes('xc_copy_1(a int, b int)', '{2}'::int[], 'replication', NULL);
diff --git a/src/test/regress/output/xl_bugs.source b/src/test/regress/output/xl_bugs.source
new file mode 100644
index 0000000000..ad15fb3aa5
--- /dev/null
+++ b/src/test/regress/output/xl_bugs.source
@@ -0,0 +1,86 @@
+--
+-- XC_COPY
+--
+-- COPY tests for a Postgres-XL cluster
+create or replace function pgxc_nodetype() returns varchar as
+$$
+declare
+ pgxc_class_entries int;
+begin
+ select into pgxc_class_entries count(*) from pgxc_class ;
+ if pgxc_class_entries > 0 then
+ return ' Node type: C';
+ else
+ return ' Node type: D';
+ end if;
+end $$ language plpgsql;
+create function deffunc() returns bytea as
+$$
+begin
+ return E'\\023\\000\\\\''!|''';
+end $$ language plpgsql;
+create or replace function deffunc_bytea() returns bytea as
+$$
+begin
+ return E'\0123';
+end $$ language plpgsql;
+create or replace function deffunc_str() returns varchar as
+$$
+begin
+ return E'\\.\\000"\\''!|''\\N' || pgxc_nodetype();
+end $$ language plpgsql;
+create or replace function deffunc_str_i() returns varchar immutable as
+$$
+begin
+ return E'\\.\\000"\\''!|''' || pgxc_nodetype();
+end $$ language plpgsql;
+create or replace function deffunc_nullstring() returns varchar as
+$$
+begin
+ return E'\\N';
+end $$ language plpgsql;
+create table xccopydef(idseq serial, id1 int,
+ def1 bytea default deffunc(),
+ def2 bytea default E'\\000'::bytea,
+ def3 varchar default deffunc_str(),
+ def4 varchar default deffunc_str_i(),
+ def5 varchar default deffunc_nullstring(),
+ def6 bytea default deffunc_bytea(),
+ id2 varchar,
+ def7 float default length(deffunc_str()) + 0.433);
+copy xccopydef (id1, id2) from stdin (delimiter '|');
+copy xccopydef (id1, id2) from stdin (format 'csv');
+insert into xccopydef (id1, id2) values (NULL, NULL);
+insert into xccopydef (id1) values (4567);
+select * from xccopydef order by idseq;
+ idseq | id1 | def1 | def2 | def3 | def4 | def5 | def6 | id2 | def7
+-------+------+------------------+------+-----------------------------+---------------------------+------+--------+-----------+--------
+ 1 | 3 | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | \\x135 | 27.433
+ 2 | | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | abcd | 27.433
+ 3 | 3 | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | \\\\x135 | 27.433
+ 4 | | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | abcd | 27.433
+ 5 | | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: C | \N | \x0a33 | | 27.433
+ 6 | 4567 | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: C | \N | \x0a33 | | 27.433
+(6 rows)
+
+copy xccopydef (id1, id2) to '@abs_builddir@/results/copydefout.data' (format 'binary');
+truncate xccopydef;
+copy xccopydef (id1, id2) from '@abs_builddir@/results/copydefout.data' (format 'binary');
+select * from xccopydef order by idseq;
+ idseq | id1 | def1 | def2 | def3 | def4 | def5 | def6 | id2 | def7
+-------+------+------------------+------+-----------------------------+---------------------------+------+--------+-----------+--------
+ 7 | 3 | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | \\x135 | 27.433
+ 8 | | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | abcd | 27.433
+ 9 | 3 | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | \\\\x135 | 27.433
+ 10 | | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | abcd | 27.433
+ 11 | | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | | 27.433
+ 12 | 4567 | \x13005c27217c27 | \x00 | \.\000"\'!|'\N Node type: C | \.\000"\'!|' Node type: D | \N | \x0a33 | | 27.433
+(6 rows)
+
+drop table xccopydef;
+drop function pgxc_nodetype();
+drop function deffunc();
+drop function deffunc_bytea();
+drop function deffunc_str();
+drop function deffunc_str_i();
+drop function deffunc_nullstring();
diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule
index 2bad0ff1a5..a7ec482c58 100644
--- a/src/test/regress/parallel_schedule
+++ b/src/test/regress/parallel_schedule
@@ -140,4 +140,5 @@ test: xc_notrans_block
test: xl_primary_key xl_foreign_key xl_distribution_column_types xl_alter_table xl_distribution_column_types_modulo xl_plan_pushdown xl_functions xl_limitations xl_user_defined_functions xl_join
#known bugs
+test: xl_bugs
test: xl_known_bugs
diff --git a/src/test/regress/sql/xc_FQS.sql b/src/test/regress/sql/xc_FQS.sql
index ef1e9dc21c..cc488b8ea7 100644
--- a/src/test/regress/sql/xc_FQS.sql
+++ b/src/test/regress/sql/xc_FQS.sql
@@ -133,10 +133,10 @@ explain (verbose on, nodes off, costs off) select * from tab1_hash where val2 =
-- should not get FQSed because of SORT clause
select * from tab1_hash order by val;
explain (verbose on, nodes off, costs off) select * from tab1_hash order by val;
--- should not get FQSed because of DISTINCT clause
+-- should get FQSed because DISTINCT clause contains distkey
select distinct val, val2 from tab1_hash where val2 = 8;
explain (verbose on, nodes off, costs off) select distinct val, val2 from tab1_hash where val2 = 8;
--- should not get FQSed because of GROUP clause
+-- should get FQSed because GROUP BY clause uses distkey
select val, val2 from tab1_hash where val2 = 8 group by val, val2;
explain (verbose on, nodes off, costs off) select val, val2 from tab1_hash where val2 = 8 group by val, val2;
-- should not get FQSed because of HAVING clause
@@ -198,10 +198,10 @@ explain (verbose on, nodes off, costs off) select * from tab1_modulo where val2
-- should not get FQSed because of SORT clause
select * from tab1_modulo order by val;
explain (verbose on, nodes off, costs off) select * from tab1_modulo order by val;
--- should not get FQSed because of DISTINCT clause
+-- should get FQSed because DISTINCT clause contains distkey
select distinct val, val2 from tab1_modulo where val2 = 8;
explain (verbose on, nodes off, costs off) select distinct val, val2 from tab1_modulo where val2 = 8;
--- should not get FQSed because of GROUP clause
+-- should get FQSed because GROUP BY clause uses distkey
select val, val2 from tab1_modulo where val2 = 8 group by val, val2;
explain (verbose on, nodes off, costs off) select val, val2 from tab1_modulo where val2 = 8 group by val, val2;
-- should not get FQSed because of HAVING clause