On Thu, Apr 26, 2018 at 9:04 AM, Haribabu Kommi
<kommi.harib...@gmail.com> wrote:
> The jitflags in the PlannedStmt structure of type "int", but in _out and
> _read functions it is treated as of "bool" type.
>
> WRITE_BOOL_FIELD(jitFlags);
> READ_BOOL_FIELD(jitFlags);
>
> I am thinking of it is a copy paste mistake as the other members around the
> initflags are of "bool" type or is there any specific reason to treat as
> "bool" type?

No, I don't see any. Here's patch for the same.

-- 
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company
From 95d025f09d3cc619b45fed5519685dd247c74252 Mon Sep 17 00:00:00 2001
From: Ashutosh Bapat <ashutosh.ba...@enterprisedb.com>
Date: Thu, 26 Apr 2018 18:58:39 +0530
Subject: [PATCH 3/3] Use READ/WRITE_INT_FIELD macro for jitFlags

jitFlags is declared as int in PlannerStmt but uses
READ/WRITE_BOOL_FIELD _read/_outPlannedStmt respectively.

Ashutosh Bapat, per suggestion from Haribabu Kommi
---
 src/backend/nodes/outfuncs.c  |    2 +-
 src/backend/nodes/readfuncs.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index 3991a0c..cbebabf 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -272,7 +272,7 @@ _outPlannedStmt(StringInfo str, const PlannedStmt *node)
 	WRITE_BOOL_FIELD(transientPlan);
 	WRITE_BOOL_FIELD(dependsOnRole);
 	WRITE_BOOL_FIELD(parallelModeNeeded);
-	WRITE_BOOL_FIELD(jitFlags);
+	WRITE_INT_FIELD(jitFlags);
 	WRITE_NODE_FIELD(planTree);
 	WRITE_NODE_FIELD(rtable);
 	WRITE_NODE_FIELD(resultRelations);
diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c
index c466b98..2826cec 100644
--- a/src/backend/nodes/readfuncs.c
+++ b/src/backend/nodes/readfuncs.c
@@ -1518,7 +1518,7 @@ _readPlannedStmt(void)
 	READ_BOOL_FIELD(transientPlan);
 	READ_BOOL_FIELD(dependsOnRole);
 	READ_BOOL_FIELD(parallelModeNeeded);
-	READ_BOOL_FIELD(jitFlags);
+	READ_INT_FIELD(jitFlags);
 	READ_NODE_FIELD(planTree);
 	READ_NODE_FIELD(rtable);
 	READ_NODE_FIELD(resultRelations);
-- 
1.7.9.5

Reply via email to