This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch merge-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git

commit 794570c2830e3b8a72049fcc01b55200e4e8b3e9
Author: Himanshu Pandey <[email protected]>
AuthorDate: Mon Sep 19 15:01:00 2022 -0700

    Fix compilation for GP7
---
 external-table/src/pxfheaders.c | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c
index a1969299..bfd0fa44 100644
--- a/external-table/src/pxfheaders.c
+++ b/external-table/src/pxfheaders.c
@@ -512,7 +512,7 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
        // pi_varNumbers is not available anymore in the postgters code
        // https://doxygen.postgresql.org/structProjectionInfo.html
        //int                           *varNumbers = projInfo->pi_varNumbers;
-#if PG_VERSION_NUM < 120000
+#if PG_VERSION_NUM < 120000 // This will work for 6.x and lower versions of 
GPDB
     int                                *varNumbers = projInfo->pi_varNumbers;
     List *targetList = projInfo->pi_targetlist;
 #else
@@ -576,14 +576,18 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
        }
 
        number = numTargetList +
-#if PG_VERSION_NUM >= 90400 && PG_VERSION_NUM < 120000
-               // FIXME: Commenting this out for compilation success
-               // pi_numSimpleVars is not available anymore in the postgters 
12 code
-               // https://doxygen.postgresql.org/structProjectionInfo.html
-               projInfo->pi_numSimpleVars +
-#else
-               numSimpleVars +
+#if PG_VERSION_NUM < 120000
+
+    #if PG_VERSION_NUM >= 90400
+            // FIXME: Commenting this out for compilation success
+            // pi_numSimpleVars is not available anymore in the postgters 12 
code
+            // https://doxygen.postgresql.org/structProjectionInfo.html
+            projInfo->pi_numSimpleVars +
+    #else
+            numSimpleVars +
+    #endif
 #endif
+
                list_length(qualsAttributes);
        if (number == 0)
                return;
@@ -594,10 +598,16 @@ add_projection_desc_httpheaders(CHURL_HEADERS headers,
        pg_ltoa(number, long_number);
        churl_headers_append(headers, "X-GP-ATTRS-PROJ", long_number);
 
-#if PG_VERSION_NUM >=90400
-       /* FIXME: commenting out to get compile to work */
-       //for (i = 0; i < projInfo->pi_numSimpleVars; i++)
-       for (i = 0; i < projInfo->pi_numSimpleVars; i++)
+
+#if PG_VERSION_NUM >= 90400
+
+    #if PG_VERSION_NUM >= 120000
+        for (i = 0; i < sizeof(targetList) ; i++)
+    #else
+        /* FIXME: commenting out to get compile to work */
+        //for (i = 0; i < projInfo->pi_numSimpleVars; i++)
+        for (i = 0; i < projInfo->pi_numSimpleVars; i++)
+    #endif
 #else
        for (i = 0; varNumbers && i < numSimpleVars; i++)
        {


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

Reply via email to