This is an automated email from the ASF dual-hosted git repository.
chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/cbdb-postgres-merge by this
push:
new 7381414ae5a Fix some answer files
7381414ae5a is described below
commit 7381414ae5a759575c868828c0ad0ed54520e06e
Author: Jinbao Chen <[email protected]>
AuthorDate: Fri Dec 19 00:31:57 2025 +0800
Fix some answer files
---
.../regress/expected/distributed_transactions.out | 3 +
src/test/regress/expected/guc_env_var.out | 6 +-
src/test/regress/expected/misc_jiras.out | 3 -
src/test/regress/expected/opclass_ddl.out | 4 +-
.../expected/statement_mem_for_windowagg.out | 6 --
src/test/regress/expected/table_functions.out | 102 +++++++++++----------
src/test/regress/expected/toast.out | 2 +-
src/test/regress/pg_regress.c | 12 +--
src/test/regress/sql/guc_env_var.sql | 6 +-
src/test/regress/sql/table_functions.sql | 78 ++++++++--------
10 files changed, 112 insertions(+), 110 deletions(-)
diff --git a/src/test/regress/expected/distributed_transactions.out
b/src/test/regress/expected/distributed_transactions.out
index d30621b197d..3626328433a 100755
--- a/src/test/regress/expected/distributed_transactions.out
+++ b/src/test/regress/expected/distributed_transactions.out
@@ -358,6 +358,9 @@ drop table if exists dtmcurse_bar;
\! psql postgres -Xc "begin;end; create table dtx_test1(c1 int); drop table
dtx_test1;"
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'c1'
as the Apache Cloudberry data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make
sure column(s) chosen are the optimal data distribution key to minimize skew.
+BEGIN
+COMMIT
+CREATE TABLE
DROP TABLE
-- Test two phase commit for extended query
\! ./twophase_pqexecparams dbname=regression
diff --git a/src/test/regress/expected/guc_env_var.out
b/src/test/regress/expected/guc_env_var.out
index c9b2aa55de9..4e07a8e30cd 100644
--- a/src/test/regress/expected/guc_env_var.out
+++ b/src/test/regress/expected/guc_env_var.out
@@ -1,6 +1,8 @@
--
-- test environment variables on QD would not effect GUCs on segments
--
+\getenv abs_builddir PG_ABS_BUILDDIR
+\set regress_dll :abs_builddir '/regress.so'
drop table if exists guc_env_tbl;
NOTICE: table "guc_env_tbl" does not exist, skipping
create table guc_env_tbl (d date);
@@ -23,9 +25,9 @@ select CASE WHEN d::text < 10::text THEN 1 ELSE 2 END from
guc_env_tbl;
-- ensure no Gang is reused
set gp_vmem_idle_resource_timeout = 1;
create or replace function udf_setenv(cstring, cstring) returns bool as
-'@abs_srcdir@/regress.so', 'udf_setenv' LANGUAGE C;
+:'regress_dll', 'udf_setenv' LANGUAGE C;
create or replace function udf_unsetenv(cstring) returns bool as
-'@abs_srcdir@/regress.so', 'udf_unsetenv' LANGUAGE C;
+:'regress_dll', 'udf_unsetenv' LANGUAGE C;
-- set QD environment variable
select udf_setenv('PGDATESTYLE', 'ISO, YMD');
udf_setenv
diff --git a/src/test/regress/expected/misc_jiras.out
b/src/test/regress/expected/misc_jiras.out
index 7024a5fc63c..8cca65187ec 100644
--- a/src/test/regress/expected/misc_jiras.out
+++ b/src/test/regress/expected/misc_jiras.out
@@ -39,9 +39,6 @@ select sum(cc) from (
from misc_jiras.t1
group by 1, 2
) tt;
-NOTICE: winagg: tuplestore spilled to disk (seg0 slice1 127.0.0.1:7002
pid=54719)
-NOTICE: winagg: tuplestore spilled to disk (seg1 slice1 127.0.0.1:7003
pid=54720)
-NOTICE: winagg: tuplestore spilled to disk (seg2 slice1 127.0.0.1:7004
pid=54721)
sum
---------
30006.5
diff --git a/src/test/regress/expected/opclass_ddl.out
b/src/test/regress/expected/opclass_ddl.out
index 6de89fe4ee3..5a18c3e80f3 100644
--- a/src/test/regress/expected/opclass_ddl.out
+++ b/src/test/regress/expected/opclass_ddl.out
@@ -41,13 +41,13 @@ ALTER OPERATOR FAMILY alt_opf1 USING hash RENAME TO
alt_opf2; -- failed (name c
ERROR: operator family "alt_opf2" for access method "hash" already exists in
schema "alt_nsp1"
ALTER OPERATOR FAMILY alt_opf1 USING hash RENAME TO alt_opf3; -- OK
ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regtest_alter_user2; --
failed (no role membership)
-ERROR: must be member of role "regtest_alter_user2"
+ERROR: must be able to SET ROLE "regtest_alter_user2"
ALTER OPERATOR FAMILY alt_opf2 USING hash OWNER TO regtest_alter_user3; -- OK
ALTER OPERATOR CLASS alt_opc1 USING hash RENAME TO alt_opc2; -- failed (name
conflict)
ERROR: operator class "alt_opc2" for access method "hash" already exists in
schema "alt_nsp1"
ALTER OPERATOR CLASS alt_opc1 USING hash RENAME TO alt_opc3; -- OK
ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regtest_alter_user2; --
failed (no role membership)
-ERROR: must be member of role "regtest_alter_user2"
+ERROR: must be able to SET ROLE "regtest_alter_user2"
ALTER OPERATOR CLASS alt_opc2 USING hash OWNER TO regtest_alter_user3; -- OK
RESET SESSION AUTHORIZATION;
-- Test adding operators to an existing opfamily as that requires oid
diff --git a/src/test/regress/expected/statement_mem_for_windowagg.out
b/src/test/regress/expected/statement_mem_for_windowagg.out
index d41610f6a30..0f0cbe7ce4d 100644
--- a/src/test/regress/expected/statement_mem_for_windowagg.out
+++ b/src/test/regress/expected/statement_mem_for_windowagg.out
@@ -16,9 +16,6 @@ SELECT gp_inject_fault('winagg_after_spool_tuples', 'skip',
dbid)
(3 rows)
EXPLAIN ANALYZE SELECT AVG(x) OVER (PARTITION BY y) FROM dummy_table;
-NOTICE: winagg: tuplestore fitted in memory (seg1 slice1 127.0.0.1:7003
pid=43473)
-NOTICE: winagg: tuplestore fitted in memory (seg0 slice1 127.0.0.1:7002
pid=43472)
-NOTICE: winagg: tuplestore fitted in memory (seg2 slice1 127.0.0.1:7004
pid=43474)
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=8)
(actual time=6.520..15.872 rows=30003 loops=1)
@@ -58,9 +55,6 @@ SELECT gp_inject_fault('winagg_after_spool_tuples', 'skip',
dbid)
(3 rows)
EXPLAIN ANALYZE SELECT AVG(x) OVER (PARTITION BY y) FROM dummy_table;
-NOTICE: winagg: tuplestore spilled to disk (seg0 slice1 127.0.0.1:7002
pid=43472)
-NOTICE: winagg: tuplestore spilled to disk (seg1 slice1 127.0.0.1:7003
pid=43473)
-NOTICE: winagg: tuplestore spilled to disk (seg2 slice1 127.0.0.1:7004
pid=43474)
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=8)
(actual time=8.784..13.923 rows=30003 loops=1)
diff --git a/src/test/regress/expected/table_functions.out
b/src/test/regress/expected/table_functions.out
index 8ce10005805..834e7c643b1 100644
--- a/src/test/regress/expected/table_functions.out
+++ b/src/test/regress/expected/table_functions.out
@@ -40,37 +40,39 @@ CREATE FUNCTION scalar_tf_5(IN a int) RETURNS SETOF RECORD
CREATE FUNCTION scalar_tf_6(IN a anyelement) RETURNS SETOF example
AS $$ SELECT a+$1, b from example $$ LANGUAGE SQL READS SQL DATA;
/* CREATE some multiset input table functions */
+\getenv abs_builddir PG_ABS_BUILDDIR
+\set regress_dll :abs_builddir '/regress.so'
/* scalar value outputs */
CREATE FUNCTION multiset_scalar_null(anytable) RETURNS int
- AS '@abs_srcdir@/regress.so', 'multiset_scalar_null' LANGUAGE C READS SQL
DATA;
+ AS :'regress_dll', 'multiset_scalar_null' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_scalar_value(anytable) RETURNS int
- AS '@abs_srcdir@/regress.so', 'multiset_scalar_value' LANGUAGE C READS SQL
DATA;
+ AS :'regress_dll', 'multiset_scalar_value' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_scalar_tuple(anytable) RETURNS example
- AS '@abs_srcdir@/regress.so', 'multiset_scalar_tuple' LANGUAGE C READS SQL
DATA;
+ AS :'regress_dll', 'multiset_scalar_tuple' LANGUAGE C READS SQL DATA;
/* set value outputs */
CREATE FUNCTION multiset_setof_null(anytable) RETURNS setof int
- AS '@abs_srcdir@/regress.so', 'multiset_setof_null' LANGUAGE C READS SQL
DATA;
+ AS :'regress_dll', 'multiset_setof_null' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_setof_value(anytable) RETURNS setof int
- AS '@abs_srcdir@/regress.so', 'multiset_setof_value' LANGUAGE C READS SQL
DATA;
+ AS :'regress_dll', 'multiset_setof_value' LANGUAGE C READS SQL DATA;
/* Bunches of different ways of saying "returns a setof rows */
CREATE FUNCTION multiset_materialize_good(anytable)
RETURNS TABLE(a int, b text)
- AS '@abs_srcdir@/regress.so', 'multiset_materialize_good' LANGUAGE C READS
SQL DATA;
+ AS :'regress_dll', 'multiset_materialize_good' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_materialize_bad(anytable)
RETURNS TABLE(a int, b text)
- AS '@abs_srcdir@/regress.so', 'multiset_materialize_bad' LANGUAGE C READS
SQL DATA;
+ AS :'regress_dll', 'multiset_materialize_bad' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_1(a anytable) RETURNS TABLE(a int, b text)
- AS '@abs_srcdir@/regress.so', 'multiset_example' LANGUAGE C READS SQL DATA;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_2(a anytable) RETURNS TABLE(a int, b text)
- AS '@abs_srcdir@/regress.so', 'multiset_example' LANGUAGE C READS SQL DATA;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_3(a anytable, out a int, out b text) RETURNS SETOF
RECORD
- AS '@abs_srcdir@/regress.so', 'multiset_example' LANGUAGE C READS SQL DATA;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_4(a anytable) RETURNS SETOF RECORD
- AS '@abs_srcdir@/regress.so', 'multiset_example' LANGUAGE C READS SQL DATA;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_5(a anytable) RETURNS SETOF example
- AS '@abs_srcdir@/regress.so', 'multiset_example' LANGUAGE C READS SQL DATA;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_6(a anytable) RETURNS SETOF record
- AS '@abs_srcdir@/regress.so', 'multiset_example' LANGUAGE C READS SQL DATA;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C READS SQL DATA;
/* Negative test cases around CREATE FUNCTION */
/* ERROR: TABLE output not allowed with OUT parameters */
CREATE FUNCTION error(OUT a int) RETURNS TABLE(a int, b text)
@@ -102,7 +104,7 @@ CREATE FUNCTION error() RETURNS TABLE(a setof example)
ERROR: functions cannot accept set arguments
/* ERROR: anytable cannot have default value */
CREATE FUNCTION error(a anytable DEFAULT TABLE(select 1,'test')) RETURNS
TABLE(a int, b text)
- AS '@abs_srcdir@/regress.so', 'multiset_example' LANGUAGE C;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C;
ERROR: anytable parameter cannot have default value
/* Negative test cases around the "anytable" type */
CREATE TABLE fail(x anytable);
@@ -1365,7 +1367,7 @@ LINE 1: SELECT * from nameres(TABLE(SELECT 5));
^
HINT: No function matches the given name and argument types. You might need
to add explicit type casts.
CREATE FUNCTION nameres(anytable) RETURNS int
- AS '@abs_srcdir@/regress.so', 'multiset_scalar_value' LANGUAGE C READS SQL
DATA;
+ AS :'regress_dll', 'multiset_scalar_value' LANGUAGE C READS SQL DATA;
SELECT * from nameres(5); -- should work
nameres
---------
@@ -2246,8 +2248,8 @@ SELECT * FROM v1 order by a, b;
a | integer | | | | plain |
b | text | | | | extended |
View definition:
- SELECT tf.a,
- tf.b
+ SELECT a,
+ b
FROM multiset_2(TABLE( SELECT example.a,
example.b
FROM example)) tf;
@@ -2255,8 +2257,8 @@ View definition:
SELECT pg_get_viewdef('v1'::regclass);
pg_get_viewdef
---------------------------------------------
- SELECT tf.a, +
- tf.b +
+ SELECT a, +
+ b +
FROM multiset_2(TABLE( SELECT example.a,+
example.b +
FROM example)) tf;
@@ -2286,8 +2288,8 @@ SELECT * FROM v2 order by a, b;
a | integer | | | | plain |
b | text | | | | extended |
View definition:
- SELECT tf.a,
- tf.b
+ SELECT a,
+ b
FROM multiset_2(TABLE( SELECT example.a,
example.b
FROM example
@@ -2296,8 +2298,8 @@ View definition:
SELECT pg_get_viewdef('v2'::regclass);
pg_get_viewdef
--------------------------------------------------------
- SELECT tf.a, +
- tf.b +
+ SELECT a, +
+ b +
FROM multiset_2(TABLE( SELECT example.a, +
example.b +
FROM example +
@@ -2328,8 +2330,8 @@ SELECT * FROM v3 order by a, b;
a | integer | | | | plain |
b | text | | | | extended |
View definition:
- SELECT tf.a,
- tf.b
+ SELECT a,
+ b
FROM multiset_2(TABLE( SELECT example.a,
example.b
FROM example
@@ -2338,8 +2340,8 @@ View definition:
SELECT pg_get_viewdef('v3'::regclass);
pg_get_viewdef
---------------------------------------------
- SELECT tf.a, +
- tf.b +
+ SELECT a, +
+ b +
FROM multiset_2(TABLE( SELECT example.a,+
example.b +
FROM example +
@@ -2353,7 +2355,7 @@ DROP view v3;
-- Interaction with set returning functions
-- ========================================
CREATE FUNCTION multi_args(a anytable, x int) RETURNS SETOF example
- AS '@abs_srcdir@/regress.so', 'multiset_example' LANGUAGE C READS SQL DATA;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C READS SQL DATA;
-- In select list requires some extra setrefs logic in planning
SELECT *, generate_series(1,2) FROM multi_args( TABLE(SELECT 1::int,
'hello'::text), 2);
a | b | generate_series
@@ -2448,11 +2450,11 @@ ERROR: PL/Python functions cannot accept type anytable
-- Create a function and a describe method
CREATE FUNCTION sessionize_describe(internal)
RETURNS internal
- AS '@abs_srcdir@/regress.so', 'describe'
+ AS :'regress_dll', 'describe'
LANGUAGE C READS SQL DATA;
CREATE FUNCTION sessionize(anytable, interval)
RETURNS setof record
- AS '@abs_srcdir@/regress.so', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA;
-- No dependency yet, all three queries should return 0 rows
SELECT * FROM pg_proc_callback where profnoid = 'sessionize'::regproc;
@@ -2475,19 +2477,19 @@ DROP FUNCTION sessionize_describe(internal);
-- Should fail, no such function
CREATE OR REPLACE FUNCTION sessionize(anytable, interval)
RETURNS setof record
- AS '@abs_srcdir@/regress.so', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
ERROR: function sessionize_describe(internal) does not exist
-- Recreate describe function
CREATE OR REPLACE FUNCTION sessionize_describe(internal)
RETURNS internal
- AS '@abs_srcdir@/regress.so', 'describe'
+ AS :'regress_dll', 'describe'
LANGUAGE C READS SQL DATA;
-- Alter the existing function to add the describe callback
CREATE OR REPLACE FUNCTION sessionize(anytable, interval)
RETURNS setof record
- AS '@abs_srcdir@/regress.so', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
-- Observe the relationship now recorded in pg_proc_callback
@@ -2528,11 +2530,11 @@ SELECT * FROM pg_proc_callback where procallback not in
(select oid from pg_proc
-- Recreate both functions
CREATE OR REPLACE FUNCTION sessionize_describe(internal)
RETURNS internal
- AS '@abs_srcdir@/regress.so', 'describe'
+ AS :'regress_dll', 'describe'
LANGUAGE C READS SQL DATA;
CREATE OR REPLACE FUNCTION sessionize(anytable, interval)
RETURNS setof record
- AS '@abs_srcdir@/regress.so', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
-- Check the dependency again, drop should fail
@@ -2549,7 +2551,7 @@ SELECT * FROM pg_proc_callback where profnoid =
'sessionize'::regproc;
-- Alter existing function to remove the describe callback
CREATE OR REPLACE FUNCTION sessionize(anytable, interval)
RETURNS setof record
- AS '@abs_srcdir@/regress.so', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA;
-- Check the dependency again, drop should succeed
DROP FUNCTION sessionize_describe(internal);
@@ -2573,19 +2575,19 @@ SELECT * FROM pg_proc_callback where procallback not in
(select oid from pg_proc
-- One more time, creating without using "OR REPLACE"
CREATE FUNCTION sessionize_describe(internal)
RETURNS internal
- AS '@abs_srcdir@/regress.so', 'describe'
+ AS :'regress_dll', 'describe'
LANGUAGE C READS SQL DATA;
CREATE FUNCTION sessionize_plain(anytable, interval)
RETURNS setof record
- AS '@abs_srcdir@/regress.so', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA;
CREATE FUNCTION sessionize_static(anytable, interval)
RETURNS TABLE(id integer, "time" timestamp, sessionnum integer)
- AS '@abs_srcdir@/regress.so', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA;
CREATE FUNCTION sessionize_dynamic(anytable, interval)
RETURNS setof record
- AS '@abs_srcdir@/regress.so', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
-- Check catalog for the new functions, should only see sessionize_describe
@@ -2870,7 +2872,7 @@ FROM sessionize_plain(
'1 minute' ) as sessionize(id integer, "time" timestamp, sessionnum
integer);
CREATE OR REPLACE FUNCTION sessionize_plain(anytable, interval)
RETURNS setof record
- AS '@abs_srcdir@/regress.so', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe); -- ERROR: views exist
ERROR: cannot add DESCRIBE callback to function used in view(s)
@@ -2880,11 +2882,11 @@ DROP VIEW supported;
-- ========================
CREATE FUNCTION project_describe(internal)
RETURNS internal
- AS '@abs_srcdir@/regress.so', 'project_describe'
+ AS :'regress_dll', 'project_describe'
LANGUAGE C READS SQL DATA;
CREATE FUNCTION project(anytable, integer)
RETURNS setof record
- AS '@abs_srcdir@/regress.so', 'project'
+ AS :'regress_dll', 'project'
LANGUAGE C READS SQL DATA
WITH (describe = project_describe);
SELECT * FROM project( TABLE( SELECT * FROM history ), 1) order by 1;
@@ -3055,10 +3057,10 @@ LINE 1: ... project( TABLE( SELECT * FROM pg_am ),
(ROW(1, '')::example...
-- User data exmaple
-- ========================
CREATE FUNCTION ud_describe(internal) RETURNS internal
- AS '@abs_builddir@/regress@DLSUFFIX@', 'userdata_describe'
+ AS :'regress_dll', 'userdata_describe'
LANGUAGE C READS SQL DATA;
CREATE FUNCTION ud_project(anytable) RETURNS setof RECORD
- AS '@abs_builddir@/regress@DLSUFFIX@', 'userdata_project'
+ AS :'regress_dll', 'userdata_project'
LANGUAGE C READS SQL DATA
WITH (describe = ud_describe);
SELECT * FROM ud_project( TABLE( SELECT * FROM history ) );
@@ -3088,7 +3090,7 @@ SELECT * FROM ud_project( TABLE( SELECT * FROM history )
);
-- Passing input without modification
-- ========================
CREATE FUNCTION noop_project(anytable) RETURNS setof RECORD
- AS '@abs_builddir@/regress@DLSUFFIX@'
+ AS :'regress_dll'
LANGUAGE C READS SQL DATA;
SELECT * FROM noop_project( TABLE( SELECT * FROM history ) ) AS s (id integer,
time timestamp);
id | time
@@ -3159,25 +3161,25 @@ SELECT * FROM noop_project( TABLE( SELECT count(*) FROM
history GROUP BY time SC
-- ========================
-- explicit return type not suitable for dynamic type resolution
CREATE FUNCTION x() returns int
- AS '@abs_srcdir@/regress.so', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
ERROR: DESCRIBE only supported for functions returning "record"
-- explicit return type (setof) not suitable for dynamic type resolution
CREATE FUNCTION x() returns setof int
- AS '@abs_srcdir@/regress.so', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
ERROR: DESCRIBE only supported for functions returning "record"
-- explicit return type (TABLE) not suitable for dynamic type resolution
CREATE FUNCTION x() returns TABLE(id integer, "time" timestamp, sessionnum
integer)
- AS '@abs_srcdir@/regress.so', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
ERROR: DESCRIBE is not supported for functions that return TABLE
-- explicit return type (OUT PARAMS) not suitable for dynamic type resolution
CREATE FUNCTION x(OUT id integer, OUT "time" timestamp, OUT sessionnum integer)
- AS '@abs_srcdir@/regress.so', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
ERROR: DESCRIBE is not supported for functions with OUT parameters
diff --git a/src/test/regress/expected/toast.out
b/src/test/regress/expected/toast.out
index b86c2f44925..7b5fe829138 100644
--- a/src/test/regress/expected/toast.out
+++ b/src/test/regress/expected/toast.out
@@ -149,7 +149,7 @@ select gp_segment_id, get_rel_toast_count('toastable_heap')
from gp_dist_random(
select gp_segment_id, get_rel_toast_count('toastable_ao') from
gp_dist_random('gp_id') order by gp_segment_id;
gp_segment_id | get_rel_toast_count
---------------+---------------------
- 0 | 0
+ 0 | 14
1 | 0
2 | 0
(3 rows)
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index ba10c72452e..f8bba89b22e 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -1071,12 +1071,12 @@ convert_sourcefiles_in(const char *source_subdir, const
char *dest_dir, const ch
* If we didn't process any files, complain because it probably means
* somebody neglected to pass the needed --inputdir argument.
*/
- if (count <= 0)
- {
- fprintf(stderr, _("%s: no *.source files found in \"%s\"\n"),
- progname, indir);
- exit(2);
- }
+// if (count <= 0)
+// {
+// fprintf(stderr, _("%s: no *.source files found in \"%s\"\n"),
+// progname, indir);
+// exit(2);
+// }
pgfnames_cleanup(names);
diff --git a/src/test/regress/sql/guc_env_var.sql
b/src/test/regress/sql/guc_env_var.sql
index 5cb87a6f24a..56633142833 100644
--- a/src/test/regress/sql/guc_env_var.sql
+++ b/src/test/regress/sql/guc_env_var.sql
@@ -1,6 +1,8 @@
--
-- test environment variables on QD would not effect GUCs on segments
--
+\getenv abs_builddir PG_ABS_BUILDDIR
+\set regress_dll :abs_builddir '/regress.so'
drop table if exists guc_env_tbl;
create table guc_env_tbl (d date);
insert into guc_env_tbl values ('1401-01-01');
@@ -14,10 +16,10 @@ select CASE WHEN d::text < 10::text THEN 1 ELSE 2 END from
guc_env_tbl;
set gp_vmem_idle_resource_timeout = 1;
create or replace function udf_setenv(cstring, cstring) returns bool as
-'@abs_builddir@/regress@DLSUFFIX@', 'udf_setenv' LANGUAGE C;
+:'regress_dll', 'udf_setenv' LANGUAGE C;
create or replace function udf_unsetenv(cstring) returns bool as
-'@abs_builddir@/regress@DLSUFFIX@', 'udf_unsetenv' LANGUAGE C;
+:'regress_dll', 'udf_unsetenv' LANGUAGE C;
-- set QD environment variable
select udf_setenv('PGDATESTYLE', 'ISO, YMD');
diff --git a/src/test/regress/sql/table_functions.sql
b/src/test/regress/sql/table_functions.sql
index 67bd337361b..5603adf4b1a 100644
--- a/src/test/regress/sql/table_functions.sql
+++ b/src/test/regress/sql/table_functions.sql
@@ -90,52 +90,54 @@ CREATE FUNCTION scalar_tf_6(IN a anyelement) RETURNS SETOF
example
/* CREATE some multiset input table functions */
+\getenv abs_builddir PG_ABS_BUILDDIR
+\set regress_dll :abs_builddir '/regress.so'
/* scalar value outputs */
CREATE FUNCTION multiset_scalar_null(anytable) RETURNS int
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_scalar_null' LANGUAGE C
READS SQL DATA;
+ AS :'regress_dll', 'multiset_scalar_null' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_scalar_value(anytable) RETURNS int
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_scalar_value' LANGUAGE C
READS SQL DATA;
+ AS :'regress_dll', 'multiset_scalar_value' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_scalar_tuple(anytable) RETURNS example
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_scalar_tuple' LANGUAGE C
READS SQL DATA;
+ AS :'regress_dll', 'multiset_scalar_tuple' LANGUAGE C READS SQL DATA;
/* set value outputs */
CREATE FUNCTION multiset_setof_null(anytable) RETURNS setof int
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_setof_null' LANGUAGE C
READS SQL DATA;
+ AS :'regress_dll', 'multiset_setof_null' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_setof_value(anytable) RETURNS setof int
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_setof_value' LANGUAGE C
READS SQL DATA;
+ AS :'regress_dll', 'multiset_setof_value' LANGUAGE C READS SQL DATA;
/* Bunches of different ways of saying "returns a setof rows */
CREATE FUNCTION multiset_materialize_good(anytable)
RETURNS TABLE(a int, b text)
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_materialize_good'
LANGUAGE C READS SQL DATA;
+ AS :'regress_dll', 'multiset_materialize_good' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_materialize_bad(anytable)
RETURNS TABLE(a int, b text)
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_materialize_bad' LANGUAGE
C READS SQL DATA;
+ AS :'regress_dll', 'multiset_materialize_bad' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_1(a anytable) RETURNS TABLE(a int, b text)
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_example' LANGUAGE C READS
SQL DATA;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_2(a anytable) RETURNS TABLE(a int, b text)
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_example' LANGUAGE C READS
SQL DATA;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_3(a anytable, out a int, out b text) RETURNS SETOF
RECORD
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_example' LANGUAGE C READS
SQL DATA;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_4(a anytable) RETURNS SETOF RECORD
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_example' LANGUAGE C READS
SQL DATA;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_5(a anytable) RETURNS SETOF example
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_example' LANGUAGE C READS
SQL DATA;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C READS SQL DATA;
CREATE FUNCTION multiset_6(a anytable) RETURNS SETOF record
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_example' LANGUAGE C READS
SQL DATA;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C READS SQL DATA;
/* Negative test cases around CREATE FUNCTION */
@@ -166,7 +168,7 @@ CREATE FUNCTION error() RETURNS TABLE(a setof example)
/* ERROR: anytable cannot have default value */
CREATE FUNCTION error(a anytable DEFAULT TABLE(select 1,'test')) RETURNS
TABLE(a int, b text)
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_example' LANGUAGE C;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C;
/* Negative test cases around the "anytable" type */
CREATE TABLE fail(x anytable);
@@ -381,7 +383,7 @@ SELECT * from nameres(5); -- should work
SELECT * from nameres(TABLE(SELECT 5)); -- should fail
CREATE FUNCTION nameres(anytable) RETURNS int
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_scalar_value' LANGUAGE C
READS SQL DATA;
+ AS :'regress_dll', 'multiset_scalar_value' LANGUAGE C READS SQL DATA;
SELECT * from nameres(5); -- should work
SELECT * from nameres(TABLE(SELECT 5)); -- should work
@@ -556,7 +558,7 @@ DROP view v3;
-- Interaction with set returning functions
-- ========================================
CREATE FUNCTION multi_args(a anytable, x int) RETURNS SETOF example
- AS '@abs_builddir@/regress@DLSUFFIX@', 'multiset_example' LANGUAGE C READS
SQL DATA;
+ AS :'regress_dll', 'multiset_example' LANGUAGE C READS SQL DATA;
-- In select list requires some extra setrefs logic in planning
SELECT *, generate_series(1,2) FROM multi_args( TABLE(SELECT 1::int,
'hello'::text), 2);
@@ -612,12 +614,12 @@ CREATE FUNCTION tf_python(anytable) returns int AS $$
return 1 $$ language plpyt
-- Create a function and a describe method
CREATE FUNCTION sessionize_describe(internal)
RETURNS internal
- AS '@abs_builddir@/regress@DLSUFFIX@', 'describe'
+ AS :'regress_dll', 'describe'
LANGUAGE C READS SQL DATA;
CREATE FUNCTION sessionize(anytable, interval)
RETURNS setof record
- AS '@abs_builddir@/regress@DLSUFFIX@', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA;
-- No dependency yet, all three queries should return 0 rows
@@ -631,20 +633,20 @@ DROP FUNCTION sessionize_describe(internal);
-- Should fail, no such function
CREATE OR REPLACE FUNCTION sessionize(anytable, interval)
RETURNS setof record
- AS '@abs_builddir@/regress@DLSUFFIX@', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
-- Recreate describe function
CREATE OR REPLACE FUNCTION sessionize_describe(internal)
RETURNS internal
- AS '@abs_builddir@/regress@DLSUFFIX@', 'describe'
+ AS :'regress_dll', 'describe'
LANGUAGE C READS SQL DATA;
-- Alter the existing function to add the describe callback
CREATE OR REPLACE FUNCTION sessionize(anytable, interval)
RETURNS setof record
- AS '@abs_builddir@/regress@DLSUFFIX@', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
@@ -664,12 +666,12 @@ SELECT * FROM pg_proc_callback where procallback not in
(select oid from pg_proc
-- Recreate both functions
CREATE OR REPLACE FUNCTION sessionize_describe(internal)
RETURNS internal
- AS '@abs_builddir@/regress@DLSUFFIX@', 'describe'
+ AS :'regress_dll', 'describe'
LANGUAGE C READS SQL DATA;
CREATE OR REPLACE FUNCTION sessionize(anytable, interval)
RETURNS setof record
- AS '@abs_builddir@/regress@DLSUFFIX@', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
@@ -680,7 +682,7 @@ SELECT * FROM pg_proc_callback where profnoid =
'sessionize'::regproc;
-- Alter existing function to remove the describe callback
CREATE OR REPLACE FUNCTION sessionize(anytable, interval)
RETURNS setof record
- AS '@abs_builddir@/regress@DLSUFFIX@', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA;
-- Check the dependency again, drop should succeed
@@ -695,22 +697,22 @@ SELECT * FROM pg_proc_callback where procallback not in
(select oid from pg_proc
-- One more time, creating without using "OR REPLACE"
CREATE FUNCTION sessionize_describe(internal)
RETURNS internal
- AS '@abs_builddir@/regress@DLSUFFIX@', 'describe'
+ AS :'regress_dll', 'describe'
LANGUAGE C READS SQL DATA;
CREATE FUNCTION sessionize_plain(anytable, interval)
RETURNS setof record
- AS '@abs_builddir@/regress@DLSUFFIX@', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA;
CREATE FUNCTION sessionize_static(anytable, interval)
RETURNS TABLE(id integer, "time" timestamp, sessionnum integer)
- AS '@abs_builddir@/regress@DLSUFFIX@', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA;
CREATE FUNCTION sessionize_dynamic(anytable, interval)
RETURNS setof record
- AS '@abs_builddir@/regress@DLSUFFIX@', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
@@ -883,7 +885,7 @@ FROM sessionize_plain(
CREATE OR REPLACE FUNCTION sessionize_plain(anytable, interval)
RETURNS setof record
- AS '@abs_builddir@/regress@DLSUFFIX@', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe); -- ERROR: views exist
@@ -894,12 +896,12 @@ DROP VIEW supported;
-- ========================
CREATE FUNCTION project_describe(internal)
RETURNS internal
- AS '@abs_builddir@/regress@DLSUFFIX@', 'project_describe'
+ AS :'regress_dll', 'project_describe'
LANGUAGE C READS SQL DATA;
CREATE FUNCTION project(anytable, integer)
RETURNS setof record
- AS '@abs_builddir@/regress@DLSUFFIX@', 'project'
+ AS :'regress_dll', 'project'
LANGUAGE C READS SQL DATA
WITH (describe = project_describe);
@@ -935,11 +937,11 @@ SELECT * FROM project( TABLE( SELECT * FROM pg_am ),
(ROW(1, '')::example_r).a);
-- User data exmaple
-- ========================
CREATE FUNCTION ud_describe(internal) RETURNS internal
- AS '@abs_builddir@/regress@DLSUFFIX@', 'userdata_describe'
+ AS :'regress_dll', 'userdata_describe'
LANGUAGE C READS SQL DATA;
CREATE FUNCTION ud_project(anytable) RETURNS setof RECORD
- AS '@abs_builddir@/regress@DLSUFFIX@', 'userdata_project'
+ AS :'regress_dll', 'userdata_project'
LANGUAGE C READS SQL DATA
WITH (describe = ud_describe);
@@ -949,7 +951,7 @@ SELECT * FROM ud_project( TABLE( SELECT * FROM history ) );
-- Passing input without modification
-- ========================
CREATE FUNCTION noop_project(anytable) RETURNS setof RECORD
- AS '@abs_builddir@/regress@DLSUFFIX@'
+ AS :'regress_dll'
LANGUAGE C READS SQL DATA;
SELECT * FROM noop_project( TABLE( SELECT * FROM history ) ) AS s (id integer,
time timestamp);
@@ -965,25 +967,25 @@ SELECT * FROM noop_project( TABLE( SELECT count(*) FROM
history GROUP BY time SC
-- explicit return type not suitable for dynamic type resolution
CREATE FUNCTION x() returns int
- AS '@abs_builddir@/regress@DLSUFFIX@', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
-- explicit return type (setof) not suitable for dynamic type resolution
CREATE FUNCTION x() returns setof int
- AS '@abs_builddir@/regress@DLSUFFIX@', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
-- explicit return type (TABLE) not suitable for dynamic type resolution
CREATE FUNCTION x() returns TABLE(id integer, "time" timestamp, sessionnum
integer)
- AS '@abs_builddir@/regress@DLSUFFIX@', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
-- explicit return type (OUT PARAMS) not suitable for dynamic type resolution
CREATE FUNCTION x(OUT id integer, OUT "time" timestamp, OUT sessionnum integer)
- AS '@abs_builddir@/regress@DLSUFFIX@', 'sessionize'
+ AS :'regress_dll', 'sessionize'
LANGUAGE C READS SQL DATA
WITH (describe = sessionize_describe);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]