Skip to content

Commit bfc5943

Browse files
muhammadshoaibjrgemignaniMuhammadTahaNaveed
committed
Initiaial PG15 (#1108)
Initial PG15 version Contributors Panagiotis Foliadis <[email protected]> Matheus Farias <[email protected]> Mohamed Mokhtar <[email protected]> Hannan Aamir <[email protected]> --------- Co-authored-by: John Gemignani <[email protected]> Co-authored-by: Muhammad Taha Naveed <[email protected]>
1 parent b2abfc4 commit bfc5943

File tree

13 files changed

+151
-120
lines changed

13 files changed

+151
-120
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</a>
3535
&nbsp;
3636
<a href="https://www.postgresql.org/docs/14/index.html">
37-
<img src="https://img.shields.io/badge/Version-PostgreSQL 14-00008B?labelColor=gray&style=flat&link=https://www.postgresql.org/docs/14/index.html"/>
37+
<img src="https://img.shields.io/badge/Version-Postgresql 15-00008B?labelColor=gray&style=flat&link=https://www.postgresql.org/docs/14/index.html"/>
3838
</a>
3939
&nbsp;
4040
<a href="https://github.com/apache/age/issues">

RELEASE

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
Release Notes for Apache AGE release 0.0.0 for PG 14
18+
Release Notes for Apache AGE release 0.0.0 for PG 15
1919

2020
Apache AGE 0.0.0 - Release Notes
2121

docker/Dockerfile.dev

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN apt-get install --assume-yes --no-install-recommends --no-install-suggests \
2424
bison \
2525
build-essential \
2626
flex \
27-
postgresql-server-dev-14 \
27+
postgresql-server-dev-15 \
2828
locales
2929

3030
ENV LANG=en_US.UTF-8

src/backend/catalog/ag_catalog.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ static bool is_age_drop(PlannedStmt *pstmt)
137137

138138
if (IsA(obj, String))
139139
{
140-
Value *val = (Value *)obj;
141-
char *str = val->val.str;
140+
String *val = (String *)obj;
141+
char *str = val->sval;
142142

143143
if (!pg_strcasecmp(str, "age"))
144144
return true;

src/backend/commands/graph_commands.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static Oid create_schema_for_graph(const Name graph_name)
148148
integer = SystemTypeName("int4");
149149
data_type = makeDefElem("as", (Node *)integer, -1);
150150
maxvalue = makeDefElem("maxvalue", (Node *)makeInteger(LABEL_ID_MAX), -1);
151-
cycle = makeDefElem("cycle", (Node *)makeInteger(true), -1);
151+
cycle = makeDefElem("cycle", (Node *)makeBoolean(true), -1);
152152
seq_stmt->options = list_make3(data_type, maxvalue, cycle);
153153
seq_stmt->ownerId = InvalidOid;
154154
seq_stmt->for_identity = false;
@@ -198,7 +198,7 @@ Datum drop_graph(PG_FUNCTION_ARGS)
198198
static void drop_schema_for_graph(char *graph_name_str, const bool cascade)
199199
{
200200
DropStmt *drop_stmt;
201-
Value *schema_name;
201+
String *schema_name;
202202
List *label_id_seq_name;
203203
DropBehavior behavior;
204204

src/backend/commands/label_commands.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -516,12 +516,12 @@ static FuncCall *build_id_default_func_expr(char *graph_name, char *label_name,
516516
label_id_func_name = list_make2(makeString("ag_catalog"),
517517
makeString("_label_id"));
518518
graph_name_const = makeNode(A_Const);
519-
graph_name_const->val.type = T_String;
520-
graph_name_const->val.val.str = graph_name;
519+
graph_name_const->val.sval.type = T_String;
520+
graph_name_const->val.sval.sval = graph_name;
521521
graph_name_const->location = -1;
522522
label_name_const = makeNode(A_Const);
523-
label_name_const->val.type = T_String;
524-
label_name_const->val.val.str = label_name;
523+
label_name_const->val.sval.type = T_String;
524+
label_name_const->val.sval.sval = label_name;
525525
label_name_const->location = -1;
526526
label_id_func_args = list_make2(graph_name_const, label_name_const);
527527
label_id_func = makeFuncCall(label_id_func_name, label_id_func_args, COERCE_SQL_SYNTAX, -1);
@@ -530,8 +530,8 @@ static FuncCall *build_id_default_func_expr(char *graph_name, char *label_name,
530530
nextval_func_name = SystemFuncName("nextval");
531531
qualified_seq_name = quote_qualified_identifier(schema_name, seq_name);
532532
qualified_seq_name_const = makeNode(A_Const);
533-
qualified_seq_name_const->val.type = T_String;
534-
qualified_seq_name_const->val.val.str = qualified_seq_name;
533+
qualified_seq_name_const->val.sval.type = T_String;
534+
qualified_seq_name_const->val.sval.sval = qualified_seq_name;
535535
qualified_seq_name_const->location = -1;
536536
regclass_cast = makeNode(TypeCast);
537537
regclass_cast->typeName = SystemTypeName("regclass");

src/backend/executor/cypher_delete.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -377,13 +377,13 @@ static void process_delete_list(CustomScanState *node)
377377
ResultRelInfo *resultRelInfo;
378378
HeapTuple heap_tuple;
379379
char *label_name;
380-
Value *pos;
380+
Integer *pos;
381381
int entity_position;
382382

383383
item = lfirst(lc);
384384

385385
pos = item->entity_position;
386-
entity_position = pos->val.ival;
386+
entity_position = pos->ival;
387387

388388
/* skip if the entity is null */
389389
if (scanTupleSlot->tts_isnull[entity_position - 1])

src/backend/parser/cypher_analyze.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ static Query *analyze_cypher_and_coerce(List *stmt, RangeTblFunction *rtfunc,
768768

769769

770770
addNSItemToQuery(pstate, pnsi, true, true, true);
771-
query->targetList = expandNSItemAttrs(pstate, pnsi, 0, -1);
771+
query->targetList = expandNSItemAttrs(pstate, pnsi, 0, true, -1);
772772

773773
markTargetListOrigins(pstate, query->targetList);
774774

src/backend/parser/cypher_clause.c

+27-26
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ static Query *transform_cypher_unwind(cypher_parsestate *cpstate,
13411341
errmsg("invalid value for rtindex")));
13421342
}
13431343

1344-
query->targetList = expandNSItemAttrs(pstate, pnsi, 0, -1);
1344+
query->targetList = expandNSItemAttrs(pstate, pnsi, 0, true, -1);
13451345
}
13461346

13471347
target_syntax_loc = exprLocation((const Node *) self->target);
@@ -1400,7 +1400,8 @@ static List *transform_cypher_delete_item_list(cypher_parsestate *cpstate,
14001400
{
14011401
Node *expr = lfirst(lc);
14021402
ColumnRef *col;
1403-
Value *val, *pos;
1403+
String *val;
1404+
Integer *pos;
14041405
int resno;
14051406

14061407
cypher_delete_item *item = make_ag_node(cypher_delete_item);
@@ -1427,21 +1428,21 @@ static List *transform_cypher_delete_item_list(cypher_parsestate *cpstate,
14271428
(errmsg_internal("unexpected Node for cypher_clause")));
14281429
}
14291430

1430-
resno = get_target_entry_resno(query->targetList, val->val.str);
1431+
resno = get_target_entry_resno(query->targetList, val->sval);
14311432
if (resno == -1)
14321433
{
14331434
ereport(ERROR,
14341435
(errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
14351436
errmsg("undefined reference to variable %s in DELETE clause",
1436-
val->val.str),
1437+
val->sval),
14371438
parser_errposition(pstate, col->location)));
14381439
}
14391440

14401441
add_volatile_wrapper_to_target_entry(query->targetList, resno);
14411442

14421443
pos = makeInteger(resno);
14431444

1444-
item->var_name = val->val.str;
1445+
item->var_name = val->sval;
14451446
item->entity_position = pos;
14461447

14471448
items = lappend(items, item);
@@ -1539,7 +1540,7 @@ cypher_update_information *transform_cypher_remove_item_list(
15391540
ColumnRef *ref;
15401541
A_Indirection *ind;
15411542
char *variable_name, *property_name;
1542-
Value *property_node, *variable_node;
1543+
String *property_node, *variable_node;
15431544

15441545
item = make_ag_node(cypher_update_item);
15451546

@@ -1585,7 +1586,7 @@ cypher_update_information *transform_cypher_remove_item_list(
15851586

15861587
variable_node = linitial(ref->fields);
15871588

1588-
variable_name = variable_node->val.str;
1589+
variable_name = variable_node->sval;
15891590
item->var_name = variable_name;
15901591

15911592
item->entity_position = get_target_entry_resno(query->targetList,
@@ -1620,7 +1621,7 @@ cypher_update_information *transform_cypher_remove_item_list(
16201621
errmsg("REMOVE clause expects a property name"),
16211622
parser_errposition(pstate, set_item->location)));
16221623
}
1623-
property_name = property_node->val.str;
1624+
property_name = property_node->sval;
16241625
item->prop_name = property_name;
16251626

16261627
info->set_items = lappend(info->set_items, item);
@@ -1648,7 +1649,7 @@ cypher_update_information *transform_cypher_set_item_list(
16481649
ColumnRef *ref;
16491650
A_Indirection *ind;
16501651
char *variable_name, *property_name;
1651-
Value *property_node, *variable_node;
1652+
String *property_node, *variable_node;
16521653
int is_entire_prop_update = 0; // true if a map is assigned to variable
16531654

16541655
// LHS of set_item must be a variable or an indirection.
@@ -1748,7 +1749,7 @@ cypher_update_information *transform_cypher_set_item_list(
17481749
parser_errposition(pstate, set_item->location)));
17491750
}
17501751

1751-
property_name = property_node->val.str;
1752+
property_name = property_node->sval;
17521753
item->prop_name = property_name;
17531754
}
17541755

@@ -1762,7 +1763,7 @@ cypher_update_information *transform_cypher_set_item_list(
17621763
parser_errposition(pstate, set_item->location)));
17631764
}
17641765

1765-
variable_name = variable_node->val.str;
1766+
variable_name = variable_node->sval;
17661767
item->var_name = variable_name;
17671768

17681769
item->entity_position = get_target_entry_resno(query->targetList,
@@ -2330,7 +2331,7 @@ static Query *transform_cypher_clause_with_where(cypher_parsestate *cpstate,
23302331
* all the variables that are introduced in the previous clause to the
23312332
* next clause
23322333
*/
2333-
query->targetList = expandNSItemAttrs(pstate, pnsi, 0, -1);
2334+
query->targetList = expandNSItemAttrs(pstate, pnsi, 0, true, -1);
23342335

23352336
markTargetListOrigins(pstate, query->targetList);
23362337

@@ -2611,7 +2612,7 @@ static Query *transform_cypher_match_pattern(cypher_parsestate *cpstate,
26112612
* next clause
26122613
*/
26132614
pnsi = get_namespace_item(pstate, rte);
2614-
query->targetList = expandNSItemAttrs(pstate, pnsi, 0, -1);
2615+
query->targetList = expandNSItemAttrs(pstate, pnsi, 0, true, -1);
26152616
}
26162617

26172618
transform_match_pattern(cpstate, query, self->pattern, where);
@@ -3049,7 +3050,7 @@ static FuncCall *prevent_duplicate_edges(cypher_parsestate *cpstate,
30493050
List *edges = NIL;
30503051
ListCell *lc;
30513052
List *qualified_function_name;
3052-
Value *ag_catalog, *edge_fn;
3053+
String *ag_catalog, *edge_fn;
30533054

30543055
ag_catalog = makeString("ag_catalog");
30553056
edge_fn = makeString("_ag_enforce_edge_uniqueness");
@@ -3154,8 +3155,8 @@ static List *make_join_condition_for_edge(cypher_parsestate *cpstate,
31543155
{
31553156
Node *left_id = NULL;
31563157
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;
31593160
List *qualified_func_name;
31603161
List *args = NIL;
31613162
List *quals = NIL;
@@ -3205,7 +3206,7 @@ static List *make_join_condition_for_edge(cypher_parsestate *cpstate,
32053206
prev_edge->type == ENT_VLE_EDGE)
32063207
{
32073208
List *qualified_name, *args;
3208-
Value *match_qual;
3209+
String *match_qual;
32093210
FuncCall *fc;
32103211

32113212
match_qual = makeString("age_match_two_vle_edges");
@@ -3348,8 +3349,8 @@ static List *make_join_condition_for_edge(cypher_parsestate *cpstate,
33483349
static Node *make_type_cast_to_agtype(Node *arg)
33493350
{
33503351
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");
33533354
List *qualified_name = list_make2(ag_catalog, agtype_str);
33543355

33553356
n->arg = arg;
@@ -3366,8 +3367,8 @@ static Node *make_bool_a_const(bool state)
33663367
{
33673368
A_Const *n = makeNode(A_Const);
33683369

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");
33713372
n->location = -1;
33723373

33733374
// typecast to agtype
@@ -3416,7 +3417,7 @@ static List *join_to_entity(cypher_parsestate *cpstate,
34163417
else if (entity->type == ENT_VLE_EDGE)
34173418
{
34183419
List *qualified_name, *args;
3419-
Value *ag_catalog, *match_qual;
3420+
String *ag_catalog, *match_qual;
34203421
bool is_left_side;
34213422
FuncCall *fc;
34223423

@@ -3539,12 +3540,12 @@ static A_Expr *filter_vertices_on_label_id(cypher_parsestate *cpstate,
35393540
cpstate->graph_oid);
35403541
A_Const *n;
35413542
FuncCall *fc;
3542-
Value *ag_catalog, *extract_label_id;
3543+
String *ag_catalog, *extract_label_id;
35433544
int32 label_id = lcd->id;
35443545

35453546
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;
35483549
n->location = -1;
35493550

35503551
ag_catalog = makeString("ag_catalog");
@@ -6803,7 +6804,7 @@ static void handle_prev_clause(cypher_parsestate *cpstate, Query *query,
68036804
}
68046805

68056806
// 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);
68076808
}
68086809

68096810
ParseNamespaceItem *find_pnsi(cypher_parsestate *cpstate, char *varname)

0 commit comments

Comments
 (0)