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 c552bbfffa0 Fix some answer files
c552bbfffa0 is described below

commit c552bbfffa08aa42f7ce5aefc5345620cb0a8ff8
Author: Jinbao Chen <[email protected]>
AuthorDate: Thu Mar 5 22:10:39 2026 -0500

    Fix some answer files
---
 src/test/regress/expected/enum.out                 | 170 ++++++++++-----------
 .../regress/expected/gpdist_legacy_opclasses.out   |  24 +--
 src/test/regress/expected/partition_prune.out      |   8 +-
 src/test/regress/sql/enum.sql                      |  22 +--
 src/test/regress/sql/gpdist_legacy_opclasses.sql   |   4 +-
 src/test/regress/sql/partition_prune.sql           |   2 +-
 6 files changed, 117 insertions(+), 113 deletions(-)

diff --git a/src/test/regress/expected/enum.out 
b/src/test/regress/expected/enum.out
index 40e7465e156..615e7781c7a 100644
--- a/src/test/regress/expected/enum.out
+++ b/src/test/regress/expected/enum.out
@@ -226,71 +226,71 @@ ORDER BY enumsortorder;
 --
 -- Basic table creation, row selection
 --
-CREATE TABLE enumtest (col rainbow);
-INSERT INTO enumtest values ('red'), ('orange'), ('yellow'), ('green');
-COPY enumtest FROM stdin;
+CREATE TABLE enumtest (i int, col rainbow);
+INSERT INTO enumtest values (1, 'red'), (2, 'orange'), (3, 'yellow'), (4, 
'green');
+COPY enumtest (i, col) FROM stdin;
 SELECT * FROM enumtest;
-  col   
---------
- red
- orange
- yellow
- green
- blue
- purple
+ i |  col   
+---+--------
+ 5 | blue
+ 6 | purple
+ 2 | orange
+ 3 | yellow
+ 4 | green
+ 1 | red
 (6 rows)
 
 --
 -- Operators, no index
 --
 SELECT * FROM enumtest WHERE col = 'orange';
-  col   
---------
- orange
+ i |  col   
+---+--------
+ 2 | orange
 (1 row)
 
 SELECT * FROM enumtest WHERE col <> 'orange' ORDER BY col;
-  col   
---------
- red
- yellow
- green
- blue
- purple
+ i |  col   
+---+--------
+ 1 | red
+ 3 | yellow
+ 4 | green
+ 5 | blue
+ 6 | purple
 (5 rows)
 
 SELECT * FROM enumtest WHERE col > 'yellow' ORDER BY col;
-  col   
---------
- green
- blue
- purple
+ i |  col   
+---+--------
+ 4 | green
+ 5 | blue
+ 6 | purple
 (3 rows)
 
 SELECT * FROM enumtest WHERE col >= 'yellow' ORDER BY col;
-  col   
---------
- yellow
- green
- blue
- purple
+ i |  col   
+---+--------
+ 3 | yellow
+ 4 | green
+ 5 | blue
+ 6 | purple
 (4 rows)
 
 SELECT * FROM enumtest WHERE col < 'green' ORDER BY col;
-  col   
---------
- red
- orange
- yellow
+ i |  col   
+---+--------
+ 1 | red
+ 2 | orange
+ 3 | yellow
 (3 rows)
 
 SELECT * FROM enumtest WHERE col <= 'green' ORDER BY col;
-  col   
---------
- red
- orange
- yellow
- green
+ i |  col   
+---+--------
+ 1 | red
+ 2 | orange
+ 3 | yellow
+ 4 | green
 (4 rows)
 
 --
@@ -339,53 +339,53 @@ SET enable_bitmapscan = off;
 --
 CREATE INDEX enumtest_btree ON enumtest USING btree (col);
 SELECT * FROM enumtest WHERE col = 'orange';
-  col   
---------
- orange
+ i |  col   
+---+--------
+ 2 | orange
 (1 row)
 
 SELECT * FROM enumtest WHERE col <> 'orange' ORDER BY col;
-  col   
---------
- red
- yellow
- green
- blue
- purple
+ i |  col   
+---+--------
+ 1 | red
+ 3 | yellow
+ 4 | green
+ 5 | blue
+ 6 | purple
 (5 rows)
 
 SELECT * FROM enumtest WHERE col > 'yellow' ORDER BY col;
-  col   
---------
- green
- blue
- purple
+ i |  col   
+---+--------
+ 4 | green
+ 5 | blue
+ 6 | purple
 (3 rows)
 
 SELECT * FROM enumtest WHERE col >= 'yellow' ORDER BY col;
-  col   
---------
- yellow
- green
- blue
- purple
+ i |  col   
+---+--------
+ 3 | yellow
+ 4 | green
+ 5 | blue
+ 6 | purple
 (4 rows)
 
 SELECT * FROM enumtest WHERE col < 'green' ORDER BY col;
-  col   
---------
- red
- orange
- yellow
+ i |  col   
+---+--------
+ 1 | red
+ 2 | orange
+ 3 | yellow
 (3 rows)
 
 SELECT * FROM enumtest WHERE col <= 'green' ORDER BY col;
-  col   
---------
- red
- orange
- yellow
- green
+ i |  col   
+---+--------
+ 1 | red
+ 2 | orange
+ 3 | yellow
+ 4 | green
 (4 rows)
 
 SELECT min(col) FROM enumtest;
@@ -412,9 +412,9 @@ DROP INDEX enumtest_btree;
 --
 CREATE INDEX enumtest_hash ON enumtest USING hash (col);
 SELECT * FROM enumtest WHERE col = 'orange';
-  col   
---------
- orange
+ i |  col   
+---+--------
+ 2 | orange
 (1 row)
 
 DROP INDEX enumtest_hash;
@@ -565,11 +565,11 @@ DROP FUNCTION echo_me(rainbow);
 --
 -- RI triggers on enum types
 --
-CREATE TABLE enumtest_parent (id rainbow PRIMARY KEY);
-CREATE TABLE enumtest_child (parent rainbow REFERENCES enumtest_parent);
-INSERT INTO enumtest_parent VALUES ('red');
-INSERT INTO enumtest_child VALUES ('red');
-INSERT INTO enumtest_child VALUES ('blue');  -- fail
+CREATE TABLE enumtest_parent (i int PRIMARY KEY, id rainbow);
+CREATE TABLE enumtest_child (i int REFERENCES enumtest_parent, parent rainbow);
+INSERT INTO enumtest_parent VALUES (1, 'red');
+INSERT INTO enumtest_child VALUES (1, 'red');
+INSERT INTO enumtest_child VALUES (2, 'blue');  -- fail
 -- start_ignore
 -- foreign keys are not checked in GPDB, hence these pass.
 -- end_ignore
@@ -578,9 +578,9 @@ DELETE FROM enumtest_parent;  -- fail
 -- cross-type RI should fail
 --
 CREATE TYPE bogus AS ENUM('good', 'bad', 'ugly');
-CREATE TABLE enumtest_bogus_child(parent bogus REFERENCES enumtest_parent);
+CREATE TABLE enumtest_bogus_child(i int, parent bogus REFERENCES 
enumtest_parent);
 ERROR:  foreign key constraint "enumtest_bogus_child_parent_fkey" cannot be 
implemented
-DETAIL:  Key columns "parent" and "id" are of incompatible types: bogus and 
rainbow.
+DETAIL:  Key columns "parent" and "i" are of incompatible types: bogus and 
integer.
 DROP TYPE bogus;
 -- check renaming a value
 ALTER TYPE rainbow RENAME VALUE 'red' TO 'crimson';
diff --git a/src/test/regress/expected/gpdist_legacy_opclasses.out 
b/src/test/regress/expected/gpdist_legacy_opclasses.out
index 58b353c86d7..5a182c0ece0 100644
--- a/src/test/regress/expected/gpdist_legacy_opclasses.out
+++ b/src/test/regress/expected/gpdist_legacy_opclasses.out
@@ -297,26 +297,30 @@ explain (costs off) select * from modern_int a inner join 
legacy_domain_over_int
 (9 rows)
 
 create type colors as enum ('red', 'green', 'blue');
-create table legacy_enum(color colors) distributed by(color cdbhash_enum_ops);
-insert into legacy_enum values ('red'), ('green'), ('blue');
+create table legacy_enum(col1 int, color colors) distributed by(col1);
+insert into legacy_enum values (1, 'red'), (2, 'green'), (3, 'blue');
 explain (costs off) select * from legacy_enum a inner join legacy_enum b on 
a.color = b.color;
                  QUERY PLAN                  
 ---------------------------------------------
  Gather Motion 3:1  (slice1; segments: 3)
    ->  Hash Join
          Hash Cond: (a.color = b.color)
-         ->  Seq Scan on legacy_enum a
+         ->  Redistribute Motion 3:3  (slice2; segments: 3)
+               Hash Key: a.color
+               ->  Seq Scan on legacy_enum a
          ->  Hash
-               ->  Seq Scan on legacy_enum b
+               ->  Redistribute Motion 3:3  (slice3; segments: 3)
+                     Hash Key: b.color
+                     ->  Seq Scan on legacy_enum b
  Optimizer: Postgres query optimizer
-(7 rows)
+(11 rows)
 
 select * from legacy_enum a inner join legacy_enum b on a.color = b.color;
- color | color 
--------+-------
- blue  | blue
- red   | red
- green | green
+ col1 | color | col1 | color 
+------+-------+------+-------
+    3 | blue  |    3 | blue
+    2 | green |    2 | green
+    1 | red   |    1 | red
 (3 rows)
 
 --
diff --git a/src/test/regress/expected/partition_prune.out 
b/src/test/regress/expected/partition_prune.out
index adb72e409f1..45a0a9198d6 100644
--- a/src/test/regress/expected/partition_prune.out
+++ b/src/test/regress/expected/partition_prune.out
@@ -4357,15 +4357,15 @@ explain (costs off) select * from pph_arrpart where a 
in ('{4, 5}', '{1}');
 drop table pph_arrpart;
 -- enum type list partition key
 create type pp_colors as enum ('green', 'blue', 'black');
-create table pp_enumpart (a pp_colors) partition by list (a);
+create table pp_enumpart (col1 int, a pp_colors) partition by list (a);
 create table pp_enumpart_green partition of pp_enumpart for values in 
('green');
 NOTICE:  table has parent, setting distribution columns to match parent table
 create table pp_enumpart_blue partition of pp_enumpart for values in ('blue');
 NOTICE:  table has parent, setting distribution columns to match parent table
 explain (costs off) select * from pp_enumpart where a = 'blue';
-                QUERY PLAN                
-------------------------------------------
- Gather Motion 1:1  (slice1; segments: 1)
+                   QUERY PLAN                   
+------------------------------------------------
+ Gather Motion 3:1  (slice1; segments: 3)
    ->  Seq Scan on pp_enumpart_blue pp_enumpart
          Filter: (a = 'blue'::pp_colors)
  Optimizer: Postgres query optimizer
diff --git a/src/test/regress/sql/enum.sql b/src/test/regress/sql/enum.sql
index c2d23b5ed68..bdf1c9b48f0 100644
--- a/src/test/regress/sql/enum.sql
+++ b/src/test/regress/sql/enum.sql
@@ -128,11 +128,11 @@ ORDER BY enumsortorder;
 --
 -- Basic table creation, row selection
 --
-CREATE TABLE enumtest (col rainbow);
-INSERT INTO enumtest values ('red'), ('orange'), ('yellow'), ('green');
-COPY enumtest FROM stdin;
-blue
-purple
+CREATE TABLE enumtest (i int, col rainbow);
+INSERT INTO enumtest values (1, 'red'), (2, 'orange'), (3, 'yellow'), (4, 
'green');
+COPY enumtest (i, col) FROM stdin;
+5      blue
+6      purple
 \.
 SELECT * FROM enumtest;
 
@@ -252,17 +252,17 @@ DROP FUNCTION echo_me(rainbow);
 --
 -- RI triggers on enum types
 --
-CREATE TABLE enumtest_parent (id rainbow PRIMARY KEY);
-CREATE TABLE enumtest_child (parent rainbow REFERENCES enumtest_parent);
-INSERT INTO enumtest_parent VALUES ('red');
-INSERT INTO enumtest_child VALUES ('red');
-INSERT INTO enumtest_child VALUES ('blue');  -- fail
+CREATE TABLE enumtest_parent (i int PRIMARY KEY, id rainbow);
+CREATE TABLE enumtest_child (i int REFERENCES enumtest_parent, parent rainbow);
+INSERT INTO enumtest_parent VALUES (1, 'red');
+INSERT INTO enumtest_child VALUES (1, 'red');
+INSERT INTO enumtest_child VALUES (2, 'blue');  -- fail
 DELETE FROM enumtest_parent;  -- fail
 --
 -- cross-type RI should fail
 --
 CREATE TYPE bogus AS ENUM('good', 'bad', 'ugly');
-CREATE TABLE enumtest_bogus_child(parent bogus REFERENCES enumtest_parent);
+CREATE TABLE enumtest_bogus_child(i int, parent bogus REFERENCES 
enumtest_parent);
 DROP TYPE bogus;
 
 -- check renaming a value
diff --git a/src/test/regress/sql/gpdist_legacy_opclasses.sql 
b/src/test/regress/sql/gpdist_legacy_opclasses.sql
index 2170e93c64f..78d31c1a92a 100644
--- a/src/test/regress/sql/gpdist_legacy_opclasses.sql
+++ b/src/test/regress/sql/gpdist_legacy_opclasses.sql
@@ -169,8 +169,8 @@ explain (costs off) select * from legacy_int a inner join 
legacy_domain_over_int
 explain (costs off) select * from modern_int a inner join 
legacy_domain_over_int b on a.id = b.id;
 
 create type colors as enum ('red', 'green', 'blue');
-create table legacy_enum(color colors) distributed by(color cdbhash_enum_ops);
-insert into legacy_enum values ('red'), ('green'), ('blue');
+create table legacy_enum(col1 int, color colors) distributed by(col1);
+insert into legacy_enum values (1, 'red'), (2, 'green'), (3, 'blue');
 
 explain (costs off) select * from legacy_enum a inner join legacy_enum b on 
a.color = b.color;
 select * from legacy_enum a inner join legacy_enum b on a.color = b.color;
diff --git a/src/test/regress/sql/partition_prune.sql 
b/src/test/regress/sql/partition_prune.sql
index 3655bc48722..ef2a1a73071 100644
--- a/src/test/regress/sql/partition_prune.sql
+++ b/src/test/regress/sql/partition_prune.sql
@@ -1035,7 +1035,7 @@ drop table pph_arrpart;
 
 -- enum type list partition key
 create type pp_colors as enum ('green', 'blue', 'black');
-create table pp_enumpart (a pp_colors) partition by list (a);
+create table pp_enumpart (col1 int, a pp_colors) partition by list (a);
 create table pp_enumpart_green partition of pp_enumpart for values in 
('green');
 create table pp_enumpart_blue partition of pp_enumpart for values in ('blue');
 explain (costs off) select * from pp_enumpart where a = 'blue';


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to