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 b6d5819d091 Fix errors for out/read Integer
b6d5819d091 is described below

commit b6d5819d091d8384d88cad0810ce32802dfeeb5a
Author: Jinbao Chen <[email protected]>
AuthorDate: Fri Nov 14 21:52:47 2025 +0800

    Fix errors for out/read Integer
---
 src/backend/nodes/outfast.c           |  4 ++--
 src/backend/nodes/readfast.c          |  8 ++++----
 src/test/regress/expected/inherit.out | 10 +++++-----
 src/test/regress/sql/inherit.sql      |  2 +-
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/backend/nodes/outfast.c b/src/backend/nodes/outfast.c
index 999e99f887d..54bab2b6f8c 100644
--- a/src/backend/nodes/outfast.c
+++ b/src/backend/nodes/outfast.c
@@ -551,7 +551,7 @@ _outInteger(StringInfo str, const Integer *node)
 {
        int16 vt = T_Integer;
        appendBinaryStringInfo(str, (const char *)&vt, sizeof(int16));
-       appendBinaryStringInfo(str, (const char *)&node->ival, sizeof(long));
+       appendBinaryStringInfo(str, (const char *)&node->ival, sizeof(int));
 }
 
 
@@ -573,7 +573,7 @@ _outBoolean(StringInfo str, const Boolean *node)
 {
        int16 vt = T_Boolean;
        appendBinaryStringInfo(str, (const char *)&vt, sizeof(int16));
-       appendBinaryStringInfo(str, (const char *)&node->boolval, sizeof(long));
+       appendBinaryStringInfo(str, (const char *)&node->boolval, sizeof(bool));
 }
 
 
diff --git a/src/backend/nodes/readfast.c b/src/backend/nodes/readfast.c
index ef8caba94d9..ccd091ecbf0 100644
--- a/src/backend/nodes/readfast.c
+++ b/src/backend/nodes/readfast.c
@@ -467,8 +467,8 @@ _readInteger(void)
 {
        READ_LOCALS(Integer);
 
-       memcpy(&local_node->ival, read_str_ptr, sizeof(long));
-       read_str_ptr += sizeof(long);
+       memcpy(&local_node->ival, read_str_ptr, sizeof(int));
+       read_str_ptr += sizeof(int);
 
        READ_DONE();
 }
@@ -478,8 +478,8 @@ _readBoolean(void)
 {
        READ_LOCALS(Boolean);
 
-       memcpy(&local_node->boolval, read_str_ptr, sizeof(long));
-       read_str_ptr += sizeof(long);
+       memcpy(&local_node->boolval, read_str_ptr, sizeof(bool));
+       read_str_ptr += sizeof(bool);
 
        READ_DONE();
 }
diff --git a/src/test/regress/expected/inherit.out 
b/src/test/regress/expected/inherit.out
index c7ab47c3138..08495a0c0f5 100644
--- a/src/test/regress/expected/inherit.out
+++ b/src/test/regress/expected/inherit.out
@@ -1931,19 +1931,19 @@ update inhpar i set (f1, f2) = (select i.f1, i.f2 || 
'-' from int4_tbl limit 1);
 ERROR:  can't split update for inherit table: inhpar (preptlist.c:139)
 update inhpar i set (f1, f2) = (select i.f1, i.f2 || '-' from int4_tbl limit 
1);
 ERROR:  can't split update for inherit table: inhpar (preptlist.c:139)
-select * from inhpar;
+select * from inhpar order by f1;
  f1 | f2 
 ----+----
+  1 | 1
   2 | 2
   3 | 3
   4 | 4
-  9 | 9
- 10 | 10
-  1 | 1
-  7 | 7
   5 | 5
   6 | 6
+  7 | 7
   8 | 8
+  9 | 9
+ 10 | 10
 (10 rows)
 
 drop table inhpar cascade;
diff --git a/src/test/regress/sql/inherit.sql b/src/test/regress/sql/inherit.sql
index 63254bd985c..9579ef6fc2d 100644
--- a/src/test/regress/sql/inherit.sql
+++ b/src/test/regress/sql/inherit.sql
@@ -705,7 +705,7 @@ insert into inhcld select x::text, x from 
generate_series(6,10) x;
 explain (verbose, costs off)
 update inhpar i set (f1, f2) = (select i.f1, i.f2 || '-' from int4_tbl limit 
1);
 update inhpar i set (f1, f2) = (select i.f1, i.f2 || '-' from int4_tbl limit 
1);
-select * from inhpar;
+select * from inhpar order by f1;
 
 drop table inhpar cascade;
 


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

Reply via email to