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

mtaha pushed a commit to branch PG18
in repository https://gitbox.apache.org/repos/asf/age.git


The following commit(s) were added to refs/heads/PG18 by this push:
     new 146bf380 PG18 port for AGE (#2251)
146bf380 is described below

commit 146bf38035725004ced7f52ba4c484592e25f53a
Author: Krishnakumar R (KK) <[email protected]>
AuthorDate: Tue Nov 25 07:25:12 2025 -0800

    PG18 port for AGE (#2251)
    
    * [PG18 port][Set1] Fix header dependencies and use TupleDescAttr macro
    
    - Include executor/executor.h for PG18 header reorganization and use
      TupleDescAttr() accessor macro instead of direct attrs[] access.
    
    * [PG18 port][Set2] Adapt to expandRTE signature change and pg_noreturn
    
    - Add VarReturningType parameter to expandRTE() calls using 
VAR_RETURNING_DEFAULT.
    - Replace pg_attribute_noreturn() with pg_noreturn prefix specifier.
    
    * [PG18 port][Set3] Fix double ExecOpenIndices call for PG18 compatibility
    
    - PG18 enforces stricter assertions in ExecOpenIndices, requiring
      ri_IndexRelationDescs to be NULL when called.
    
    - In update_entity_tuple(), indices may already be opened by the
      caller (create_entity_result_rel_info), causing assertion failures.
    
    - Add a check to only open indices if not already open, and track
      ownership with a boolean flag to ensure we only close what we opened.
    
    - Found when regression tests failed with assertions, which this change
      resolves.
    
    * [PG18 port][Set4] Update regression test expected output for ordering
    
    PG18's implementation changes result in different row ordering for
    queries without explicit ORDER BY clauses. Update expected output
    files to reflect the new ordering while maintaining identical
    result content.
    
    * [PG18 port][Set5] Address review comments - coding standard fix
    
    Note: Assisted by GitHub Copilot Agent mode.
---
 regress/expected/cypher_match.out     | 48 +++++++++++++++++------------------
 regress/expected/expr.out             | 24 +++++++++---------
 src/backend/catalog/ag_label.c        |  1 +
 src/backend/executor/cypher_create.c  |  2 ++
 src/backend/executor/cypher_delete.c  |  3 ++-
 src/backend/executor/cypher_merge.c   |  2 ++
 src/backend/executor/cypher_set.c     | 29 ++++++++++++++++-----
 src/backend/executor/cypher_utils.c   |  1 +
 src/backend/parser/cypher_clause.c    |  4 +--
 src/backend/utils/adt/agtype_parser.c |  8 +++---
 10 files changed, 72 insertions(+), 50 deletions(-)

diff --git a/regress/expected/cypher_match.out 
b/regress/expected/cypher_match.out
index e83ba3b9..ad5a07d0 100644
--- a/regress/expected/cypher_match.out
+++ b/regress/expected/cypher_match.out
@@ -88,8 +88,8 @@ SELECT * FROM cypher('cypher_match', $$
 $$) AS (a agtype);
                                         a                                      
   
 
----------------------------------------------------------------------------------
- {"id": 1125899906842625, "label": "v1", "properties": {"id": 
"initial"}}::vertex
  {"id": 1125899906842627, "label": "v1", "properties": {"id": "end"}}::vertex
+ {"id": 1125899906842625, "label": "v1", "properties": {"id": 
"initial"}}::vertex
 (2 rows)
 
 SELECT * FROM cypher('cypher_match', $$
@@ -97,8 +97,8 @@ SELECT * FROM cypher('cypher_match', $$
 $$) AS (a agtype);
                                         a                                      
   
 
----------------------------------------------------------------------------------
- {"id": 1125899906842625, "label": "v1", "properties": {"id": 
"initial"}}::vertex
  {"id": 1125899906842627, "label": "v1", "properties": {"id": "end"}}::vertex
+ {"id": 1125899906842625, "label": "v1", "properties": {"id": 
"initial"}}::vertex
 (2 rows)
 
 SELECT * FROM cypher('cypher_match', $$
@@ -132,10 +132,10 @@ SELECT * FROM cypher('cypher_match', $$
 $$) AS (a agtype);
                                                              a                 
                                            
 
---------------------------------------------------------------------------------------------------------------------------
- {"id": 1407374883553281, "label": "e1", "end_id": 1125899906842627, 
"start_id": 1125899906842626, "properties": {}}::edge
- {"id": 1407374883553281, "label": "e1", "end_id": 1125899906842627, 
"start_id": 1125899906842626, "properties": {}}::edge
  {"id": 1407374883553282, "label": "e1", "end_id": 1125899906842626, 
"start_id": 1125899906842625, "properties": {}}::edge
+ {"id": 1407374883553281, "label": "e1", "end_id": 1125899906842627, 
"start_id": 1125899906842626, "properties": {}}::edge
  {"id": 1407374883553282, "label": "e1", "end_id": 1125899906842626, 
"start_id": 1125899906842625, "properties": {}}::edge
+ {"id": 1407374883553281, "label": "e1", "end_id": 1125899906842627, 
"start_id": 1125899906842626, "properties": {}}::edge
 (4 rows)
 
 SELECT * FROM cypher('cypher_match', $$
@@ -143,10 +143,10 @@ SELECT * FROM cypher('cypher_match', $$
 $$) AS (a agtype);
                                                              a                 
                                            
 
---------------------------------------------------------------------------------------------------------------------------
- {"id": 1407374883553282, "label": "e1", "end_id": 1125899906842626, 
"start_id": 1125899906842625, "properties": {}}::edge
- {"id": 1407374883553282, "label": "e1", "end_id": 1125899906842626, 
"start_id": 1125899906842625, "properties": {}}::edge
  {"id": 1407374883553281, "label": "e1", "end_id": 1125899906842627, 
"start_id": 1125899906842626, "properties": {}}::edge
  {"id": 1407374883553281, "label": "e1", "end_id": 1125899906842627, 
"start_id": 1125899906842626, "properties": {}}::edge
+ {"id": 1407374883553282, "label": "e1", "end_id": 1125899906842626, 
"start_id": 1125899906842625, "properties": {}}::edge
+ {"id": 1407374883553282, "label": "e1", "end_id": 1125899906842626, 
"start_id": 1125899906842625, "properties": {}}::edge
 (4 rows)
 
 SELECT * FROM cypher('cypher_match', $$
@@ -165,8 +165,8 @@ SELECT * FROM cypher('cypher_match', $$
 $$) AS (a agtype);
                                                              a                 
                                            
 
---------------------------------------------------------------------------------------------------------------------------
- {"id": 1407374883553282, "label": "e1", "end_id": 1125899906842626, 
"start_id": 1125899906842625, "properties": {}}::edge
  {"id": 1407374883553281, "label": "e1", "end_id": 1125899906842627, 
"start_id": 1125899906842626, "properties": {}}::edge
+ {"id": 1407374883553282, "label": "e1", "end_id": 1125899906842626, 
"start_id": 1125899906842625, "properties": {}}::edge
 (2 rows)
 
 SELECT * FROM cypher('cypher_match', $$
@@ -174,8 +174,8 @@ SELECT * FROM cypher('cypher_match', $$
 $$) AS (a agtype);
                                         a                                      
   
 
----------------------------------------------------------------------------------
- {"id": 1125899906842627, "label": "v1", "properties": {"id": "end"}}::vertex
  {"id": 1125899906842625, "label": "v1", "properties": {"id": 
"initial"}}::vertex
+ {"id": 1125899906842627, "label": "v1", "properties": {"id": "end"}}::vertex
 (2 rows)
 
 -- Right Path Test
@@ -348,10 +348,10 @@ SELECT * FROM cypher('cypher_match', $$
 $$) AS (i agtype);
                                         i                                      
   
 
----------------------------------------------------------------------------------
- {"id": 1688849860263939, "label": "v2", "properties": {"id": "end"}}::vertex
- {"id": 1688849860263938, "label": "v2", "properties": {"id": 
"middle"}}::vertex
  {"id": 1688849860263938, "label": "v2", "properties": {"id": 
"middle"}}::vertex
+ {"id": 1688849860263939, "label": "v2", "properties": {"id": "end"}}::vertex
  {"id": 1688849860263937, "label": "v2", "properties": {"id": 
"initial"}}::vertex
+ {"id": 1688849860263938, "label": "v2", "properties": {"id": 
"middle"}}::vertex
 (4 rows)
 
 SELECT * FROM cypher('cypher_match', $$
@@ -537,18 +537,18 @@ SELECT * FROM cypher('cypher_match', $$
 $$) AS (i agtype, b agtype, c agtype);
  i |     b     |     c     
 ---+-----------+-----------
-   | "end"     | "middle"
- 0 | "end"     | "middle"
- 1 | "end"     | "middle"
    | "middle"  | "end"
  0 | "middle"  | "end"
  1 | "middle"  | "end"
-   | "middle"  | "initial"
- 0 | "middle"  | "initial"
- 1 | "middle"  | "initial"
+   | "end"     | "middle"
+ 0 | "end"     | "middle"
+ 1 | "end"     | "middle"
    | "initial" | "middle"
  0 | "initial" | "middle"
  1 | "initial" | "middle"
+   | "middle"  | "initial"
+ 0 | "middle"  | "initial"
+ 1 | "middle"  | "initial"
 (12 rows)
 
 SELECT * FROM cypher('cypher_match', $$
@@ -558,18 +558,18 @@ SELECT * FROM cypher('cypher_match', $$
 $$) AS (i agtype,  c agtype);
  i |     c     
 ---+-----------
-   | "middle"
- 0 | "middle"
- 1 | "middle"
    | "end"
  0 | "end"
  1 | "end"
-   | "initial"
- 0 | "initial"
- 1 | "initial"
    | "middle"
  0 | "middle"
  1 | "middle"
+   | "middle"
+ 0 | "middle"
+ 1 | "middle"
+   | "initial"
+ 0 | "initial"
+ 1 | "initial"
 (12 rows)
 
 --
@@ -2407,15 +2407,15 @@ SELECT * FROM cypher('cypher_match', $$ MATCH (a 
{name:a.name}) MATCH (a {age:a.
 SELECT * FROM cypher('cypher_match', $$ MATCH p=(a)-[u {relationship: 
u.relationship}]->(b) RETURN p $$) as (a agtype);
                                                                                
                                                                                
      a                                                                         
                                                                                
            
 
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- [{"id": 281474976710659, "label": "", "properties": {"age": 3, "name": 
"orphan"}}::vertex, {"id": 4785074604081154, "label": "knows", "end_id": 
281474976710666, "start_id": 281474976710659, "properties": {"years": 4, 
"relationship": "enemies"}}::edge, {"id": 281474976710666, "label": "", 
"properties": {"age": 6}}::vertex]::path
  [{"id": 281474976710661, "label": "", "properties": {"age": 4, "name": 
"T"}}::vertex, {"id": 4785074604081153, "label": "knows", "end_id": 
281474976710666, "start_id": 281474976710661, "properties": {"years": 3, 
"relationship": "friends"}}::edge, {"id": 281474976710666, "label": "", 
"properties": {"age": 6}}::vertex]::path
+ [{"id": 281474976710659, "label": "", "properties": {"age": 3, "name": 
"orphan"}}::vertex, {"id": 4785074604081154, "label": "knows", "end_id": 
281474976710666, "start_id": 281474976710659, "properties": {"years": 4, 
"relationship": "enemies"}}::edge, {"id": 281474976710666, "label": "", 
"properties": {"age": 6}}::vertex]::path
 (2 rows)
 
 SELECT * FROM cypher('cypher_match', $$ MATCH p=(a)-[u {relationship: 
u.relationship, years: u.years}]->(b) RETURN p $$) as (a agtype);
                                                                                
                                                                                
      a                                                                         
                                                                                
            
 
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- [{"id": 281474976710659, "label": "", "properties": {"age": 3, "name": 
"orphan"}}::vertex, {"id": 4785074604081154, "label": "knows", "end_id": 
281474976710666, "start_id": 281474976710659, "properties": {"years": 4, 
"relationship": "enemies"}}::edge, {"id": 281474976710666, "label": "", 
"properties": {"age": 6}}::vertex]::path
  [{"id": 281474976710661, "label": "", "properties": {"age": 4, "name": 
"T"}}::vertex, {"id": 4785074604081153, "label": "knows", "end_id": 
281474976710666, "start_id": 281474976710661, "properties": {"years": 3, 
"relationship": "friends"}}::edge, {"id": 281474976710666, "label": "", 
"properties": {"age": 6}}::vertex]::path
+ [{"id": 281474976710659, "label": "", "properties": {"age": 3, "name": 
"orphan"}}::vertex, {"id": 4785074604081154, "label": "knows", "end_id": 
281474976710666, "start_id": 281474976710659, "properties": {"years": 4, 
"relationship": "enemies"}}::edge, {"id": 281474976710666, "label": "", 
"properties": {"age": 6}}::vertex]::path
 (2 rows)
 
 SELECT * FROM cypher('cypher_match', $$ MATCH p=(a {name:a.name})-[u 
{relationship: u.relationship}]->(b {age:b.age}) RETURN p $$) as (a agtype);
diff --git a/regress/expected/expr.out b/regress/expected/expr.out
index 513ea142..20c9e95f 100644
--- a/regress/expected/expr.out
+++ b/regress/expected/expr.out
@@ -2644,10 +2644,10 @@ SELECT * FROM cypher('expr', $$ MATCH (v) RETURN v $$) 
AS (expression agtype);
 SELECT * FROM cypher('expr', $$ MATCH ()-[e]-() RETURN e $$) AS (expression 
agtype);
                                                         expression             
                                            
 
---------------------------------------------------------------------------------------------------------------------------
- {"id": 1407374883553281, "label": "e1", "end_id": 1125899906842627, 
"start_id": 1125899906842626, "properties": {}}::edge
- {"id": 1407374883553281, "label": "e1", "end_id": 1125899906842627, 
"start_id": 1125899906842626, "properties": {}}::edge
  {"id": 1407374883553282, "label": "e1", "end_id": 1125899906842626, 
"start_id": 1125899906842625, "properties": {}}::edge
+ {"id": 1407374883553281, "label": "e1", "end_id": 1125899906842627, 
"start_id": 1125899906842626, "properties": {}}::edge
  {"id": 1407374883553282, "label": "e1", "end_id": 1125899906842626, 
"start_id": 1125899906842625, "properties": {}}::edge
+ {"id": 1407374883553281, "label": "e1", "end_id": 1125899906842627, 
"start_id": 1125899906842626, "properties": {}}::edge
 (4 rows)
 
 -- id()
@@ -2656,10 +2656,10 @@ SELECT * FROM cypher('expr', $$
 $$) AS (id agtype);
         id        
 ------------------
- 1407374883553281
- 1407374883553281
  1407374883553282
+ 1407374883553281
  1407374883553282
+ 1407374883553281
 (4 rows)
 
 SELECT * FROM cypher('expr', $$
@@ -2698,10 +2698,10 @@ SELECT * FROM cypher('expr', $$
 $$) AS (start_id agtype);
      start_id     
 ------------------
- 1125899906842626
- 1125899906842626
  1125899906842625
+ 1125899906842626
  1125899906842625
+ 1125899906842626
 (4 rows)
 
 -- should return null
@@ -2731,10 +2731,10 @@ SELECT * FROM cypher('expr', $$
 $$) AS (end_id agtype);
       end_id      
 ------------------
- 1125899906842627
- 1125899906842627
  1125899906842626
+ 1125899906842627
  1125899906842626
+ 1125899906842627
 (4 rows)
 
 -- should return null
@@ -2764,10 +2764,10 @@ SELECT * FROM cypher('expr', $$
 $$) AS (id agtype, start_id agtype, startNode agtype);
         id        |     start_id     |                                    
startnode                                     
 
------------------+------------------+----------------------------------------------------------------------------------
- 1407374883553281 | 1125899906842626 | {"id": 1125899906842626, "label": "v1", 
"properties": {"id": "middle"}}::vertex
- 1407374883553281 | 1125899906842626 | {"id": 1125899906842626, "label": "v1", 
"properties": {"id": "middle"}}::vertex
  1407374883553282 | 1125899906842625 | {"id": 1125899906842625, "label": "v1", 
"properties": {"id": "initial"}}::vertex
+ 1407374883553281 | 1125899906842626 | {"id": 1125899906842626, "label": "v1", 
"properties": {"id": "middle"}}::vertex
  1407374883553282 | 1125899906842625 | {"id": 1125899906842625, "label": "v1", 
"properties": {"id": "initial"}}::vertex
+ 1407374883553281 | 1125899906842626 | {"id": 1125899906842626, "label": "v1", 
"properties": {"id": "middle"}}::vertex
 (4 rows)
 
 -- should return null
@@ -2797,10 +2797,10 @@ SELECT * FROM cypher('expr', $$
 $$) AS (id agtype, end_id agtype, endNode agtype);
         id        |      end_id      |                                     
endnode                                     
 
------------------+------------------+---------------------------------------------------------------------------------
- 1407374883553281 | 1125899906842627 | {"id": 1125899906842627, "label": "v1", 
"properties": {"id": "end"}}::vertex
- 1407374883553281 | 1125899906842627 | {"id": 1125899906842627, "label": "v1", 
"properties": {"id": "end"}}::vertex
  1407374883553282 | 1125899906842626 | {"id": 1125899906842626, "label": "v1", 
"properties": {"id": "middle"}}::vertex
+ 1407374883553281 | 1125899906842627 | {"id": 1125899906842627, "label": "v1", 
"properties": {"id": "end"}}::vertex
  1407374883553282 | 1125899906842626 | {"id": 1125899906842626, "label": "v1", 
"properties": {"id": "middle"}}::vertex
+ 1407374883553281 | 1125899906842627 | {"id": 1125899906842627, "label": "v1", 
"properties": {"id": "end"}}::vertex
 (4 rows)
 
 -- should return null
diff --git a/src/backend/catalog/ag_label.c b/src/backend/catalog/ag_label.c
index b6dcf77a..54c31ef3 100644
--- a/src/backend/catalog/ag_label.c
+++ b/src/backend/catalog/ag_label.c
@@ -21,6 +21,7 @@
 
 #include "access/genam.h"
 #include "catalog/indexing.h"
+#include "executor/executor.h"
 #include "nodes/makefuncs.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
diff --git a/src/backend/executor/cypher_create.c 
b/src/backend/executor/cypher_create.c
index 2091ea29..2031fe8d 100644
--- a/src/backend/executor/cypher_create.c
+++ b/src/backend/executor/cypher_create.c
@@ -19,6 +19,8 @@
 
 #include "postgres.h"
 
+#include "executor/executor.h"
+
 #include "catalog/ag_label.h"
 #include "executor/cypher_executor.h"
 #include "executor/cypher_utils.h"
diff --git a/src/backend/executor/cypher_delete.c 
b/src/backend/executor/cypher_delete.c
index 6bb86983..7e10d9af 100644
--- a/src/backend/executor/cypher_delete.c
+++ b/src/backend/executor/cypher_delete.c
@@ -19,6 +19,7 @@
 
 #include "postgres.h"
 
+#include "executor/executor.h"
 #include "storage/bufmgr.h"
 #include "common/hashfn.h"
 
@@ -257,7 +258,7 @@ static agtype_value *extract_entity(CustomScanState *node,
     tupleDescriptor = scanTupleSlot->tts_tupleDescriptor;
 
     /* type checking, make sure the entity is an agtype vertex or edge */
-    if (tupleDescriptor->attrs[entity_position -1].atttypid != AGTYPEOID)
+    if (TupleDescAttr(tupleDescriptor, entity_position -1)->atttypid != 
AGTYPEOID)
         ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
                 errmsg("DELETE clause can only delete agtype")));
 
diff --git a/src/backend/executor/cypher_merge.c 
b/src/backend/executor/cypher_merge.c
index 9136825a..6cfa70d4 100644
--- a/src/backend/executor/cypher_merge.c
+++ b/src/backend/executor/cypher_merge.c
@@ -19,6 +19,8 @@
 
 #include "postgres.h"
 
+#include "executor/executor.h"
+
 #include "catalog/ag_label.h"
 #include "executor/cypher_executor.h"
 #include "executor/cypher_utils.h"
diff --git a/src/backend/executor/cypher_set.c 
b/src/backend/executor/cypher_set.c
index d1837fb1..9fd599ee 100644
--- a/src/backend/executor/cypher_set.c
+++ b/src/backend/executor/cypher_set.c
@@ -19,6 +19,7 @@
 
 #include "postgres.h"
 
+#include "executor/executor.h"
 #include "storage/bufmgr.h"
 
 #include "executor/cypher_executor.h"
@@ -102,6 +103,7 @@ static HeapTuple update_entity_tuple(ResultRelInfo 
*resultRelInfo,
     TM_Result   result;
     CommandId cid = GetCurrentCommandId(true);
     ResultRelInfo **saved_resultRels = estate->es_result_relations;
+    bool close_indices = false;
 
     estate->es_result_relations = &resultRelInfo;
 
@@ -113,7 +115,16 @@ static HeapTuple update_entity_tuple(ResultRelInfo 
*resultRelInfo,
 
     if (lock_result == TM_Ok)
     {
-        ExecOpenIndices(resultRelInfo, false);
+        /*
+         * Open indices if not already open. The resultRelInfo may already
+         * have indices opened by the caller (e.g., 
create_entity_result_rel_info),
+         * so only open if needed and track that we did so for cleanup.
+         */
+        if (resultRelInfo->ri_IndexRelationDescs == NULL)
+        {
+            ExecOpenIndices(resultRelInfo, false);
+            close_indices = true;
+        }
         ExecStoreVirtualTuple(elemTupleSlot);
         tuple = ExecFetchSlotHeapTuple(elemTupleSlot, true, NULL);
         tuple->t_self = old_tuple->t_self;
@@ -141,7 +152,10 @@ static HeapTuple update_entity_tuple(ResultRelInfo 
*resultRelInfo,
                          errmsg("tuple to be updated was already modified")));
             }
 
-            ExecCloseIndices(resultRelInfo);
+            if (close_indices)
+            {
+                ExecCloseIndices(resultRelInfo);
+            }
             estate->es_result_relations = saved_resultRels;
 
             return tuple;
@@ -160,7 +174,10 @@ static HeapTuple update_entity_tuple(ResultRelInfo 
*resultRelInfo,
                                 (update_indexes == TU_Summarizing));
         }
 
-        ExecCloseIndices(resultRelInfo);
+        if (close_indices)
+        {
+            ExecCloseIndices(resultRelInfo);
+        }
     }
     else if (lock_result == TM_SelfModified)
     {
@@ -310,7 +327,7 @@ static void update_all_paths(CustomScanState *node, graphid 
id,
         agtype_value *original_entity_value;
 
         /* skip nulls */
-        if (scanTupleSlot->tts_tupleDescriptor->attrs[i].atttypid != AGTYPEOID)
+        if (TupleDescAttr(scanTupleSlot->tts_tupleDescriptor, i)->atttypid != 
AGTYPEOID)
         {
             continue;
         }
@@ -414,7 +431,7 @@ static void process_update_list(CustomScanState *node)
             continue;
         }
 
-        if 
(scanTupleSlot->tts_tupleDescriptor->attrs[update_item->entity_position 
-1].atttypid != AGTYPEOID)
+        if (TupleDescAttr(scanTupleSlot->tts_tupleDescriptor, 
update_item->entity_position -1)->atttypid != AGTYPEOID)
         {
             ereport(ERROR,
                     (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
@@ -588,7 +605,7 @@ static void process_update_list(CustomScanState *node)
         }
 
         estate->es_snapshot->curcid = cid;
-        /* close relation */
+        /* close relation */        
         ExecCloseIndices(resultRelInfo);
         table_close(resultRelInfo->ri_RelationDesc, RowExclusiveLock);
 
diff --git a/src/backend/executor/cypher_utils.c 
b/src/backend/executor/cypher_utils.c
index c8d56883..d7a55f70 100644
--- a/src/backend/executor/cypher_utils.c
+++ b/src/backend/executor/cypher_utils.c
@@ -24,6 +24,7 @@
 
 #include "postgres.h"
 
+#include "executor/executor.h"
 #include "nodes/makefuncs.h"
 #include "parser/parse_relation.h"
 
diff --git a/src/backend/parser/cypher_clause.c 
b/src/backend/parser/cypher_clause.c
index 468706a8..971f8c3d 100644
--- a/src/backend/parser/cypher_clause.c
+++ b/src/backend/parser/cypher_clause.c
@@ -2585,9 +2585,9 @@ static void get_res_cols(ParseState *pstate, 
ParseNamespaceItem *l_pnsi,
     List *colnames = NIL;
     List *colvars = NIL;
 
-    expandRTE(l_pnsi->p_rte, l_pnsi->p_rtindex, 0, -1, false,
+    expandRTE(l_pnsi->p_rte, l_pnsi->p_rtindex, 0, VAR_RETURNING_DEFAULT, -1, 
false,
               &l_colnames, &l_colvars);
-    expandRTE(r_pnsi->p_rte, r_pnsi->p_rtindex, 0, -1, false,
+    expandRTE(r_pnsi->p_rte, r_pnsi->p_rtindex, 0, VAR_RETURNING_DEFAULT, -1, 
false,
               &r_colnames, &r_colvars);
 
     /* add in all colnames and colvars from the l_rte. */
diff --git a/src/backend/utils/adt/agtype_parser.c 
b/src/backend/utils/adt/agtype_parser.c
index c485cb92..40fc8d8c 100644
--- a/src/backend/utils/adt/agtype_parser.c
+++ b/src/backend/utils/adt/agtype_parser.c
@@ -74,11 +74,9 @@ static void parse_object(agtype_lex_context *lex, 
agtype_sem_action *sem);
 static void parse_array_element(agtype_lex_context *lex,
                                 agtype_sem_action *sem);
 static void parse_array(agtype_lex_context *lex, agtype_sem_action *sem);
-static void report_parse_error(agtype_parse_context ctx,
-                               agtype_lex_context *lex)
-    pg_attribute_noreturn();
-static void report_invalid_token(agtype_lex_context *lex)
-    pg_attribute_noreturn();
+static pg_noreturn void report_parse_error(agtype_parse_context ctx,
+                               agtype_lex_context *lex);
+static pg_noreturn void report_invalid_token(agtype_lex_context *lex);
 static int report_agtype_context(agtype_lex_context *lex);
 static char *extract_mb_char(char *s);
 

Reply via email to