Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master to PostgreSQL version 16 #1451

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/go-driver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Go Driver Tests

on:
push:
branches: [ "master", "PG15" ]
branches: [ "master", "PG16" ]

pull_request:
branches: [ "master", "PG15" ]
branches: [ "master", "PG16" ]

jobs:
build:
Expand All @@ -26,14 +26,14 @@ jobs:
if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
if [[ "$GITHUB_REF" == "refs/heads/master" ]]; then
echo "TAG=latest" >> $GITHUB_ENV
elif [[ "$GITHUB_REF" == "refs/heads/PG15" ]]; then
echo "TAG=PG15_latest" >> $GITHUB_ENV
elif [[ "$GITHUB_REF" == "refs/heads/PG16" ]]; then
echo "TAG=PG16_latest" >> $GITHUB_ENV
fi
elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
if [[ "$GITHUB_BASE_REF" == "master" ]]; then
echo "TAG=latest" >> $GITHUB_ENV
elif [[ "$GITHUB_BASE_REF" == "PG15" ]]; then
echo "TAG=PG15_latest" >> $GITHUB_ENV
elif [[ "$GITHUB_BASE_REF" == "PG16" ]]; then
echo "TAG=PG16_latest" >> $GITHUB_ENV
fi
fi

Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/installcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,45 @@ name: Build / Regression

on:
push:
branches: [ 'master', 'PG15' ]
branches: [ 'master', 'PG16' ]
pull_request:
branches: [ 'master', 'PG15' ]
branches: [ 'master', 'PG16' ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Get latest commit id of PostgreSQL 15
- name: Get latest commit id of PostgreSQL 16
run: |
echo "PG_COMMIT_HASH=$(git ls-remote git://git.postgresql.org/git/postgresql.git refs/heads/REL_15_STABLE | awk '{print $1}')" >> $GITHUB_ENV
echo "PG_COMMIT_HASH=$(git ls-remote git://git.postgresql.org/git/postgresql.git refs/heads/REL_16_STABLE | awk '{print $1}')" >> $GITHUB_ENV

- name: Cache PostgreSQL 15
- name: Cache PostgreSQL 16
uses: actions/cache@v3
id: pg15cache
id: pg16cache
with:
path: ~/pg15
key: ${{ runner.os }}-v1-pg15-${{ env.PG_COMMIT_HASH }}
path: ~/pg16
key: ${{ runner.os }}-v1-pg16-${{ env.PG_COMMIT_HASH }}

- name: Install PostgreSQL 15
if: steps.pg15cache.outputs.cache-hit != 'true'
- name: Install PostgreSQL 16
if: steps.pg16cache.outputs.cache-hit != 'true'
run: |
git clone --depth 1 --branch REL_15_STABLE git://git.postgresql.org/git/postgresql.git ~/pg15source
cd ~/pg15source
./configure --prefix=$HOME/pg15 CFLAGS="-std=gnu99 -ggdb -O0" --enable-cassert
git clone --depth 1 --branch REL_16_STABLE git://git.postgresql.org/git/postgresql.git ~/pg16source
cd ~/pg16source
./configure --prefix=$HOME/pg16 CFLAGS="-std=gnu99 -ggdb -O0" --enable-cassert
make install -j$(nproc) > /dev/null

- uses: actions/checkout@v3

- name: Build
id: build
run: |
make PG_CONFIG=$HOME/pg15/bin/pg_config install -j$(nproc)
make PG_CONFIG=$HOME/pg16/bin/pg_config install -j$(nproc)

- name: Regression tests
id: regression_tests
run: |
make PG_CONFIG=$HOME/pg15/bin/pg_config installcheck
make PG_CONFIG=$HOME/pg16/bin/pg_config installcheck
continue-on-error: true

- name: Dump regression test errors
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/jdbc-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: JDBC Driver Tests

on:
push:
branches: [ "master", "PG15" ]
branches: [ "master", "PG16" ]

pull_request:
branches: [ "master", "PG15" ]
branches: [ "master", "PG16" ]

jobs:
build:
Expand All @@ -28,14 +28,14 @@ jobs:
if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
if [[ "$GITHUB_REF" == "refs/heads/master" ]]; then
echo "TAG=latest" >> $GITHUB_ENV
elif [[ "$GITHUB_REF" == "refs/heads/PG15" ]]; then
echo "TAG=PG15_latest" >> $GITHUB_ENV
elif [[ "$GITHUB_REF" == "refs/heads/PG16" ]]; then
echo "TAG=PG16_latest" >> $GITHUB_ENV
fi
elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
if [[ "$GITHUB_BASE_REF" == "master" ]]; then
echo "TAG=latest" >> $GITHUB_ENV
elif [[ "$GITHUB_BASE_REF" == "PG15" ]]; then
echo "TAG=PG15_latest" >> $GITHUB_ENV
elif [[ "$GITHUB_BASE_REF" == "PG16" ]]; then
echo "TAG=PG16_latest" >> $GITHUB_ENV
fi
fi

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/nodejs-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Nodejs Driver Tests

on:
push:
branches: [ "master", "PG15" ]
branches: [ "master", "PG16" ]

pull_request:
branches: [ "master", "PG15" ]
branches: [ "master", "PG16" ]

jobs:
build:
Expand All @@ -23,14 +23,14 @@ jobs:
if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
if [[ "$GITHUB_REF" == "refs/heads/master" ]]; then
echo "TAG=latest" >> $GITHUB_ENV
elif [[ "$GITHUB_REF" == "refs/heads/PG15" ]]; then
echo "TAG=PG15_latest" >> $GITHUB_ENV
elif [[ "$GITHUB_REF" == "refs/heads/PG16" ]]; then
echo "TAG=PG16_latest" >> $GITHUB_ENV
fi
elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
if [[ "$GITHUB_BASE_REF" == "master" ]]; then
echo "TAG=latest" >> $GITHUB_ENV
elif [[ "$GITHUB_BASE_REF" == "PG15" ]]; then
echo "TAG=PG15_latest" >> $GITHUB_ENV
elif [[ "$GITHUB_BASE_REF" == "PG16" ]]; then
echo "TAG=PG16_latest" >> $GITHUB_ENV
fi
fi

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/python-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Python Driver Tests

on:
push:
branches: [ "master", "PG15" ]
branches: [ "master", "PG16" ]

pull_request:
branches: [ "master", "PG15" ]
branches: [ "master", "PG16" ]

jobs:
build:
Expand All @@ -23,14 +23,14 @@ jobs:
if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
if [[ "$GITHUB_REF" == "refs/heads/master" ]]; then
echo "TAG=latest" >> $GITHUB_ENV
elif [[ "$GITHUB_REF" == "refs/heads/PG15" ]]; then
echo "TAG=PG15_latest" >> $GITHUB_ENV
elif [[ "$GITHUB_REF" == "refs/heads/PG16" ]]; then
echo "TAG=PG16_latest" >> $GITHUB_ENV
fi
elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
if [[ "$GITHUB_BASE_REF" == "master" ]]; then
echo "TAG=latest" >> $GITHUB_ENV
elif [[ "$GITHUB_BASE_REF" == "PG15" ]]; then
echo "TAG=PG15_latest" >> $GITHUB_ENV
elif [[ "$GITHUB_BASE_REF" == "PG16" ]]; then
echo "TAG=PG16_latest" >> $GITHUB_ENV
fi
fi

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ age--*.*.*.sql
.DS_Store
*.tokens
*.interp
*.dylib
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
# limitations under the License.
#

FROM postgres:15
FROM postgres:16

RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
bison \
build-essential \
flex \
postgresql-server-dev-15 \
postgresql-server-dev-16 \
locales

ENV LANG=en_US.UTF-8
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
#


FROM postgres:15
FROM postgres:16

RUN apt-get update
RUN apt-get install --assume-yes --no-install-recommends --no-install-suggests \
bison \
build-essential \
flex \
postgresql-server-dev-15 \
postgresql-server-dev-16 \
locales

ENV LANG=en_US.UTF-8
Expand Down
26 changes: 18 additions & 8 deletions src/backend/catalog/ag_catalog.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,29 @@ void process_utility_hook_fini(void)
* from being thrown, we need to disable the object_access_hook before dropping
* the extension.
*/
void ag_ProcessUtility_hook(PlannedStmt *pstmt, const char *queryString, bool readOnlyTree,
ProcessUtilityContext context, ParamListInfo params,
QueryEnvironment *queryEnv, DestReceiver *dest,
QueryCompletion *qc)
void ag_ProcessUtility_hook(PlannedStmt *pstmt, const char *queryString,
bool readOnlyTree, ProcessUtilityContext context,
ParamListInfo params, QueryEnvironment *queryEnv,
DestReceiver *dest, QueryCompletion *qc)
{
if (is_age_drop(pstmt))
{
drop_age_extension((DropStmt *)pstmt->utilityStmt);
}
else if (prev_process_utility_hook)
(*prev_process_utility_hook) (pstmt, queryString, readOnlyTree, context, params,
queryEnv, dest, qc);
{
(*prev_process_utility_hook) (pstmt, queryString, readOnlyTree, context,
params, queryEnv, dest, qc);
}
else
standard_ProcessUtility(pstmt, queryString, readOnlyTree, context, params, queryEnv,
dest, qc);
{
Assert(IsA(pstmt, PlannedStmt));
Assert(pstmt->commandType == CMD_UTILITY);
Assert(queryString != NULL); /* required as of 8.4 */
Assert(qc == NULL || qc->commandTag == CMDTAG_UNKNOWN);
standard_ProcessUtility(pstmt, queryString, readOnlyTree, context,
params, queryEnv, dest, qc);
}
}

static void drop_age_extension(DropStmt *stmt)
Expand Down
4 changes: 2 additions & 2 deletions src/backend/catalog/ag_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ void insert_graph(const Name graph_name, const Oid nsp_id)
HeapTuple tuple;


AssertArg(graph_name);
AssertArg(OidIsValid(nsp_id));
Assert(graph_name);
Assert(OidIsValid(nsp_id));

ag_graph = table_open(ag_graph_relation_id(), RowExclusiveLock);
values[Anum_ag_graph_oid - 1] = ObjectIdGetDatum(nsp_id);
Expand Down
12 changes: 7 additions & 5 deletions src/backend/catalog/ag_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ void insert_label(const char *label_name, Oid graph_oid, int32 label_id,
* NOTE: Is it better to make use of label_id and label_kind domain types
* than to use assert to check label_id and label_kind are valid?
*/
AssertArg(label_name);
AssertArg(label_id_is_valid(label_id));
AssertArg(label_kind == LABEL_KIND_VERTEX ||
Assert(label_name);
Assert(label_id_is_valid(label_id));
Assert(label_kind == LABEL_KIND_VERTEX ||
label_kind == LABEL_KIND_EDGE);
AssertArg(OidIsValid(label_relation));
AssertArg(seq_name);
Assert(OidIsValid(label_relation));
Assert(seq_name);

ag_label = table_open(ag_label_relation_id(), RowExclusiveLock);

Expand Down Expand Up @@ -188,8 +188,10 @@ Datum _label_name(PG_FUNCTION_ARGS)
uint32 label_id;

if (PG_ARGISNULL(0) || PG_ARGISNULL(1))
{
ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
jrgemignani marked this conversation as resolved.
Show resolved Hide resolved
errmsg("graph_oid and label_id must not be null")));
}

graph = PG_GETARG_OID(0);

Expand Down
5 changes: 2 additions & 3 deletions src/backend/commands/label_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ static void remove_relation(List *qname)
Oid rel_oid;
ObjectAddress address;

AssertArg(list_length(qname) == 2);
Assert(list_length(qname) == 2);

// concurrent is false so lockmode is AccessExclusiveLock

Expand Down Expand Up @@ -868,8 +868,7 @@ static void range_var_callback_for_remove_relation(const RangeVar *rel,

// relkind == expected_relkind

if (!pg_class_ownercheck(rel_oid, GetUserId()) &&
!pg_namespace_ownercheck(get_rel_namespace(rel_oid), GetUserId()))
if (!object_ownercheck(rel_oid, get_rel_namespace(rel_oid), GetUserId()))
{
aclcheck_error(ACLCHECK_NOT_OWNER,
get_relkind_objtype(get_rel_relkind(rel_oid)),
Expand Down
4 changes: 2 additions & 2 deletions src/backend/executor/cypher_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ static void create_edge(cypher_create_custom_scan_state *css,

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

if (CYPHER_TARGET_NODE_IN_PATH(node->flags))
{
Expand Down Expand Up @@ -528,7 +528,7 @@ static Datum create_vertex(cypher_create_custom_scan_state *css,

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

// append to the path list
if (CYPHER_TARGET_NODE_IN_PATH(node->flags))
Expand Down
5 changes: 3 additions & 2 deletions src/backend/executor/cypher_merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,9 @@ static TupleTableSlot *exec_cypher_merge(CustomScanState *node)
* So we will need to create a TupleTableSlot and populate with the
* information from the newly created path that the query needs.
*/
ExprContext *econtext = node->ss.ps.ps_ExprContext;
SubqueryScanState *sss = (SubqueryScanState *)node->ss.ps.lefttree;
SubqueryScanState *sss = NULL;
econtext = node->ss.ps.ps_ExprContext;
sss = (SubqueryScanState *)node->ss.ps.lefttree;

/*
* Our child execution node is always a subquery. If not there
Expand Down
10 changes: 6 additions & 4 deletions src/backend/executor/cypher_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static HeapTuple update_entity_tuple(ResultRelInfo *resultRelInfo,
TM_FailureData hufd;
TM_Result lock_result;
Buffer buffer;
bool update_indexes;
TU_UpdateIndexes update_indexes;
TM_Result result;
CommandId cid = GetCurrentCommandId(true);
ResultRelInfo **saved_resultRels = estate->es_result_relations;
Expand Down Expand Up @@ -167,9 +167,10 @@ static HeapTuple update_entity_tuple(ResultRelInfo *resultRelInfo,
}

// Insert index entries for the tuple
if (resultRelInfo->ri_NumIndices > 0 && update_indexes)
if (resultRelInfo->ri_NumIndices > 0 && update_indexes != TU_None)
{
ExecInsertIndexTuples(resultRelInfo, elemTupleSlot, estate, false, false, NULL, NIL);
ExecInsertIndexTuples(resultRelInfo, elemTupleSlot, estate, false, false, NULL, NIL,
(update_indexes == TU_Summarizing));
}

ExecCloseIndices(resultRelInfo);
Expand Down Expand Up @@ -484,7 +485,8 @@ static void process_update_list(CustomScanState *node)
}

// Alter the properties Agtype value.
if (strcmp(update_item->prop_name, ""))
if (update_item->prop_name != NULL &&
strcmp(update_item->prop_name, "") != 0)
{
altered_properties = alter_property_value(original_properties,
update_item->prop_name,
Expand Down
Loading