Skip to content

Commit bd3fb36

Browse files
avaminglimy-ship-it
authored andcommitted
Fix serialization of expr AEXPR_NOT_DISTINCT.
It is introduced by commit Import Greenplum source code. Forget to read/out that expr them. Authored-by: Zhang Mingli avamingli@gmail.com
1 parent b72c1f7 commit bd3fb36

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

src/backend/nodes/outfast.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,10 @@ _outAExpr(StringInfo str, A_Expr *node)
491491
break;
492492
case AEXPR_DISTINCT:
493493

494+
WRITE_NODE_FIELD(name);
495+
break;
496+
case AEXPR_NOT_DISTINCT:
497+
494498
WRITE_NODE_FIELD(name);
495499
break;
496500
case AEXPR_NULLIF:

src/backend/nodes/readfast.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,9 @@ _readAExpr(void)
556556
break;
557557
case AEXPR_DISTINCT:
558558

559+
READ_NODE_FIELD(name);
560+
break;
561+
case AEXPR_NOT_DISTINCT:
559562
READ_NODE_FIELD(name);
560563
break;
561564
case AEXPR_NULLIF:

src/test/regress/expected/create_table.out

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,6 +1282,10 @@ CREATE UNLOGGED TABLE unlogged_toast (a text);
12821282
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table.
12831283
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
12841284
TRUNCATE unlogged_toast;
1285+
-- test https://github.com/cloudberrydb/cloudberrydb/issues/595
1286+
CREATE TABLE t_issue_595(c0 DECIMAL UNIQUE DEFAULT (0.059636344153715326) PRIMARY KEY,
1287+
c1 money CHECK (((t_issue_595.c1)IS NOT DISTINCT FROM(CAST(0.6099821 AS MONEY)))) NULL, c2 TEXT );
1288+
DROP TABLE t_issue_595;
12851289
-- tests of column drop with partition tables and indexes using
12861290
-- predicates and expressions.
12871291
create table part_column_drop (

src/test/regress/sql/create_table.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,11 @@ drop table defcheck;
962962
CREATE UNLOGGED TABLE unlogged_toast (a text);
963963
TRUNCATE unlogged_toast;
964964

965+
-- test https://github.com/cloudberrydb/cloudberrydb/issues/595
966+
CREATE TABLE t_issue_595(c0 DECIMAL UNIQUE DEFAULT (0.059636344153715326) PRIMARY KEY,
967+
c1 money CHECK (((t_issue_595.c1)IS NOT DISTINCT FROM(CAST(0.6099821 AS MONEY)))) NULL, c2 TEXT );
968+
DROP TABLE t_issue_595;
969+
965970
-- tests of column drop with partition tables and indexes using
966971
-- predicates and expressions.
967972
create table part_column_drop (

0 commit comments

Comments
 (0)