@@ -1341,7 +1341,7 @@ static Query *transform_cypher_unwind(cypher_parsestate *cpstate,
1341
1341
errmsg ("invalid value for rtindex" )));
1342
1342
}
1343
1343
1344
- query -> targetList = expandNSItemAttrs (pstate , pnsi , 0 , -1 );
1344
+ query -> targetList = expandNSItemAttrs (pstate , pnsi , 0 , true, -1 );
1345
1345
}
1346
1346
1347
1347
target_syntax_loc = exprLocation ((const Node * ) self -> target );
@@ -1400,7 +1400,8 @@ static List *transform_cypher_delete_item_list(cypher_parsestate *cpstate,
1400
1400
{
1401
1401
Node * expr = lfirst (lc );
1402
1402
ColumnRef * col ;
1403
- Value * val , * pos ;
1403
+ String * val ;
1404
+ Integer * pos ;
1404
1405
int resno ;
1405
1406
1406
1407
cypher_delete_item * item = make_ag_node (cypher_delete_item );
@@ -1427,21 +1428,21 @@ static List *transform_cypher_delete_item_list(cypher_parsestate *cpstate,
1427
1428
(errmsg_internal ("unexpected Node for cypher_clause" )));
1428
1429
}
1429
1430
1430
- resno = get_target_entry_resno (query -> targetList , val -> val . str );
1431
+ resno = get_target_entry_resno (query -> targetList , val -> sval );
1431
1432
if (resno == -1 )
1432
1433
{
1433
1434
ereport (ERROR ,
1434
1435
(errcode (ERRCODE_INVALID_COLUMN_REFERENCE ),
1435
1436
errmsg ("undefined reference to variable %s in DELETE clause" ,
1436
- val -> val . str ),
1437
+ val -> sval ),
1437
1438
parser_errposition (pstate , col -> location )));
1438
1439
}
1439
1440
1440
1441
add_volatile_wrapper_to_target_entry (query -> targetList , resno );
1441
1442
1442
1443
pos = makeInteger (resno );
1443
1444
1444
- item -> var_name = val -> val . str ;
1445
+ item -> var_name = val -> sval ;
1445
1446
item -> entity_position = pos ;
1446
1447
1447
1448
items = lappend (items , item );
@@ -1539,7 +1540,7 @@ cypher_update_information *transform_cypher_remove_item_list(
1539
1540
ColumnRef * ref ;
1540
1541
A_Indirection * ind ;
1541
1542
char * variable_name , * property_name ;
1542
- Value * property_node , * variable_node ;
1543
+ String * property_node , * variable_node ;
1543
1544
1544
1545
item = make_ag_node (cypher_update_item );
1545
1546
@@ -1585,7 +1586,7 @@ cypher_update_information *transform_cypher_remove_item_list(
1585
1586
1586
1587
variable_node = linitial (ref -> fields );
1587
1588
1588
- variable_name = variable_node -> val . str ;
1589
+ variable_name = variable_node -> sval ;
1589
1590
item -> var_name = variable_name ;
1590
1591
1591
1592
item -> entity_position = get_target_entry_resno (query -> targetList ,
@@ -1620,7 +1621,7 @@ cypher_update_information *transform_cypher_remove_item_list(
1620
1621
errmsg ("REMOVE clause expects a property name" ),
1621
1622
parser_errposition (pstate , set_item -> location )));
1622
1623
}
1623
- property_name = property_node -> val . str ;
1624
+ property_name = property_node -> sval ;
1624
1625
item -> prop_name = property_name ;
1625
1626
1626
1627
info -> set_items = lappend (info -> set_items , item );
@@ -1648,7 +1649,7 @@ cypher_update_information *transform_cypher_set_item_list(
1648
1649
ColumnRef * ref ;
1649
1650
A_Indirection * ind ;
1650
1651
char * variable_name , * property_name ;
1651
- Value * property_node , * variable_node ;
1652
+ String * property_node , * variable_node ;
1652
1653
int is_entire_prop_update = 0 ; // true if a map is assigned to variable
1653
1654
1654
1655
// LHS of set_item must be a variable or an indirection.
@@ -1748,7 +1749,7 @@ cypher_update_information *transform_cypher_set_item_list(
1748
1749
parser_errposition (pstate , set_item -> location )));
1749
1750
}
1750
1751
1751
- property_name = property_node -> val . str ;
1752
+ property_name = property_node -> sval ;
1752
1753
item -> prop_name = property_name ;
1753
1754
}
1754
1755
@@ -1762,7 +1763,7 @@ cypher_update_information *transform_cypher_set_item_list(
1762
1763
parser_errposition (pstate , set_item -> location )));
1763
1764
}
1764
1765
1765
- variable_name = variable_node -> val . str ;
1766
+ variable_name = variable_node -> sval ;
1766
1767
item -> var_name = variable_name ;
1767
1768
1768
1769
item -> entity_position = get_target_entry_resno (query -> targetList ,
@@ -2330,7 +2331,7 @@ static Query *transform_cypher_clause_with_where(cypher_parsestate *cpstate,
2330
2331
* all the variables that are introduced in the previous clause to the
2331
2332
* next clause
2332
2333
*/
2333
- query -> targetList = expandNSItemAttrs (pstate , pnsi , 0 , -1 );
2334
+ query -> targetList = expandNSItemAttrs (pstate , pnsi , 0 , true, -1 );
2334
2335
2335
2336
markTargetListOrigins (pstate , query -> targetList );
2336
2337
@@ -2611,7 +2612,7 @@ static Query *transform_cypher_match_pattern(cypher_parsestate *cpstate,
2611
2612
* next clause
2612
2613
*/
2613
2614
pnsi = get_namespace_item (pstate , rte );
2614
- query -> targetList = expandNSItemAttrs (pstate , pnsi , 0 , -1 );
2615
+ query -> targetList = expandNSItemAttrs (pstate , pnsi , 0 , true, -1 );
2615
2616
}
2616
2617
2617
2618
transform_match_pattern (cpstate , query , self -> pattern , where );
@@ -3049,7 +3050,7 @@ static FuncCall *prevent_duplicate_edges(cypher_parsestate *cpstate,
3049
3050
List * edges = NIL ;
3050
3051
ListCell * lc ;
3051
3052
List * qualified_function_name ;
3052
- Value * ag_catalog , * edge_fn ;
3053
+ String * ag_catalog , * edge_fn ;
3053
3054
3054
3055
ag_catalog = makeString ("ag_catalog" );
3055
3056
edge_fn = makeString ("_ag_enforce_edge_uniqueness" );
@@ -3154,8 +3155,8 @@ static List *make_join_condition_for_edge(cypher_parsestate *cpstate,
3154
3155
{
3155
3156
Node * left_id = NULL ;
3156
3157
Node * right_id = NULL ;
3157
- Value * ag_catalog = makeString ("ag_catalog" );
3158
- Value * func_name ;
3158
+ String * ag_catalog = makeString ("ag_catalog" );
3159
+ String * func_name ;
3159
3160
List * qualified_func_name ;
3160
3161
List * args = NIL ;
3161
3162
List * quals = NIL ;
@@ -3205,7 +3206,7 @@ static List *make_join_condition_for_edge(cypher_parsestate *cpstate,
3205
3206
prev_edge -> type == ENT_VLE_EDGE )
3206
3207
{
3207
3208
List * qualified_name , * args ;
3208
- Value * match_qual ;
3209
+ String * match_qual ;
3209
3210
FuncCall * fc ;
3210
3211
3211
3212
match_qual = makeString ("age_match_two_vle_edges" );
@@ -3348,8 +3349,8 @@ static List *make_join_condition_for_edge(cypher_parsestate *cpstate,
3348
3349
static Node * make_type_cast_to_agtype (Node * arg )
3349
3350
{
3350
3351
TypeCast * n = makeNode (TypeCast );
3351
- Value * ag_catalog = makeString ("ag_catalog" );
3352
- Value * agtype_str = makeString ("agtype" );
3352
+ String * ag_catalog = makeString ("ag_catalog" );
3353
+ String * agtype_str = makeString ("agtype" );
3353
3354
List * qualified_name = list_make2 (ag_catalog , agtype_str );
3354
3355
3355
3356
n -> arg = arg ;
@@ -3366,8 +3367,8 @@ static Node *make_bool_a_const(bool state)
3366
3367
{
3367
3368
A_Const * n = makeNode (A_Const );
3368
3369
3369
- n -> val .type = T_String ;
3370
- n -> val .val . str = (state ? "true" : "false" );
3370
+ n -> val .sval . type = T_String ;
3371
+ n -> val .sval . sval = (state ? "true" : "false" );
3371
3372
n -> location = -1 ;
3372
3373
3373
3374
// typecast to agtype
@@ -3416,7 +3417,7 @@ static List *join_to_entity(cypher_parsestate *cpstate,
3416
3417
else if (entity -> type == ENT_VLE_EDGE )
3417
3418
{
3418
3419
List * qualified_name , * args ;
3419
- Value * ag_catalog , * match_qual ;
3420
+ String * ag_catalog , * match_qual ;
3420
3421
bool is_left_side ;
3421
3422
FuncCall * fc ;
3422
3423
@@ -3539,12 +3540,12 @@ static A_Expr *filter_vertices_on_label_id(cypher_parsestate *cpstate,
3539
3540
cpstate -> graph_oid );
3540
3541
A_Const * n ;
3541
3542
FuncCall * fc ;
3542
- Value * ag_catalog , * extract_label_id ;
3543
+ String * ag_catalog , * extract_label_id ;
3543
3544
int32 label_id = lcd -> id ;
3544
3545
3545
3546
n = makeNode (A_Const );
3546
- n -> val .type = T_Integer ;
3547
- n -> val .val .ival = label_id ;
3547
+ n -> val .ival . type = T_Integer ;
3548
+ n -> val .ival .ival = label_id ;
3548
3549
n -> location = -1 ;
3549
3550
3550
3551
ag_catalog = makeString ("ag_catalog" );
@@ -6803,7 +6804,7 @@ static void handle_prev_clause(cypher_parsestate *cpstate, Query *query,
6803
6804
}
6804
6805
6805
6806
// add all the rte's attributes to the current queries targetlist
6806
- query -> targetList = expandNSItemAttrs (pstate , pnsi , 0 , -1 );
6807
+ query -> targetList = expandNSItemAttrs (pstate , pnsi , 0 , true, -1 );
6807
6808
}
6808
6809
6809
6810
ParseNamespaceItem * find_pnsi (cypher_parsestate * cpstate , char * varname )
0 commit comments