提交 535a88e8 编写于 作者: H Heikki Linnakangas

Rename test tables to avoid clashing with other tests.

'bar' and 'person' are dangerously generic, and clashed with the
'olap_window_seq' test and some others. And 'hobbies_r' is part of the
PostgreSQL tests, created in 'create_table' test. Rename all the tests
tables using the distpol_ prefix, to be safe.
上级 78a9d400
......@@ -13,20 +13,16 @@ select attrnums from gp_distribution_policy where localoid = 'distpol'::regclass
(1 row)
-- Test RANDOM default distribution with AS clause containing a SELECT block
DROP TABLE IF EXISTS hobbies_r;
NOTICE: table "hobbies_r" does not exist, skipping
CREATE TABLE hobbies_r (
CREATE TABLE distpol_hobbies_r (
name text,
person text
);
NOTICE: Using default RANDOM distribution since no distribution was specified.
HINT: Consider including the 'DISTRIBUTED BY' clause to determine the distribution of rows.
DROP TABLE IF EXISTS bar;
NOTICE: table "bar" does not exist, skipping
CREATE TABLE bar AS SELECT * FROM hobbies_r;
CREATE TABLE distpol_bar AS SELECT * FROM distpol_hobbies_r;
NOTICE: Using default RANDOM distribution since no distribution was specified.
HINT: Consider including the 'DISTRIBUTED BY' clause to determine the distribution of rows.
select attrnums from gp_distribution_policy where localoid='bar'::regclass;
select attrnums from gp_distribution_policy where localoid='distpol_bar'::regclass;
attrnums
----------
......@@ -65,44 +61,42 @@ end;
RESET gp_create_table_random_default_distribution;
-- Test that distribution policy is not inherited and it is RANDOM in CREATE TABLE with default distribution set to random
SET gp_create_table_random_default_distribution=on;
DROP TABLE IF EXISTS person CASCADE;
NOTICE: table "person" does not exist, skipping
CREATE TABLE person (
CREATE TABLE distpol_person (
name text,
age int4,
location point
) DISTRIBUTED BY (name);
CREATE TABLE staff_member (
CREATE TABLE distpol_staff_member (
salary int4,
manager name
) INHERITS (person) WITH OIDS;
) INHERITS (distpol_person) WITH OIDS;
NOTICE: Table has parent, setting distribution columns to match parent table
NOTICE: OIDS=TRUE is not recommended for user-created tables. Use OIDS=FALSE to prevent wrap-around of the OID counter
select attrnums from gp_distribution_policy where localoid = 'staff_member'::regclass;
select attrnums from gp_distribution_policy where localoid = 'distpol_staff_member'::regclass;
attrnums
----------
{1}
(1 row)
CREATE TABLE student (
CREATE TABLE distpol_student (
gpa float8
) INHERITS (person);
) INHERITS (distpol_person);
NOTICE: Table has parent, setting distribution columns to match parent table
select attrnums from gp_distribution_policy where localoid = 'student'::regclass;
select attrnums from gp_distribution_policy where localoid = 'distpol_student'::regclass;
attrnums
----------
{1}
(1 row)
CREATE TABLE stud_emp (
CREATE TABLE distpol_stud_emp (
percent int4
) INHERITS (staff_member, student);
) INHERITS (distpol_staff_member, distpol_student);
NOTICE: Table has parent, setting distribution columns to match parent table
NOTICE: merging multiple inherited definitions of column "name"
NOTICE: merging multiple inherited definitions of column "age"
NOTICE: merging multiple inherited definitions of column "location"
NOTICE: OIDS=TRUE is not recommended for user-created tables. Use OIDS=FALSE to prevent wrap-around of the OID counter
select attrnums from gp_distribution_policy where localoid = 'stud_emp'::regclass;
select attrnums from gp_distribution_policy where localoid = 'distpol_stud_emp'::regclass;
attrnums
----------
{1}
......@@ -112,24 +106,22 @@ RESET gp_create_table_random_default_distribution;
-- Test that LIKE clause does not affect default distribution
SET gp_create_table_random_default_distribution=on;
set client_min_messages='warning';
DROP TABLE IF EXISTS person CASCADE;
DROP TABLE IF EXISTS distpol_person CASCADE;
reset client_min_messages;
CREATE TABLE person (
CREATE TABLE distpol_person (
name text,
age int4,
location point
) DISTRIBUTED BY (name);
select attrnums from gp_distribution_policy where localoid = 'person'::regclass;
select attrnums from gp_distribution_policy where localoid = 'distpol_person'::regclass;
attrnums
----------
{1}
(1 row)
DROP TABLE IF EXISTS person_copy;
NOTICE: table "person_copy" does not exist, skipping
CREATE TABLE person_copy (LIKE person);
CREATE TABLE distpol_person_copy (LIKE distpol_person);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause, defaulting to distribution columns from LIKE table
select attrnums from gp_distribution_policy where localoid = 'person_copy'::regclass;
select attrnums from gp_distribution_policy where localoid = 'distpol_person_copy'::regclass;
attrnums
----------
{1}
......
......@@ -13,19 +13,15 @@ select attrnums from gp_distribution_policy where localoid = 'distpol'::regclass
(1 row)
-- Test RANDOM default distribution with AS clause containing a SELECT block
DROP TABLE IF EXISTS hobbies_r;
NOTICE: table "hobbies_r" does not exist, skipping
CREATE TABLE hobbies_r (
CREATE TABLE distpol_hobbies_r (
name text,
person text
);
NOTICE: Using default RANDOM distribution since no distribution was specified.
HINT: Consider including the 'DISTRIBUTED BY' clause to determine the distribution of rows.
DROP TABLE IF EXISTS bar;
NOTICE: table "bar" does not exist, skipping
CREATE TABLE bar AS SELECT * FROM hobbies_r;
CREATE TABLE distpol_bar AS SELECT * FROM distpol_hobbies_r;
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause. Creating a NULL policy entry.
select attrnums from gp_distribution_policy where localoid='bar'::regclass;
select attrnums from gp_distribution_policy where localoid='distpol_bar'::regclass;
attrnums
----------
......@@ -61,44 +57,42 @@ end;
RESET gp_create_table_random_default_distribution;
-- Test that distribution policy is not inherited and it is RANDOM in CREATE TABLE with default distribution set to random
SET gp_create_table_random_default_distribution=on;
DROP TABLE IF EXISTS person CASCADE;
NOTICE: table "person" does not exist, skipping
CREATE TABLE person (
CREATE TABLE distpol_person (
name text,
age int4,
location point
) DISTRIBUTED BY (name);
CREATE TABLE staff_member (
CREATE TABLE distpol_staff_member (
salary int4,
manager name
) INHERITS (person) WITH OIDS;
) INHERITS (distpol_person) WITH OIDS;
NOTICE: Table has parent, setting distribution columns to match parent table
NOTICE: OIDS=TRUE is not recommended for user-created tables. Use OIDS=FALSE to prevent wrap-around of the OID counter
select attrnums from gp_distribution_policy where localoid = 'staff_member'::regclass;
select attrnums from gp_distribution_policy where localoid = 'distpol_staff_member'::regclass;
attrnums
----------
{1}
(1 row)
CREATE TABLE student (
CREATE TABLE distpol_student (
gpa float8
) INHERITS (person);
) INHERITS (distpol_person);
NOTICE: Table has parent, setting distribution columns to match parent table
select attrnums from gp_distribution_policy where localoid = 'student'::regclass;
select attrnums from gp_distribution_policy where localoid = 'distpol_student'::regclass;
attrnums
----------
{1}
(1 row)
CREATE TABLE stud_emp (
CREATE TABLE distpol_stud_emp (
percent int4
) INHERITS (staff_member, student);
) INHERITS (distpol_staff_member, distpol_student);
NOTICE: Table has parent, setting distribution columns to match parent table
NOTICE: merging multiple inherited definitions of column "name"
NOTICE: merging multiple inherited definitions of column "age"
NOTICE: merging multiple inherited definitions of column "location"
NOTICE: OIDS=TRUE is not recommended for user-created tables. Use OIDS=FALSE to prevent wrap-around of the OID counter
select attrnums from gp_distribution_policy where localoid = 'stud_emp'::regclass;
select attrnums from gp_distribution_policy where localoid = 'distpol_stud_emp'::regclass;
attrnums
----------
{1}
......@@ -108,24 +102,22 @@ RESET gp_create_table_random_default_distribution;
-- Test that LIKE clause does not affect default distribution
SET gp_create_table_random_default_distribution=on;
set client_min_messages='warning';
DROP TABLE IF EXISTS person CASCADE;
DROP TABLE IF EXISTS distpol_person CASCADE;
reset client_min_messages;
CREATE TABLE person (
CREATE TABLE distpol_person (
name text,
age int4,
location point
) DISTRIBUTED BY (name);
select attrnums from gp_distribution_policy where localoid = 'person'::regclass;
select attrnums from gp_distribution_policy where localoid = 'distpol_person'::regclass;
attrnums
----------
{1}
(1 row)
DROP TABLE IF EXISTS person_copy;
NOTICE: table "person_copy" does not exist, skipping
CREATE TABLE person_copy (LIKE person);
CREATE TABLE distpol_person_copy (LIKE distpol_person);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause, defaulting to distribution columns from LIKE table
select attrnums from gp_distribution_policy where localoid = 'person_copy'::regclass;
select attrnums from gp_distribution_policy where localoid = 'distpol_person_copy'::regclass;
attrnums
----------
{1}
......
......@@ -10,16 +10,14 @@ select attrnums from gp_distribution_policy where localoid = 'distpol'::regclass
-- Test RANDOM default distribution with AS clause containing a SELECT block
DROP TABLE IF EXISTS hobbies_r;
CREATE TABLE hobbies_r (
CREATE TABLE distpol_hobbies_r (
name text,
person text
);
DROP TABLE IF EXISTS bar;
CREATE TABLE bar AS SELECT * FROM hobbies_r;
CREATE TABLE distpol_bar AS SELECT * FROM distpol_hobbies_r;
select attrnums from gp_distribution_policy where localoid='bar'::regclass;
select attrnums from gp_distribution_policy where localoid='distpol_bar'::regclass;
-- Test RANDOM distribution with ON COMMIT option
begin;
......@@ -39,45 +37,43 @@ RESET gp_create_table_random_default_distribution;
-- Test that distribution policy is not inherited and it is RANDOM in CREATE TABLE with default distribution set to random
SET gp_create_table_random_default_distribution=on;
DROP TABLE IF EXISTS person CASCADE;
CREATE TABLE person (
CREATE TABLE distpol_person (
name text,
age int4,
location point
) DISTRIBUTED BY (name);
CREATE TABLE staff_member (
CREATE TABLE distpol_staff_member (
salary int4,
manager name
) INHERITS (person) WITH OIDS;
select attrnums from gp_distribution_policy where localoid = 'staff_member'::regclass;
) INHERITS (distpol_person) WITH OIDS;
select attrnums from gp_distribution_policy where localoid = 'distpol_staff_member'::regclass;
CREATE TABLE student (
CREATE TABLE distpol_student (
gpa float8
) INHERITS (person);
select attrnums from gp_distribution_policy where localoid = 'student'::regclass;
) INHERITS (distpol_person);
select attrnums from gp_distribution_policy where localoid = 'distpol_student'::regclass;
CREATE TABLE stud_emp (
CREATE TABLE distpol_stud_emp (
percent int4
) INHERITS (staff_member, student);
select attrnums from gp_distribution_policy where localoid = 'stud_emp'::regclass;
) INHERITS (distpol_staff_member, distpol_student);
select attrnums from gp_distribution_policy where localoid = 'distpol_stud_emp'::regclass;
RESET gp_create_table_random_default_distribution;
-- Test that LIKE clause does not affect default distribution
SET gp_create_table_random_default_distribution=on;
set client_min_messages='warning';
DROP TABLE IF EXISTS person CASCADE;
DROP TABLE IF EXISTS distpol_person CASCADE;
reset client_min_messages;
CREATE TABLE person (
CREATE TABLE distpol_person (
name text,
age int4,
location point
) DISTRIBUTED BY (name);
select attrnums from gp_distribution_policy where localoid = 'person'::regclass;
select attrnums from gp_distribution_policy where localoid = 'distpol_person'::regclass;
DROP TABLE IF EXISTS person_copy;
CREATE TABLE person_copy (LIKE person);
select attrnums from gp_distribution_policy where localoid = 'person_copy'::regclass;
CREATE TABLE distpol_person_copy (LIKE distpol_person);
select attrnums from gp_distribution_policy where localoid = 'distpol_person_copy'::regclass;
RESET gp_create_table_random_default_distribution;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册