Skip to content

Commit e82470f

Browse files
committed
Merge branch 'PG16' into master_to_PostgreSQL_version_16
Conflicts: docker/Dockerfile.dev Changes to be committed: modified: .github/workflows/go-driver.yml modified: .github/workflows/installcheck.yaml modified: .github/workflows/jdbc-driver.yaml modified: .github/workflows/nodejs-driver.yaml modified: .github/workflows/python-driver.yaml modified: .gitignore modified: docker/Dockerfile modified: docker/Dockerfile.dev modified: src/backend/catalog/ag_catalog.c modified: src/backend/catalog/ag_graph.c modified: src/backend/catalog/ag_label.c modified: src/backend/commands/label_commands.c modified: src/backend/executor/cypher_create.c modified: src/backend/executor/cypher_merge.c modified: src/backend/executor/cypher_set.c modified: src/backend/executor/cypher_utils.c modified: src/backend/nodes/cypher_readfuncs.c modified: src/backend/parser/cypher_analyze.c modified: src/backend/parser/cypher_clause.c modified: src/backend/parser/cypher_expr.c modified: src/backend/parser/cypher_item.c modified: src/backend/parser/cypher_parse_agg.c modified: src/backend/utils/adt/agtype.c modified: src/backend/utils/adt/agtype_gin.c modified: src/backend/utils/adt/agtype_ops.c modified: src/backend/utils/adt/agtype_parser.c modified: src/backend/utils/ag_func.c modified: src/backend/utils/cache/ag_cache.c modified: src/backend/utils/graph_generation.c
2 parents 0ea1186 + 8e56db9 commit e82470f

29 files changed

+188
-144
lines changed

Diff for: .github/workflows/go-driver.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Go Driver Tests
22

33
on:
44
push:
5-
branches: [ "master", "PG15" ]
5+
branches: [ "master", "PG16" ]
66

77
pull_request:
8-
branches: [ "master", "PG15" ]
8+
branches: [ "master", "PG16" ]
99

1010
jobs:
1111
build:
@@ -26,14 +26,14 @@ jobs:
2626
if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
2727
if [[ "$GITHUB_REF" == "refs/heads/master" ]]; then
2828
echo "TAG=latest" >> $GITHUB_ENV
29-
elif [[ "$GITHUB_REF" == "refs/heads/PG15" ]]; then
30-
echo "TAG=PG15_latest" >> $GITHUB_ENV
29+
elif [[ "$GITHUB_REF" == "refs/heads/PG16" ]]; then
30+
echo "TAG=PG16_latest" >> $GITHUB_ENV
3131
fi
3232
elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
3333
if [[ "$GITHUB_BASE_REF" == "master" ]]; then
3434
echo "TAG=latest" >> $GITHUB_ENV
35-
elif [[ "$GITHUB_BASE_REF" == "PG15" ]]; then
36-
echo "TAG=PG15_latest" >> $GITHUB_ENV
35+
elif [[ "$GITHUB_BASE_REF" == "PG16" ]]; then
36+
echo "TAG=PG16_latest" >> $GITHUB_ENV
3737
fi
3838
fi
3939

Diff for: .github/workflows/installcheck.yaml

+15-15
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,45 @@ name: Build / Regression
22

33
on:
44
push:
5-
branches: [ 'master', 'PG15' ]
5+
branches: [ 'master', 'PG16' ]
66
pull_request:
7-
branches: [ 'master', 'PG15' ]
7+
branches: [ 'master', 'PG16' ]
88

99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- name: Get latest commit id of PostgreSQL 15
14+
- name: Get latest commit id of PostgreSQL 16
1515
run: |
16-
echo "PG_COMMIT_HASH=$(git ls-remote git://git.postgresql.org/git/postgresql.git refs/heads/REL_15_STABLE | awk '{print $1}')" >> $GITHUB_ENV
16+
echo "PG_COMMIT_HASH=$(git ls-remote git://git.postgresql.org/git/postgresql.git refs/heads/REL_16_STABLE | awk '{print $1}')" >> $GITHUB_ENV
1717
18-
- name: Cache PostgreSQL 15
18+
- name: Cache PostgreSQL 16
1919
uses: actions/cache@v3
20-
id: pg15cache
20+
id: pg16cache
2121
with:
22-
path: ~/pg15
23-
key: ${{ runner.os }}-v1-pg15-${{ env.PG_COMMIT_HASH }}
22+
path: ~/pg16
23+
key: ${{ runner.os }}-v1-pg16-${{ env.PG_COMMIT_HASH }}
2424

25-
- name: Install PostgreSQL 15
26-
if: steps.pg15cache.outputs.cache-hit != 'true'
25+
- name: Install PostgreSQL 16
26+
if: steps.pg16cache.outputs.cache-hit != 'true'
2727
run: |
28-
git clone --depth 1 --branch REL_15_STABLE git://git.postgresql.org/git/postgresql.git ~/pg15source
29-
cd ~/pg15source
30-
./configure --prefix=$HOME/pg15 CFLAGS="-std=gnu99 -ggdb -O0" --enable-cassert
28+
git clone --depth 1 --branch REL_16_STABLE git://git.postgresql.org/git/postgresql.git ~/pg16source
29+
cd ~/pg16source
30+
./configure --prefix=$HOME/pg16 CFLAGS="-std=gnu99 -ggdb -O0" --enable-cassert
3131
make install -j$(nproc) > /dev/null
3232
3333
- uses: actions/checkout@v3
3434

3535
- name: Build
3636
id: build
3737
run: |
38-
make PG_CONFIG=$HOME/pg15/bin/pg_config install -j$(nproc)
38+
make PG_CONFIG=$HOME/pg16/bin/pg_config install -j$(nproc)
3939
4040
- name: Regression tests
4141
id: regression_tests
4242
run: |
43-
make PG_CONFIG=$HOME/pg15/bin/pg_config installcheck
43+
make PG_CONFIG=$HOME/pg16/bin/pg_config installcheck
4444
continue-on-error: true
4545

4646
- name: Dump regression test errors

Diff for: .github/workflows/jdbc-driver.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: JDBC Driver Tests
22

33
on:
44
push:
5-
branches: [ "master", "PG15" ]
5+
branches: [ "master", "PG16" ]
66

77
pull_request:
8-
branches: [ "master", "PG15" ]
8+
branches: [ "master", "PG16" ]
99

1010
jobs:
1111
build:
@@ -28,14 +28,14 @@ jobs:
2828
if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
2929
if [[ "$GITHUB_REF" == "refs/heads/master" ]]; then
3030
echo "TAG=latest" >> $GITHUB_ENV
31-
elif [[ "$GITHUB_REF" == "refs/heads/PG15" ]]; then
32-
echo "TAG=PG15_latest" >> $GITHUB_ENV
31+
elif [[ "$GITHUB_REF" == "refs/heads/PG16" ]]; then
32+
echo "TAG=PG16_latest" >> $GITHUB_ENV
3333
fi
3434
elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
3535
if [[ "$GITHUB_BASE_REF" == "master" ]]; then
3636
echo "TAG=latest" >> $GITHUB_ENV
37-
elif [[ "$GITHUB_BASE_REF" == "PG15" ]]; then
38-
echo "TAG=PG15_latest" >> $GITHUB_ENV
37+
elif [[ "$GITHUB_BASE_REF" == "PG16" ]]; then
38+
echo "TAG=PG16_latest" >> $GITHUB_ENV
3939
fi
4040
fi
4141

Diff for: .github/workflows/nodejs-driver.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Nodejs Driver Tests
22

33
on:
44
push:
5-
branches: [ "master", "PG15" ]
5+
branches: [ "master", "PG16" ]
66

77
pull_request:
8-
branches: [ "master", "PG15" ]
8+
branches: [ "master", "PG16" ]
99

1010
jobs:
1111
build:
@@ -23,14 +23,14 @@ jobs:
2323
if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
2424
if [[ "$GITHUB_REF" == "refs/heads/master" ]]; then
2525
echo "TAG=latest" >> $GITHUB_ENV
26-
elif [[ "$GITHUB_REF" == "refs/heads/PG15" ]]; then
27-
echo "TAG=PG15_latest" >> $GITHUB_ENV
26+
elif [[ "$GITHUB_REF" == "refs/heads/PG16" ]]; then
27+
echo "TAG=PG16_latest" >> $GITHUB_ENV
2828
fi
2929
elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
3030
if [[ "$GITHUB_BASE_REF" == "master" ]]; then
3131
echo "TAG=latest" >> $GITHUB_ENV
32-
elif [[ "$GITHUB_BASE_REF" == "PG15" ]]; then
33-
echo "TAG=PG15_latest" >> $GITHUB_ENV
32+
elif [[ "$GITHUB_BASE_REF" == "PG16" ]]; then
33+
echo "TAG=PG16_latest" >> $GITHUB_ENV
3434
fi
3535
fi
3636

Diff for: .github/workflows/python-driver.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Python Driver Tests
22

33
on:
44
push:
5-
branches: [ "master", "PG15" ]
5+
branches: [ "master", "PG16" ]
66

77
pull_request:
8-
branches: [ "master", "PG15" ]
8+
branches: [ "master", "PG16" ]
99

1010
jobs:
1111
build:
@@ -23,14 +23,14 @@ jobs:
2323
if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
2424
if [[ "$GITHUB_REF" == "refs/heads/master" ]]; then
2525
echo "TAG=latest" >> $GITHUB_ENV
26-
elif [[ "$GITHUB_REF" == "refs/heads/PG15" ]]; then
27-
echo "TAG=PG15_latest" >> $GITHUB_ENV
26+
elif [[ "$GITHUB_REF" == "refs/heads/PG16" ]]; then
27+
echo "TAG=PG16_latest" >> $GITHUB_ENV
2828
fi
2929
elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
3030
if [[ "$GITHUB_BASE_REF" == "master" ]]; then
3131
echo "TAG=latest" >> $GITHUB_ENV
32-
elif [[ "$GITHUB_BASE_REF" == "PG15" ]]; then
33-
echo "TAG=PG15_latest" >> $GITHUB_ENV
32+
elif [[ "$GITHUB_BASE_REF" == "PG16" ]]; then
33+
echo "TAG=PG16_latest" >> $GITHUB_ENV
3434
fi
3535
fi
3636

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ age--*.*.*.sql
77
.DS_Store
88
*.tokens
99
*.interp
10+
*.dylib

Diff for: docker/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
# limitations under the License.
1717
#
1818

19-
FROM postgres:15
19+
FROM postgres:16
2020

2121
RUN apt-get update \
2222
&& apt-get install -y --no-install-recommends --no-install-suggests \
2323
bison \
2424
build-essential \
2525
flex \
26-
postgresql-server-dev-15 \
26+
postgresql-server-dev-16 \
2727
locales
2828

2929
ENV LANG=en_US.UTF-8

Diff for: docker/Dockerfile.dev

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
#
1818

1919

20-
FROM postgres:15
20+
FROM postgres:16
2121

2222
RUN apt-get update
2323
RUN apt-get install --assume-yes --no-install-recommends --no-install-suggests \
2424
bison \
2525
build-essential \
2626
flex \
27-
postgresql-server-dev-15 \
27+
postgresql-server-dev-16 \
2828
locales
2929

3030
ENV LANG=en_US.UTF-8

Diff for: src/backend/catalog/ag_catalog.c

+7
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,15 @@ void ag_ProcessUtility_hook(PlannedStmt *pstmt, const char *queryString, bool re
9797
(*prev_process_utility_hook) (pstmt, queryString, readOnlyTree, context, params,
9898
queryEnv, dest, qc);
9999
else
100+
{
101+
Assert(IsA(pstmt, PlannedStmt));
102+
Assert(pstmt->commandType == CMD_UTILITY);
103+
Assert(queryString != NULL); /* required as of 8.4 */
104+
Assert(qc == NULL || qc->commandTag == CMDTAG_UNKNOWN);
100105
standard_ProcessUtility(pstmt, queryString, readOnlyTree, context, params, queryEnv,
101106
dest, qc);
107+
}
108+
102109
}
103110

104111
static void drop_age_extension(DropStmt *stmt)

Diff for: src/backend/catalog/ag_graph.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ void insert_graph(const Name graph_name, const Oid nsp_id)
4949
HeapTuple tuple;
5050

5151

52-
AssertArg(graph_name);
53-
AssertArg(OidIsValid(nsp_id));
52+
Assert(graph_name);
53+
Assert(OidIsValid(nsp_id));
5454

5555
ag_graph = table_open(ag_graph_relation_id(), RowExclusiveLock);
5656
values[Anum_ag_graph_oid - 1] = ObjectIdGetDatum(nsp_id);

Diff for: src/backend/catalog/ag_label.c

+8-7
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ void insert_label(const char *label_name, Oid graph_oid, int32 label_id,
6363
* NOTE: Is it better to make use of label_id and label_kind domain types
6464
* than to use assert to check label_id and label_kind are valid?
6565
*/
66-
AssertArg(label_name);
67-
AssertArg(label_id_is_valid(label_id));
68-
AssertArg(label_kind == LABEL_KIND_VERTEX ||
66+
Assert(label_name);
67+
Assert(label_id_is_valid(label_id));
68+
Assert(label_kind == LABEL_KIND_VERTEX ||
6969
label_kind == LABEL_KIND_EDGE);
70-
AssertArg(OidIsValid(label_relation));
71-
AssertArg(seq_name);
70+
Assert(OidIsValid(label_relation));
71+
Assert(seq_name);
7272

7373
ag_label = table_open(ag_label_relation_id(), RowExclusiveLock);
7474

@@ -188,8 +188,9 @@ Datum _label_name(PG_FUNCTION_ARGS)
188188
uint32 label_id;
189189

190190
if (PG_ARGISNULL(0) || PG_ARGISNULL(1))
191-
ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
192-
errmsg("graph_oid and label_id must not be null")));
191+
PG_RETURN_NULL();
192+
//ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
193+
// errmsg("graph_oid and label_id must not be null")));
193194

194195
graph = PG_GETARG_OID(0);
195196

Diff for: src/backend/commands/label_commands.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ static void remove_relation(List *qname)
808808
Oid rel_oid;
809809
ObjectAddress address;
810810

811-
AssertArg(list_length(qname) == 2);
811+
Assert(list_length(qname) == 2);
812812

813813
// concurrent is false so lockmode is AccessExclusiveLock
814814

@@ -868,8 +868,7 @@ static void range_var_callback_for_remove_relation(const RangeVar *rel,
868868

869869
// relkind == expected_relkind
870870

871-
if (!pg_class_ownercheck(rel_oid, GetUserId()) &&
872-
!pg_namespace_ownercheck(get_rel_namespace(rel_oid), GetUserId()))
871+
if (!object_ownercheck(rel_oid, get_rel_namespace(rel_oid), GetUserId()))
873872
{
874873
aclcheck_error(ACLCHECK_NOT_OWNER,
875874
get_relkind_objtype(get_rel_relkind(rel_oid)),

Diff for: src/backend/executor/cypher_create.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ static void create_edge(cypher_create_custom_scan_state *css,
438438

439439
result = make_edge(
440440
id, start_id, end_id, CStringGetDatum(node->label_name),
441-
PointerGetDatum(scanTupleSlot->tts_values[node->prop_attr_num]));
441+
scanTupleSlot->tts_values[node->prop_attr_num]);
442442

443443
if (CYPHER_TARGET_NODE_IN_PATH(node->flags))
444444
{
@@ -528,7 +528,7 @@ static Datum create_vertex(cypher_create_custom_scan_state *css,
528528

529529
// make the vertex agtype
530530
result = make_vertex(id, CStringGetDatum(node->label_name),
531-
PointerGetDatum(scanTupleSlot->tts_values[node->prop_attr_num]));
531+
scanTupleSlot->tts_values[node->prop_attr_num]);
532532

533533
// append to the path list
534534
if (CYPHER_TARGET_NODE_IN_PATH(node->flags))

Diff for: src/backend/executor/cypher_merge.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,9 @@ static TupleTableSlot *exec_cypher_merge(CustomScanState *node)
472472
* So we will need to create a TupleTableSlot and populate with the
473473
* information from the newly created path that the query needs.
474474
*/
475-
ExprContext *econtext = node->ss.ps.ps_ExprContext;
476-
SubqueryScanState *sss = (SubqueryScanState *)node->ss.ps.lefttree;
475+
SubqueryScanState *sss = NULL;
476+
econtext = node->ss.ps.ps_ExprContext;
477+
sss = (SubqueryScanState *)node->ss.ps.lefttree;
477478

478479
/*
479480
* Our child execution node is always a subquery. If not there

Diff for: src/backend/executor/cypher_set.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static HeapTuple update_entity_tuple(ResultRelInfo *resultRelInfo,
111111
TM_FailureData hufd;
112112
TM_Result lock_result;
113113
Buffer buffer;
114-
bool update_indexes;
114+
TU_UpdateIndexes update_indexes;
115115
TM_Result result;
116116
CommandId cid = GetCurrentCommandId(true);
117117
ResultRelInfo **saved_resultRels = estate->es_result_relations;
@@ -167,9 +167,10 @@ static HeapTuple update_entity_tuple(ResultRelInfo *resultRelInfo,
167167
}
168168

169169
// Insert index entries for the tuple
170-
if (resultRelInfo->ri_NumIndices > 0 && update_indexes)
170+
if (resultRelInfo->ri_NumIndices > 0 && update_indexes != TU_None)
171171
{
172-
ExecInsertIndexTuples(resultRelInfo, elemTupleSlot, estate, false, false, NULL, NIL);
172+
ExecInsertIndexTuples(resultRelInfo, elemTupleSlot, estate, false, false, NULL, NIL,
173+
(update_indexes == TU_Summarizing));
173174
}
174175

175176
ExecCloseIndices(resultRelInfo);

Diff for: src/backend/executor/cypher_utils.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ ResultRelInfo *create_entity_result_rel_info(EState *estate, char *graph_name,
7777

7878
// initialize the resultRelInfo
7979
InitResultRelInfo(resultRelInfo, label_relation,
80-
list_length(estate->es_range_table), NULL,
80+
0, NULL,
8181
estate->es_instrument);
8282

8383
// open the parse state
@@ -254,8 +254,8 @@ HeapTuple insert_entity_tuple_cid(ResultRelInfo *resultRelInfo,
254254
// Insert index entries for the tuple
255255
if (resultRelInfo->ri_NumIndices > 0)
256256
{
257-
ExecInsertIndexTuples(resultRelInfo, elemTupleSlot, estate, false,
258-
false, NULL, NIL);
257+
ExecInsertIndexTuples(resultRelInfo, elemTupleSlot, estate,
258+
false, false, NULL, NIL, false);
259259
}
260260

261261
return tuple;

Diff for: src/backend/nodes/cypher_readfuncs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
((length) == 0 ? NULL : debackslash(token, length))
167167

168168
#define non_nullable_string(token,length) \
169-
((length) == 0 ? "" : debackslash(token, length))
169+
((length == 2 && token[0] == '"' && token[1] == '"') ? "" : debackslash(token, length))
170170

171171
/*
172172
* Default read function for cypher nodes. For most nodes, we don't expect

Diff for: src/backend/parser/cypher_analyze.c

+1
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,7 @@ static Query *analyze_cypher_and_coerce(List *stmt, RangeTblFunction *rtfunc,
868868
}
869869

870870
query->rtable = pstate->p_rtable;
871+
query->rteperminfos = pstate->p_rteperminfos;
871872
query->jointree = makeFromExpr(pstate->p_joinlist, NULL);
872873

873874
assign_query_collations(pstate, query);

0 commit comments

Comments
 (0)