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 9e08b193a1d Fix some answer files
9e08b193a1d is described below
commit 9e08b193a1d69056fd6fb47ea49c3df3b0fd3032
Author: Jinbao Chen <[email protected]>
AuthorDate: Thu Dec 18 19:49:16 2025 +0800
Fix some answer files
---
src/backend/commands/dbcommands.c | 5 +++
src/test/regress/expected/createdb.out | 16 ++++----
src/test/regress/expected/function_extensions.out | 48 ++++++++---------------
src/test/regress/expected/gp_aggregates.out | 24 ++++++------
src/test/regress/expected/gp_prepared_xacts.out | 1 +
src/test/regress/expected/update_gp.out | 15 +++----
src/test/regress/expected/variadic_parameters.out | 20 +++++-----
src/test/regress/sql/createdb.sql | 10 ++---
src/test/regress/sql/disable_autovacuum.sql | 2 +-
src/test/regress/sql/gp_aggregates.sql | 4 +-
10 files changed, 67 insertions(+), 78 deletions(-)
diff --git a/src/backend/commands/dbcommands.c
b/src/backend/commands/dbcommands.c
index 08811b87929..e2cf22c45f3 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -649,6 +649,8 @@ CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dst_dboid,
Oid src_tsid,
*/
copydir(srcpath, dstpath, false);
+ SIMPLE_FAULT_INJECTOR("create_db_after_file_copy");
+
/* Record the filesystem change in XLOG */
{
xl_dbase_create_file_copy_rec xlrec;
@@ -668,6 +670,9 @@ CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dst_dboid,
Oid src_tsid,
pfree(srcpath);
pfree(dstpath);
}
+
+ SIMPLE_FAULT_INJECTOR("after_xlog_create_database");
+
table_endscan(scan);
table_close(rel, AccessShareLock);
diff --git a/src/test/regress/expected/createdb.out
b/src/test/regress/expected/createdb.out
index f9aba9573b2..97a7d9606a5 100644
--- a/src/test/regress/expected/createdb.out
+++ b/src/test/regress/expected/createdb.out
@@ -20,7 +20,7 @@ $$;
--
--CASE 0: createdb do well
--
-create database dowell;
+create database dowell STRATEGY = file_copy;
select force_mirrors_to_catch_up();
force_mirrors_to_catch_up
---------------------------
@@ -76,8 +76,8 @@ from gp_segment_configuration where content=0 and role='p';
(1 row)
-- should fail
-create database db_with_leftover_files;
-ERROR: fault triggered, fault name:'create_db_after_file_copy' fault
type:'error' (seg0 10.34.49.130:25432 pid=83183)
+create database db_with_leftover_files STRATEGY = file_copy;;
+ERROR: fault triggered, fault name:'create_db_after_file_copy' fault
type:'error'
-- Wait until replay_lsn = flush_lsn.
select force_mirrors_to_catch_up();
force_mirrors_to_catch_up
@@ -119,7 +119,7 @@ from gp_segment_configuration where content=-1 and role='p';
(1 row)
-- should fail
-create database db2;
+create database db2 STRATEGY = file_copy;
ERROR: fault triggered, fault name:'after_xlog_create_database' fault
type:'error'
select force_mirrors_to_catch_up();
force_mirrors_to_catch_up
@@ -160,8 +160,8 @@ from gp_segment_configuration where content=0 and role='p';
(1 row)
-- should fail
-create database db3;
-ERROR: fault triggered, fault name:'after_xlog_create_database' fault
type:'error' (seg0 10.34.49.130:25432 pid=83183)
+create database db3 STRATEGY = file_copy;
+ERROR: fault triggered, fault name:'after_xlog_create_database' fault
type:'error'
select force_mirrors_to_catch_up();
force_mirrors_to_catch_up
---------------------------
@@ -210,8 +210,8 @@ HINT: Inject an infinite 'skip' into the 'fts_probe' fault
to disable FTS probi
(1 row)
-- should fail
-create database db4;
-ERROR: fault triggered, fault name:'end_prepare_two_phase' fault type:'panic'
(seg0 10.34.49.130:25432 pid=83183)
+create database db4 STRATEGY = file_copy;
+ERROR: fault triggered, fault name:'end_prepare_two_phase' fault type:'panic'
select force_mirrors_to_catch_up();
force_mirrors_to_catch_up
---------------------------
diff --git a/src/test/regress/expected/function_extensions.out
b/src/test/regress/expected/function_extensions.out
index 16d4bbf8ba8..2efc3c2e8e4 100644
--- a/src/test/regress/expected/function_extensions.out
+++ b/src/test/regress/expected/function_extensions.out
@@ -387,50 +387,34 @@ explain select * from srf_testtab, test_srf() where
test_srf = srf_testtab.t;
-- Test ALTER FUNCTION, and that \df displays the EXECUTE ON correctly
\df+ test_srf
-
List of functions
- Schema | Name | Result data type | Argument data types | Type | Data
access | Execute on | Volatility | Parallel | Owner | Security | Access
privileges | Language | Source code | Description
---------+----------+------------------+---------------------+------+-------------+------------+------------+----------+-------------+----------+-------------------+----------+----------------------+-------------
- public | test_srf | SETOF text | | func | no sql
| any | immutable | unsafe | srftestuser | invoker |
| plpgsql | +|
- | | | | |
| | | | | |
| | begin +|
- | | | | |
| | | | | |
| | return next 'foo';+|
- | | | | |
| | | | | |
| | end; +|
- | | | | |
| | | | | |
| | |
+
List of functions
+ Schema | Name | Result data type | Argument data types | Type | Data
access | Execute on | Volatility | Parallel | Owner | Security | Access
privileges | Language | Internal name | Description
+--------+----------+------------------+---------------------+------+-------------+------------+------------+----------+-------------+----------+-------------------+----------+---------------+-------------
+ public | test_srf | SETOF text | | func | no sql
| any | immutable | unsafe | srftestuser | invoker |
| plpgsql | |
(1 row)
alter function test_srf() EXECUTE ON COORDINATOR;
\df+ test_srf
-
List of functions
- Schema | Name | Result data type | Argument data types | Type | Data
access | Execute on | Volatility | Parallel | Owner | Security | Access
privileges | Language | Source code | Description
---------+----------+------------------+---------------------+------+-------------+-------------+------------+----------+-------------+----------+-------------------+----------+----------------------+-------------
- public | test_srf | SETOF text | | func | no sql
| coordinator | immutable | unsafe | srftestuser | invoker |
| plpgsql | +|
- | | | | |
| | | | | |
| | begin +|
- | | | | |
| | | | | |
| | return next 'foo';+|
- | | | | |
| | | | | |
| | end; +|
- | | | | |
| | | | | |
| | |
+
List of functions
+ Schema | Name | Result data type | Argument data types | Type | Data
access | Execute on | Volatility | Parallel | Owner | Security | Access
privileges | Language | Internal name | Description
+--------+----------+------------------+---------------------+------+-------------+-------------+------------+----------+-------------+----------+-------------------+----------+---------------+-------------
+ public | test_srf | SETOF text | | func | no sql
| coordinator | immutable | unsafe | srftestuser | invoker |
| plpgsql | |
(1 row)
alter function test_srf() EXECUTE ON ALL SEGMENTS;
\df+ test_srf
-
List of functions
- Schema | Name | Result data type | Argument data types | Type | Data
access | Execute on | Volatility | Parallel | Owner | Security | Access
privileges | Language | Source code | Description
---------+----------+------------------+---------------------+------+-------------+--------------+------------+----------+-------------+----------+-------------------+----------+----------------------+-------------
- public | test_srf | SETOF text | | func | no sql
| all segments | immutable | unsafe | srftestuser | invoker |
| plpgsql | +|
- | | | | |
| | | | | |
| | begin +|
- | | | | |
| | | | | |
| | return next 'foo';+|
- | | | | |
| | | | | |
| | end; +|
- | | | | |
| | | | | |
| | |
+
List of functions
+ Schema | Name | Result data type | Argument data types | Type | Data
access | Execute on | Volatility | Parallel | Owner | Security | Access
privileges | Language | Internal name | Description
+--------+----------+------------------+---------------------+------+-------------+--------------+------------+----------+-------------+----------+-------------------+----------+---------------+-------------
+ public | test_srf | SETOF text | | func | no sql
| all segments | immutable | unsafe | srftestuser | invoker |
| plpgsql | |
(1 row)
alter function test_srf() EXECUTE ON ANY;
\df+ test_srf
-
List of functions
- Schema | Name | Result data type | Argument data types | Type | Data
access | Execute on | Volatility | Parallel | Owner | Security | Access
privileges | Language | Source code | Description
---------+----------+------------------+---------------------+------+-------------+------------+------------+----------+-------------+----------+-------------------+----------+----------------------+-------------
- public | test_srf | SETOF text | | func | no sql
| any | immutable | unsafe | srftestuser | invoker |
| plpgsql | +|
- | | | | |
| | | | | |
| | begin +|
- | | | | |
| | | | | |
| | return next 'foo';+|
- | | | | |
| | | | | |
| | end; +|
- | | | | |
| | | | | |
| | |
+
List of functions
+ Schema | Name | Result data type | Argument data types | Type | Data
access | Execute on | Volatility | Parallel | Owner | Security | Access
privileges | Language | Internal name | Description
+--------+----------+------------------+---------------------+------+-------------+------------+------------+----------+-------------+----------+-------------------+----------+---------------+-------------
+ public | test_srf | SETOF text | | func | no sql
| any | immutable | unsafe | srftestuser | invoker |
| plpgsql | |
(1 row)
DROP FUNCTION test_srf();
diff --git a/src/test/regress/expected/gp_aggregates.out
b/src/test/regress/expected/gp_aggregates.out
index 46875746d09..5b2206fb8fa 100644
--- a/src/test/regress/expected/gp_aggregates.out
+++ b/src/test/regress/expected/gp_aggregates.out
@@ -320,7 +320,7 @@ create aggregate mysum_prefunc(int4) (
-- tweak settings to force multistage agg to be used
set gp_motion_cost_per_row = 1000;
set optimizer_force_multistage_agg = on;
-set force_parallel_mode = off;
+set debug_parallel_query = off;
select mysum_prefunc(a::int4) from aggtest;
NOTICE: combinefunc called
NOTICE: combinefunc called
@@ -331,7 +331,7 @@ NOTICE: combinefunc called
reset gp_motion_cost_per_row;
reset optimizer_force_multistage_agg;
-reset force_parallel_mode;
+reset debug_parallel_query;
-- Test an aggregate with 'internal' transition type, and a combine function,
-- but no serial/deserial functions. This is valid, but we have no use for
-- the combine function in GPDB in that case.
@@ -373,22 +373,20 @@ insert into multiagg_with_subquery select i, i+1, i+2,
i+3 from generate_series(
analyze multiagg_with_subquery;
explain (costs off)
select count(distinct j), count(distinct k), count(distinct m) from (select
j,k,m from multiagg_with_subquery group by j,k,m ) sub group by j;
- QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
-> GroupAggregate
Group Key: multiagg_with_subquery.j
-> Sort
- Sort Key: multiagg_with_subquery.j
- -> Redistribute Motion 3:3 (slice2; segments: 3)
- Hash Key: multiagg_with_subquery.j
- -> HashAggregate
- Group Key: multiagg_with_subquery.j,
multiagg_with_subquery.k, multiagg_with_subquery.m
- -> Redistribute Motion 3:3 (slice3; segments: 3)
- Hash Key: multiagg_with_subquery.j,
multiagg_with_subquery.k, multiagg_with_subquery.m
- -> Seq Scan on multiagg_with_subquery
+ Sort Key: multiagg_with_subquery.j, multiagg_with_subquery.k
+ -> HashAggregate
+ Group Key: multiagg_with_subquery.j,
multiagg_with_subquery.k, multiagg_with_subquery.m
+ -> Redistribute Motion 3:3 (slice2; segments: 3)
+ Hash Key: multiagg_with_subquery.j,
multiagg_with_subquery.k, multiagg_with_subquery.m
+ -> Seq Scan on multiagg_with_subquery
Optimizer: Postgres query optimizer
-(13 rows)
+(11 rows)
select count(distinct j), count(distinct k), count(distinct m) from (select
j,k,m from multiagg_with_subquery group by j,k,m ) sub group by j;
count | count | count
diff --git a/src/test/regress/expected/gp_prepared_xacts.out
b/src/test/regress/expected/gp_prepared_xacts.out
index aa3facf93b2..7b58caf612e 100644
--- a/src/test/regress/expected/gp_prepared_xacts.out
+++ b/src/test/regress/expected/gp_prepared_xacts.out
@@ -4,4 +4,5 @@ PREPARE TRANSACTION 'foo_prep_xact';
ERROR: PREPARE TRANSACTION is not yet supported in Apache Cloudberry
-- PREPARE TRANSACTION should not work in utility-mode connections either
\! PGOPTIONS='-c gp_role=utility' psql -X regression -c "BEGIN; PREPARE
TRANSACTION 'foo_prep_xact';"
+BEGIN
ERROR: PREPARE TRANSACTION is not supported in utility mode
diff --git a/src/test/regress/expected/update_gp.out
b/src/test/regress/expected/update_gp.out
index f1aee972458..48e38bc8420 100644
--- a/src/test/regress/expected/update_gp.out
+++ b/src/test/regress/expected/update_gp.out
@@ -672,14 +672,15 @@ select * from s;
-- constraints in the planner.
create table nosplitupdate (a int) distributed by (a);
explain update nosplitupdate set a=0 where a=1 and a<1;
- QUERY PLAN
------------------------------------------------------------
- Update on nosplitupdate (cost=0.00..0.01 rows=1 width=0)
- -> Result (cost=0.00..0.01 rows=1 width=0)
- One-Time Filter: false
- Planning time: 0.271 ms
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------------
+ Update on nosplitupdate (cost=0.00..516.24 rows=0 width=0)
+ -> Explicit Redistribute Motion 1:3 (slice1; segments: 1)
(cost=0.00..516.24 rows=37 width=14)
+ -> Split (cost=0.00..515.50 rows=37 width=14)
+ -> Seq Scan on nosplitupdate (cost=0.00..515.50 rows=19
width=14)
+ Filter: ((a < 1) AND (a = 1))
Optimizer: Postgres query optimizer
-(5 rows)
+(6 rows)
-- test split-update when split-node's flow is entry
create table tsplit_entry (c int);
diff --git a/src/test/regress/expected/variadic_parameters.out
b/src/test/regress/expected/variadic_parameters.out
index 4a192120874..cea3e1af7a7 100644
--- a/src/test/regress/expected/variadic_parameters.out
+++ b/src/test/regress/expected/variadic_parameters.out
@@ -25,19 +25,19 @@ select * from print_name;
(3 rows)
select pg_get_viewdef('print_name');
- pg_get_viewdef
----------------------------------------------------------------------------------
- SELECT concat(' '::text, VARIADIC ARRAY[people.fname, people.lname]) AS
concat+
- FROM people
+
- WHERE (people.id < 790);
+ pg_get_viewdef
+-------------------------------------------------------------------
+ SELECT concat(' '::text, VARIADIC ARRAY[fname, lname]) AS concat+
+ FROM people +
+ WHERE (id < 790);
(1 row)
select pg_get_viewdef('print_name', true);
- pg_get_viewdef
----------------------------------------------------------------------------------
- SELECT concat(' '::text, VARIADIC ARRAY[people.fname, people.lname]) AS
concat+
- FROM people
+
- WHERE people.id < 790;
+ pg_get_viewdef
+-------------------------------------------------------------------
+ SELECT concat(' '::text, VARIADIC ARRAY[fname, lname]) AS concat+
+ FROM people +
+ WHERE id < 790;
(1 row)
drop view print_name;
diff --git a/src/test/regress/sql/createdb.sql
b/src/test/regress/sql/createdb.sql
index 7118513bb17..aa2fc2eef23 100644
--- a/src/test/regress/sql/createdb.sql
+++ b/src/test/regress/sql/createdb.sql
@@ -17,7 +17,7 @@ $$;
--
--CASE 0: createdb do well
--
-create database dowell;
+create database dowell STRATEGY = file_copy;
select force_mirrors_to_catch_up();
select count(*)=0 as result from
(select db_dirs(oid) from pg_database where datname = 'dowell') as foo;
@@ -41,7 +41,7 @@ select gp_inject_fault('create_db_after_file_copy', 'error',
dbid)
from gp_segment_configuration where content=0 and role='p';
-- should fail
-create database db_with_leftover_files;
+create database db_with_leftover_files STRATEGY = file_copy;;
-- Wait until replay_lsn = flush_lsn.
select force_mirrors_to_catch_up();
@@ -63,7 +63,7 @@ select gp_inject_fault('all', 'reset', dbid) from
gp_segment_configuration;
select gp_inject_fault('after_xlog_create_database', 'error', dbid)
from gp_segment_configuration where content=-1 and role='p';
-- should fail
-create database db2;
+create database db2 STRATEGY = file_copy;
select force_mirrors_to_catch_up();
@@ -83,7 +83,7 @@ select gp_inject_fault('all', 'reset', dbid) from
gp_segment_configuration;
select gp_inject_fault('after_xlog_create_database', 'error', dbid)
from gp_segment_configuration where content=0 and role='p';
-- should fail
-create database db3;
+create database db3 STRATEGY = file_copy;
select force_mirrors_to_catch_up();
@@ -105,7 +105,7 @@ from gp_segment_configuration where content=-1 and role='p';
select gp_inject_fault('end_prepare_two_phase', 'panic', dbid)
from gp_segment_configuration where content=0 and role='p';
-- should fail
-create database db4;
+create database db4 STRATEGY = file_copy;
select force_mirrors_to_catch_up();
diff --git a/src/test/regress/sql/disable_autovacuum.sql
b/src/test/regress/sql/disable_autovacuum.sql
index 20b1946c829..41e99458531 100644
--- a/src/test/regress/sql/disable_autovacuum.sql
+++ b/src/test/regress/sql/disable_autovacuum.sql
@@ -4,5 +4,5 @@ select gp_segment_id, pg_reload_conf() from gp_id union select
gp_segment_id, pg
-- The reason for restarting cbdb here is that if the subsequent
-- vacuum ao test(uao*_catalog_tables/threshold) encounters an
-- unfinished transaction, it will fail.
-\!gpstop -ari
+--\!gpstop -ari
-- end_ignore
\ No newline at end of file
diff --git a/src/test/regress/sql/gp_aggregates.sql
b/src/test/regress/sql/gp_aggregates.sql
index 1704b26c7ce..496990efded 100644
--- a/src/test/regress/sql/gp_aggregates.sql
+++ b/src/test/regress/sql/gp_aggregates.sql
@@ -123,11 +123,11 @@ create aggregate mysum_prefunc(int4) (
-- tweak settings to force multistage agg to be used
set gp_motion_cost_per_row = 1000;
set optimizer_force_multistage_agg = on;
-set force_parallel_mode = off;
+set debug_parallel_query = off;
select mysum_prefunc(a::int4) from aggtest;
reset gp_motion_cost_per_row;
reset optimizer_force_multistage_agg;
-reset force_parallel_mode;
+reset debug_parallel_query;
-- Test an aggregate with 'internal' transition type, and a combine function,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]