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 e1f2e4eab1f Fix some answer files
e1f2e4eab1f is described below
commit e1f2e4eab1f164f8d530628b9cf376df0d8331bb
Author: Jinbao Chen <[email protected]>
AuthorDate: Tue Feb 10 01:18:00 2026 +0800
Fix some answer files
---
.../regress/expected/alter_db_set_tablespace.out | 8 ++--
src/test/regress/expected/gp_tablespace.out | 43 +++++++++++++++++++---
src/test/regress/sql/alter_db_set_tablespace.sql | 5 ++-
3 files changed, 46 insertions(+), 10 deletions(-)
diff --git a/src/test/regress/expected/alter_db_set_tablespace.out
b/src/test/regress/expected/alter_db_set_tablespace.out
index c09a1634ec4..ddf9245638d 100644
--- a/src/test/regress/expected/alter_db_set_tablespace.out
+++ b/src/test/regress/expected/alter_db_set_tablespace.out
@@ -13,17 +13,19 @@ CREATE SCHEMA adst;
SET search_path TO adst,public;
-- start_ignore
CREATE LANGUAGE plpython3u;
+ERROR: extension "plpython3u" already exists
-- end_ignore
CREATE OR REPLACE FUNCTION
setup_tablespace_location_dir_for_test(tablespace_location_dir text) RETURNS
VOID AS $$
import os;
import shutil;
-import traceback
+import traceback;
+from pathlib import Path
try:
shutil.rmtree(tablespace_location_dir)
except OSError:
plpy.debug(traceback.format_exc())
plpy.debug('failed to remove tablespace location directory: %s' %
(tablespace_location_dir))
-os.mkdir(tablespace_location_dir)
+Path(tablespace_location_dir).mkdir(parents=True, exist_ok=True)
$$ LANGUAGE plpython3u;
\getenv abs_builddir PG_ABS_BUILDDIR
\set adst_source_tablespace_location :abs_builddir
'/testtablespace/adst_source'
@@ -1346,7 +1348,7 @@ DROP TABLESPACE adst_destination_tablespace;
DROP SCHEMA adst CASCADE;
DETAIL: drop cascades to function setup_tablespace_location_dir_for_test(text)
NOTICE: drop cascades to 4 other objects
-drop cascades to function setup()
+drop cascades to function setup(text,text)
drop cascades to function list_db_tablespace(text,text)
drop cascades to function stat_db_objects(text,text)
SELECT gp_inject_fault('all', 'reset', dbid) FROM gp_segment_configuration;
diff --git a/src/test/regress/expected/gp_tablespace.out
b/src/test/regress/expected/gp_tablespace.out
index 2355104517f..0f4267bbed9 100644
--- a/src/test/regress/expected/gp_tablespace.out
+++ b/src/test/regress/expected/gp_tablespace.out
@@ -74,7 +74,7 @@ SELECT pg_ls_dir('./pg_tblspc/' || oid) =
get_tablespace_version_directory_name(
FROM pg_tablespace WHERE spcname = 'testspace';
has_version_dir
-----------------
- f
+ t
(1 row)
-- Ensure mirrors have applied filesystem changes
@@ -84,6 +84,15 @@ SELECT force_mirrors_to_catch_up();
(1 row)
+\! ls $PG_ABS_SRCDIR/testtablespace
+1
+2
+3
+4
+5
+6
+7
+8
-- Test moving AO/AOCO tables from one tablespace to another.
CREATE TABLE ao_ts_table (id int4, t text) with (appendonly=true,
orientation=row) distributed by (id);
CREATE TABLE aoco_ts_table (id int4, t text) with (appendonly=true,
orientation=column) distributed by (id);
@@ -382,9 +391,8 @@ SELECT * FROM
WHERE a.versiondirs != get_tablespace_version_directory_name();
versiondirs
-------------------
- GPDB_2_302512051
GPDB_99_399999991
-(2 rows)
+(1 row)
SELECT count(*) FROM
(SELECT pg_ls_dir('pg_tblspc/' || oid) AS versiondirs
@@ -394,7 +402,7 @@ SELECT count(*) FROM
WHERE a.versiondirs = get_tablespace_version_directory_name();
count
-------
- 0
+ 1
(1 row)
-- Do not drop the dbid directory, nor the existing version directory if you
@@ -407,7 +415,31 @@ SELECT force_mirrors_to_catch_up();
(1 row)
--- Test alter tablespace: PG does not seem to test these.
+\! ls $PG_ABS_SRCDIR/testtablespace_existing_version_dir/*
+/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/1:
+GPDB_99_399999991
+
+/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/2:
+GPDB_99_399999991
+
+/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/3:
+GPDB_99_399999991
+
+/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/4:
+GPDB_99_399999991
+
+/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/5:
+GPDB_99_399999991
+
+/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/6:
+GPDB_99_399999991
+
+/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/7:
+GPDB_99_399999991
+
+/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/8:
+GPDB_99_399999991
+-- Test alter tablespace: PG does not seem to test these.
-- test SET & OWNER
ALTER TABLESPACE testspace_otherloc SET (random_page_cost=20.0);
SELECT spcoptions FROM pg_tablespace WHERE spcname = 'testspace_otherloc';
@@ -457,5 +489,6 @@ DROP TABLE tblspc_otherloc_heap;
DROP TABLESPACE testspace_otherloc;
CREATE TABLESPACE testspace_dir_empty LOCATION :'testtablespace';
CREATE TABLE t_dir_empty(a int);
+\! rm -rf $PG_ABS_SRCDIR/testtablespace
DROP TABLE IF EXISTS t_dir_empty;
DROP TABLESPACE testspace_dir_empty;
diff --git a/src/test/regress/sql/alter_db_set_tablespace.sql
b/src/test/regress/sql/alter_db_set_tablespace.sql
index 68a0189955d..50c27120b51 100644
--- a/src/test/regress/sql/alter_db_set_tablespace.sql
+++ b/src/test/regress/sql/alter_db_set_tablespace.sql
@@ -22,13 +22,14 @@ CREATE LANGUAGE plpython3u;
CREATE OR REPLACE FUNCTION
setup_tablespace_location_dir_for_test(tablespace_location_dir text) RETURNS
VOID AS $$
import os;
import shutil;
-import traceback
+import traceback;
+from pathlib import Path
try:
shutil.rmtree(tablespace_location_dir)
except OSError:
plpy.debug(traceback.format_exc())
plpy.debug('failed to remove tablespace location directory: %s' %
(tablespace_location_dir))
-os.mkdir(tablespace_location_dir)
+Path(tablespace_location_dir).mkdir(parents=True, exist_ok=True)
$$ LANGUAGE plpython3u;
\getenv abs_builddir PG_ABS_BUILDDIR
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]