Skip to content

Commit 592addf

Browse files
committed
The single node test using planner has been fixed
1 parent fdd5a32 commit 592addf

File tree

15 files changed

+586
-719
lines changed

15 files changed

+586
-719
lines changed

src/test/singlenode_regress/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,22 @@ clean distclean:
3838
## Run tests
3939
##
4040

41-
REGRESS_OPTS = --dlpath=. --max-concurrent-tests=24 --init-file=$(srcdir)/init_file --make-testtablespace-dir \
41+
REGRESS_OPTS = --dlpath=. --max-concurrent-tests=24 --init-file=$(srcdir)/init_file \
4242
$(EXTRA_REGRESS_OPTS)
43+
tablespace-setup:
44+
rm -rf ./testtablespace
45+
mkdir -p ./testtablespace
4346

4447
installcheck-singlenode: installcheck-good-singlenode
4548

46-
installcheck-small-singlenode: all
49+
installcheck-small-singlenode: all tablespace-setup
4750
(\
4851
gpconfig -c gp_appendonly_insert_files -v 0; \
4952
gpstop -u; \
5053
$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(EXTRA_TESTS) \
5154
)
5255

53-
installcheck-good-singlenode: all
56+
installcheck-good-singlenode: all tablespace-setup
5457
(\
5558
gpconfig -c gp_appendonly_insert_files -v 0; \
5659
gpstop -u; \

src/test/singlenode_regress/expected/cluster.out

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,6 @@ CREATE INDEX clstrpart_idx ON clstrpart (a);
448448
ALTER TABLE clstrpart CLUSTER ON clstrpart_idx;
449449
ERROR: cannot mark index clustered in partitioned table
450450
CLUSTER clstrpart USING clstrpart_idx;
451-
ERROR: cannot cluster a partitioned table
452451
DROP TABLE clstrpart;
453452
-- Test CLUSTER with external tuplesorting
454453
create table clstr_4 as select * from tenk1;

src/test/singlenode_regress/expected/collate.icu.utf8_1.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
/* skip test if not UTF8 server encoding or no ICU collations installed */
55
SELECT getdatabaseencoding() <> 'UTF8' OR
6-
(SELECT count(*) FROM pg_collation WHERE collprovider = 'i') = 0
6+
(SELECT count(*) FROM pg_collation WHERE collprovider = 'i' AND collname <> 'unicode') = 0
77
AS skip_test \gset
88
\if :skip_test
99
\quit

src/test/singlenode_regress/expected/create_view.out

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,6 @@ set Debug_print_plan=on;
88
-- Virtual class definitions
99
-- (this also tests the query rewrite system)
1010
--
11-
-- directory paths and dlsuffix are passed to us in environment variables
12-
\getenv abs_srcdir PG_ABS_SRCDIR
13-
\getenv libdir PG_LIBDIR
14-
\getenv dlsuffix PG_DLSUFFIX
15-
\set regresslib :libdir '/regress' :dlsuffix
16-
CREATE FUNCTION interpt_pp(path, path)
17-
RETURNS point
18-
AS :'regresslib'
19-
LANGUAGE C STRICT;
20-
CREATE TABLE real_city (
21-
pop int4,
22-
cname text,
23-
outline path
24-
);
25-
\set filename :abs_srcdir '/data/real_city.data'
26-
COPY real_city FROM :'filename';
27-
ANALYZE real_city;
28-
SELECT *
29-
INTO TABLE ramp
30-
FROM ONLY road
31-
WHERE name ~ '.*Ramp';
3211
CREATE VIEW street AS
3312
SELECT r.name, r.thepath, c.cname AS cname
3413
FROM ONLY road r, real_city c
@@ -1876,14 +1855,13 @@ select pg_get_viewdef('tt18v', true);
18761855
(1 row)
18771856

18781857
explain (costs off) select * from tt18v;
1879-
QUERY PLAN
1880-
--------------------------------------------------------------------------------------------------
1881-
Gather Motion 3:1 (slice1; segments: 3)
1882-
-> Append
1883-
-> Seq Scan on int8_tbl xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1884-
-> Seq Scan on int8_tbl xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_1
1858+
QUERY PLAN
1859+
--------------------------------------------------------------------------------------------
1860+
Append
1861+
-> Seq Scan on int8_tbl xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1862+
-> Seq Scan on int8_tbl xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_1
18851863
Optimizer: Postgres query optimizer
1886-
(5 rows)
1864+
(4 rows)
18871865

18881866
-- check display of ScalarArrayOp with a sub-select
18891867
select 'foo'::text = any(array['abc','def','foo']::text[]);
@@ -2166,7 +2144,7 @@ select * from tt24v;
21662144
Hash Join
21672145
Output: (share0_ref1.r).column2, ((ROW("*VALUES*_1".column1, "*VALUES*_1".column2))).column2
21682146
Hash Cond: ((share0_ref1.r).column1 = ((ROW("*VALUES*_1".column1, "*VALUES*_1".column2))).column1)
2169-
-> Shared Scan (share slice:id 0:0)
2147+
-> Shared Scan (share slice:id -1:0)
21702148
Output: share0_ref1.r
21712149
-> Values Scan on "*VALUES*"
21722150
Output: ROW("*VALUES*".column1, "*VALUES*".column2)

src/test/singlenode_regress/expected/dependency.out

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,16 @@ SET SESSION AUTHORIZATION regress_dep_user0;
4848
-- permission denied
4949
DROP OWNED BY regress_dep_user1;
5050
ERROR: permission denied to drop objects
51+
DETAIL: Only roles with privileges of role "regress_dep_user1" may drop objects owned by it.
5152
DROP OWNED BY regress_dep_user0, regress_dep_user2;
5253
ERROR: permission denied to drop objects
54+
DETAIL: Only roles with privileges of role "regress_dep_user2" may drop objects owned by it.
5355
REASSIGN OWNED BY regress_dep_user0 TO regress_dep_user1;
5456
ERROR: permission denied to reassign objects
57+
DETAIL: Only roles with privileges of role "regress_dep_user1" may reassign objects to it.
5558
REASSIGN OWNED BY regress_dep_user1 TO regress_dep_user0;
5659
ERROR: permission denied to reassign objects
60+
DETAIL: Only roles with privileges of role "regress_dep_user1" may reassign objects owned by it.
5761
-- this one is allowed
5862
DROP OWNED BY regress_dep_user0;
5963
CREATE TABLE deptest1 (f1 int unique);

src/test/singlenode_regress/expected/foreign_data.out

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ CREATE FOREIGN DATA WRAPPER test_fdw HANDLER invalid_fdw_handler; -- ERROR
109109
ERROR: function invalid_fdw_handler must return type fdw_handler
110110
CREATE FOREIGN DATA WRAPPER test_fdw HANDLER test_fdw_handler HANDLER invalid_fdw_handler; -- ERROR
111111
ERROR: conflicting or redundant options
112+
LINE 1: ...GN DATA WRAPPER test_fdw HANDLER test_fdw_handler HANDLER in...
113+
^
112114
CREATE FOREIGN DATA WRAPPER test_fdw HANDLER test_fdw_handler;
113115
DROP FOREIGN DATA WRAPPER test_fdw;
114116
-- ALTER FOREIGN DATA WRAPPER
@@ -215,6 +217,8 @@ ALTER FOREIGN DATA WRAPPER foo HANDLER invalid_fdw_handler; -- ERROR
215217
ERROR: function invalid_fdw_handler must return type fdw_handler
216218
ALTER FOREIGN DATA WRAPPER foo HANDLER test_fdw_handler HANDLER anything; -- ERROR
217219
ERROR: conflicting or redundant options
220+
LINE 1: ...FOREIGN DATA WRAPPER foo HANDLER test_fdw_handler HANDLER an...
221+
^
218222
ALTER FOREIGN DATA WRAPPER foo HANDLER test_fdw_handler;
219223
WARNING: changing the foreign-data wrapper handler can change behavior of existing foreign tables
220224
DROP FUNCTION invalid_fdw_handler();
@@ -328,7 +332,6 @@ CREATE SERVER s6 VERSION '16.0' FOREIGN DATA WRAPPER foo OPTIONS (host 'a', dbna
328332
CREATE SERVER s7 TYPE 'oracle' VERSION '17.0' FOREIGN DATA WRAPPER foo OPTIONS (host 'a', dbname 'b');
329333
CREATE SERVER s8 FOREIGN DATA WRAPPER postgresql OPTIONS (foo '1'); -- ERROR
330334
ERROR: invalid option "foo"
331-
HINT: Valid options in this context are: authtype, service, connect_timeout, dbname, host, hostaddr, port, tty, options, requiressl, sslmode, gsslib
332335
CREATE SERVER s8 FOREIGN DATA WRAPPER postgresql OPTIONS (host 'localhost', dbname 's8db');
333336
\des+ :NO_BUILTINS
334337
List of foreign servers
@@ -439,11 +442,10 @@ ERROR: permission denied for foreign-data wrapper foo
439442
RESET ROLE;
440443
ALTER SERVER s8 OPTIONS (foo '1'); -- ERROR option validation
441444
ERROR: invalid option "foo"
442-
HINT: Valid options in this context are: authtype, service, connect_timeout, dbname, host, hostaddr, port, tty, options, requiressl, sslmode, gsslib
443445
ALTER SERVER s8 OPTIONS (connect_timeout '30', SET dbname 'db1', DROP host);
444446
SET ROLE regress_test_role;
445447
ALTER SERVER s1 OWNER TO regress_test_indirect; -- ERROR
446-
ERROR: must be member of role "regress_test_indirect"
448+
ERROR: must be able to SET ROLE "regress_test_indirect"
447449
RESET ROLE;
448450
GRANT regress_test_indirect TO regress_test_role;
449451
SET ROLE regress_test_role;
@@ -596,7 +598,7 @@ ERROR: user mapping for "regress_foreign_data_user" already exists for server "
596598
CREATE USER MAPPING FOR public SERVER s4 OPTIONS ("this mapping" 'is public');
597599
CREATE USER MAPPING FOR user SERVER s8 OPTIONS (username 'test', password 'secret'); -- ERROR
598600
ERROR: invalid option "username"
599-
HINT: Valid options in this context are: user, password
601+
HINT: Perhaps you meant the option "user".
600602
CREATE USER MAPPING FOR user SERVER s8 OPTIONS (user 'test', password 'secret');
601603
ALTER SERVER s5 OWNER TO regress_test_role;
602604
ALTER SERVER s6 OWNER TO regress_test_indirect;
@@ -635,7 +637,7 @@ ALTER USER MAPPING FOR public SERVER s5 OPTIONS (gotcha 'true'); -- E
635637
ERROR: user mapping for "public" does not exist for server "s5"
636638
ALTER USER MAPPING FOR current_user SERVER s8 OPTIONS (username 'test'); -- ERROR
637639
ERROR: invalid option "username"
638-
HINT: Valid options in this context are: user, password
640+
HINT: Perhaps you meant the option "user".
639641
ALTER USER MAPPING FOR current_user SERVER s8 OPTIONS (DROP user, SET password 'public');
640642
SET ROLE regress_test_role;
641643
ALTER USER MAPPING FOR current_user SERVER s5 OPTIONS (ADD modified '1');
@@ -754,7 +756,8 @@ FDW options: (delimiter ',', quote '"', "be quoted" 'value')
754756
(1 row)
755757

756758
CREATE INDEX id_ft1_c2 ON ft1 (c2); -- ERROR
757-
ERROR: cannot create index on foreign table "ft1"
759+
ERROR: cannot create index on relation "ft1"
760+
DETAIL: This operation is not supported for foreign tables.
758761
SELECT * FROM ft1; -- ERROR
759762
ERROR: foreign-data wrapper "dummy" has no handler
760763
EXPLAIN SELECT * FROM ft1; -- ERROR
@@ -878,7 +881,8 @@ LINE 1: ALTER FOREIGN TABLE ft1 ADD PRIMARY KEY (c7);
878881
^
879882
ALTER FOREIGN TABLE ft1 ADD CONSTRAINT ft1_c9_check CHECK (c9 < 0) NOT VALID;
880883
ALTER FOREIGN TABLE ft1 ALTER CONSTRAINT ft1_c9_check DEFERRABLE; -- ERROR
881-
ERROR: "ft1" is not a table
884+
ERROR: ALTER action ALTER CONSTRAINT cannot be performed on relation "ft1"
885+
DETAIL: This operation is not supported for foreign tables.
882886
ALTER FOREIGN TABLE ft1 DROP CONSTRAINT ft1_c9_check;
883887
ALTER FOREIGN TABLE ft1 DROP CONSTRAINT no_const; -- ERROR
884888
ERROR: constraint "no_const" of relation "ft1" does not exist
@@ -895,7 +899,8 @@ ALTER FOREIGN TABLE ft1 SET SCHEMA foreign_schema;
895899
ALTER FOREIGN TABLE ft1 SET TABLESPACE ts; -- ERROR
896900
ERROR: relation "ft1" does not exist
897901
ALTER FOREIGN TABLE foreign_schema.ft1 SET TABLESPACE ts; -- ERROR
898-
ERROR: "ft1" is not a table, materialized view, index, or partitioned index
902+
ERROR: ALTER action SET TABLESPACE cannot be performed on relation "ft1"
903+
DETAIL: This operation is not supported for foreign tables.
899904
ALTER FOREIGN TABLE foreign_schema.ft1 RENAME c1 TO foreign_column_1;
900905
ALTER FOREIGN TABLE foreign_schema.ft1 RENAME TO foreign_table_1;
901906
\d foreign_schema.foreign_table_1
@@ -1411,7 +1416,7 @@ CREATE FOREIGN TABLE ft2 () INHERITS (fd_pt1)
14111416
c1 | integer | | not null | | plain | |
14121417
c2 | text | | | | extended | |
14131418
c3 | date | | | | plain | |
1414-
Child tables: ft2
1419+
Child tables: ft2, FOREIGN
14151420

14161421
\d+ ft2
14171422
Foreign table "public.ft2"
@@ -1456,7 +1461,7 @@ ALTER FOREIGN TABLE ft2 INHERIT fd_pt1;
14561461
c1 | integer | | not null | | plain | |
14571462
c2 | text | | | | extended | |
14581463
c3 | date | | | | plain | |
1459-
Child tables: ft2
1464+
Child tables: ft2, FOREIGN
14601465

14611466
\d+ ft2
14621467
Foreign table "public.ft2"
@@ -1491,7 +1496,7 @@ NOTICE: merging column "c3" with inherited definition
14911496
Server: s0
14921497
FDW options: (delimiter ',', quote '"', "be quoted" 'value')
14931498
Inherits: fd_pt1
1494-
Child tables: ft3
1499+
Child tables: ft3, FOREIGN
14951500

14961501
-- start_ignore
14971502
-- GPDB: ct3 is not created.
@@ -1525,7 +1530,7 @@ ALTER TABLE fd_pt1 ADD COLUMN c8 integer;
15251530
c6 | integer | | | | plain | |
15261531
c7 | integer | | not null | | plain | |
15271532
c8 | integer | | | | plain | |
1528-
Child tables: ft2
1533+
Child tables: ft2, FOREIGN
15291534

15301535
\d+ ft2
15311536
Foreign table "public.ft2"
@@ -1542,7 +1547,7 @@ Child tables: ft2
15421547
Server: s0
15431548
FDW options: (delimiter ',', quote '"', "be quoted" 'value')
15441549
Inherits: fd_pt1
1545-
Child tables: ft3
1550+
Child tables: ft3, FOREIGN
15461551

15471552
-- start_ignore
15481553
-- GPDB: ct3 is not created.
@@ -1588,7 +1593,7 @@ ALTER TABLE fd_pt1 ALTER COLUMN c8 SET STORAGE EXTERNAL;
15881593
c6 | integer | | not null | | plain | |
15891594
c7 | integer | | | | plain | |
15901595
c8 | text | | | | external | |
1591-
Child tables: ft2
1596+
Child tables: ft2, FOREIGN
15921597

15931598
\d+ ft2
15941599
Foreign table "public.ft2"
@@ -1605,7 +1610,7 @@ Child tables: ft2
16051610
Server: s0
16061611
FDW options: (delimiter ',', quote '"', "be quoted" 'value')
16071612
Inherits: fd_pt1
1608-
Child tables: ft3
1613+
Child tables: ft3, FOREIGN
16091614

16101615
-- drop attributes recursively
16111616
ALTER TABLE fd_pt1 DROP COLUMN c4;
@@ -1620,7 +1625,7 @@ ALTER TABLE fd_pt1 DROP COLUMN c8;
16201625
c1 | integer | | not null | | plain | 10000 |
16211626
c2 | text | | | | extended | |
16221627
c3 | date | | | | plain | |
1623-
Child tables: ft2
1628+
Child tables: ft2, FOREIGN
16241629

16251630
\d+ ft2
16261631
Foreign table "public.ft2"
@@ -1632,7 +1637,7 @@ Child tables: ft2
16321637
Server: s0
16331638
FDW options: (delimiter ',', quote '"', "be quoted" 'value')
16341639
Inherits: fd_pt1
1635-
Child tables: ft3
1640+
Child tables: ft3, FOREIGN
16361641

16371642
-- add constraints recursively
16381643
ALTER TABLE fd_pt1 ADD CONSTRAINT fd_pt1chk1 CHECK (c1 > 0) NO INHERIT;
@@ -1659,7 +1664,7 @@ SELECT relname, conname, contype, conislocal, coninhcount, connoinherit
16591664
Check constraints:
16601665
"fd_pt1chk1" CHECK (c1 > 0) NO INHERIT
16611666
"fd_pt1chk2" CHECK (c2 <> ''::text)
1662-
Child tables: ft2
1667+
Child tables: ft2, FOREIGN
16631668

16641669
\d+ ft2
16651670
Foreign table "public.ft2"
@@ -1673,7 +1678,7 @@ Check constraints:
16731678
Server: s0
16741679
FDW options: (delimiter ',', quote '"', "be quoted" 'value')
16751680
Inherits: fd_pt1
1676-
Child tables: ft3
1681+
Child tables: ft3, FOREIGN
16771682

16781683
DROP FOREIGN TABLE ft2; -- ERROR
16791684
ERROR: cannot drop foreign table ft2 because other objects depend on it
@@ -1702,7 +1707,7 @@ ALTER FOREIGN TABLE ft2 INHERIT fd_pt1;
17021707
Check constraints:
17031708
"fd_pt1chk1" CHECK (c1 > 0) NO INHERIT
17041709
"fd_pt1chk2" CHECK (c2 <> ''::text)
1705-
Child tables: ft2
1710+
Child tables: ft2, FOREIGN
17061711

17071712
\d+ ft2
17081713
Foreign table "public.ft2"
@@ -1733,7 +1738,7 @@ ALTER TABLE fd_pt1 ADD CONSTRAINT fd_pt1chk3 CHECK (c2 <> '') NOT VALID;
17331738
c3 | date | | | | plain | |
17341739
Check constraints:
17351740
"fd_pt1chk3" CHECK (c2 <> ''::text) NOT VALID
1736-
Child tables: ft2
1741+
Child tables: ft2, FOREIGN
17371742

17381743
\d+ ft2
17391744
Foreign table "public.ft2"
@@ -1760,7 +1765,7 @@ ALTER TABLE fd_pt1 VALIDATE CONSTRAINT fd_pt1chk3;
17601765
c3 | date | | | | plain | |
17611766
Check constraints:
17621767
"fd_pt1chk3" CHECK (c2 <> ''::text)
1763-
Child tables: ft2
1768+
Child tables: ft2, FOREIGN
17641769

17651770
\d+ ft2
17661771
Foreign table "public.ft2"
@@ -1791,7 +1796,7 @@ ALTER TABLE fd_pt1 RENAME CONSTRAINT fd_pt1chk3 TO f2_check;
17911796
f3 | date | | | | plain | |
17921797
Check constraints:
17931798
"f2_check" CHECK (f2 <> ''::text)
1794-
Child tables: ft2
1799+
Child tables: ft2, FOREIGN
17951800

17961801
\d+ ft2
17971802
Foreign table "public.ft2"
@@ -1854,7 +1859,7 @@ CREATE FOREIGN TABLE fd_pt2_1 PARTITION OF fd_pt2 FOR VALUES IN (1)
18541859
c2 | text | | | | extended | |
18551860
c3 | date | | | | plain | |
18561861
Partition key: LIST (c1)
1857-
Partitions: fd_pt2_1 FOR VALUES IN (1)
1862+
Partitions: fd_pt2_1 FOR VALUES IN (1), FOREIGN
18581863

18591864
\d+ fd_pt2_1
18601865
Foreign table "public.fd_pt2_1"
@@ -1926,7 +1931,7 @@ ALTER TABLE fd_pt2 ATTACH PARTITION fd_pt2_1 FOR VALUES IN (1);
19261931
c2 | text | | | | extended | |
19271932
c3 | date | | | | plain | |
19281933
Partition key: LIST (c1)
1929-
Partitions: fd_pt2_1 FOR VALUES IN (1)
1934+
Partitions: fd_pt2_1 FOR VALUES IN (1), FOREIGN
19301935

19311936
\d+ fd_pt2_1
19321937
Foreign table "public.fd_pt2_1"
@@ -1954,7 +1959,7 @@ ALTER TABLE fd_pt2_1 ADD CONSTRAINT p21chk CHECK (c2 <> '');
19541959
c2 | text | | | | extended | |
19551960
c3 | date | | | | plain | |
19561961
Partition key: LIST (c1)
1957-
Partitions: fd_pt2_1 FOR VALUES IN (1)
1962+
Partitions: fd_pt2_1 FOR VALUES IN (1), FOREIGN
19581963

19591964
\d+ fd_pt2_1
19601965
Foreign table "public.fd_pt2_1"

0 commit comments

Comments
 (0)