This is an automated email from the ASF dual-hosted git repository.
jgemignani pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/age.git
The following commit(s) were added to refs/heads/master by this push:
new fd70d0af Master to PostgreSQL version 14 (#1081)
fd70d0af is described below
commit fd70d0afd9cd3c37ef948c5417807d0d2f331481
Author: John Gemignani <[email protected]>
AuthorDate: Mon Jul 24 17:11:59 2023 -0700
Master to PostgreSQL version 14 (#1081)
PR for moving the master branch up to PostgreSQL 14.
It contains all of the latest work in the master branch in addition to all
of the changes made to go from PostgreSQL 13 to 14. When this PR is merged the
master will be the latest and on PostgreSQL 14.
Co-authored-by: Shoaib <[email protected]>
---
.github/workflows/go-driver.yml | 12 +-
.github/workflows/installcheck.yaml | 30 ++---
.github/workflows/jdbc-driver.yaml | 12 +-
.github/workflows/nodejs-driver.yaml | 12 +-
.github/workflows/python-driver.yaml | 12 +-
META.json | 2 +-
README.md | 14 +-
RELEASE | 54 ++------
age--1.0.0--1.1.0.sql | 247 ----------------------------------
age--1.1.0--1.1.1.sql | 37 -----
age--1.2.0--1.3.0.sql | 61 ---------
docker/Dockerfile | 4 +-
docker/Dockerfile.dev | 4 +-
regress/expected/expr.out | 12 +-
src/backend/catalog/ag_catalog.c | 8 +-
src/backend/commands/label_commands.c | 10 +-
src/backend/executor/cypher_create.c | 16 +--
src/backend/executor/cypher_delete.c | 8 +-
src/backend/executor/cypher_merge.c | 16 +--
src/backend/executor/cypher_set.c | 18 +--
src/backend/executor/cypher_utils.c | 3 +-
src/backend/parser/cypher_analyze.c | 10 +-
src/backend/parser/cypher_clause.c | 34 +++--
src/backend/parser/cypher_expr.c | 4 +-
src/backend/parser/cypher_gram.y | 4 +-
src/backend/parser/cypher_item.c | 2 +-
src/backend/utils/cache/ag_cache.c | 4 +-
src/backend/utils/graph_generation.c | 3 +-
28 files changed, 143 insertions(+), 510 deletions(-)
diff --git a/.github/workflows/go-driver.yml b/.github/workflows/go-driver.yml
index 830b1e7a..d9f69a5e 100644
--- a/.github/workflows/go-driver.yml
+++ b/.github/workflows/go-driver.yml
@@ -2,10 +2,10 @@ name: Go Driver Tests
on:
push:
- branches: [ "master", "PG13" ]
+ branches: [ "master", "PG14" ]
pull_request:
- branches: [ "master", "PG13" ]
+ branches: [ "master", "PG14" ]
jobs:
build:
@@ -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/PG13" ]]; then
- echo "TAG=PG13_latest" >> $GITHUB_ENV
+ elif [[ "$GITHUB_REF" == "refs/heads/PG14" ]]; then
+ echo "TAG=PG14_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" == "PG13" ]]; then
- echo "TAG=PG13_latest" >> $GITHUB_ENV
+ elif [[ "$GITHUB_BASE_REF" == "PG14" ]]; then
+ echo "TAG=PG14_latest" >> $GITHUB_ENV
fi
fi
diff --git a/.github/workflows/installcheck.yaml
b/.github/workflows/installcheck.yaml
index 607731cb..9e831494 100644
--- a/.github/workflows/installcheck.yaml
+++ b/.github/workflows/installcheck.yaml
@@ -2,32 +2,32 @@ name: Build / Regression
on:
push:
- branches: [ 'master', 'PG13' ]
+ branches: [ 'master', 'PG14' ]
pull_request:
- branches: [ 'master', 'PG13' ]
+ branches: [ 'master', 'PG14' ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- - name: Get latest commit id of PostgreSQL 13
+ - name: Get latest commit id of PostgreSQL 14
run: |
- echo "PG_COMMIT_HASH=$(git ls-remote
git://git.postgresql.org/git/postgresql.git refs/heads/REL_13_STABLE | awk
'{print $1}')" >> $GITHUB_ENV
+ echo "PG_COMMIT_HASH=$(git ls-remote
git://git.postgresql.org/git/postgresql.git refs/heads/REL_14_STABLE | awk
'{print $1}')" >> $GITHUB_ENV
- - name: Cache PostgreSQL 13
+ - name: Cache PostgreSQL 14
uses: actions/cache@v3
- id: pg13cache
+ id: pg14cache
with:
- path: ~/pg13
- key: ${{ runner.os }}-v1-pg13-${{ env.PG_COMMIT_HASH }}
+ path: ~/pg14
+ key: ${{ runner.os }}-v1-pg14-${{ env.PG_COMMIT_HASH }}
- - name: Install PostgreSQL 13
- if: steps.pg13cache.outputs.cache-hit != 'true'
+ - name: Install PostgreSQL 14
+ if: steps.pg14cache.outputs.cache-hit != 'true'
run: |
- git clone --depth 1 --branch REL_13_STABLE
git://git.postgresql.org/git/postgresql.git ~/pg13source
- cd ~/pg13source
- ./configure --prefix=$HOME/pg13 CFLAGS="-std=gnu99 -ggdb -O0"
--enable-cassert
+ git clone --depth 1 --branch REL_14_STABLE
git://git.postgresql.org/git/postgresql.git ~/pg14source
+ cd ~/pg14source
+ ./configure --prefix=$HOME/pg14 CFLAGS="-std=gnu99 -ggdb -O0"
--enable-cassert
make install -j$(nproc) > /dev/null
- uses: actions/checkout@v3
@@ -35,12 +35,12 @@ jobs:
- name: Build
id: build
run: |
- make PG_CONFIG=$HOME/pg13/bin/pg_config install -j$(nproc)
+ make PG_CONFIG=$HOME/pg14/bin/pg_config install -j$(nproc)
- name: Regression tests
id: regression_tests
run: |
- make PG_CONFIG=$HOME/pg13/bin/pg_config installcheck
+ make PG_CONFIG=$HOME/pg14/bin/pg_config installcheck
continue-on-error: true
- name: Dump regression test errors
diff --git a/.github/workflows/jdbc-driver.yaml
b/.github/workflows/jdbc-driver.yaml
index 02ad8f35..9be72f8c 100644
--- a/.github/workflows/jdbc-driver.yaml
+++ b/.github/workflows/jdbc-driver.yaml
@@ -2,10 +2,10 @@ name: JDBC Driver Tests
on:
push:
- branches: [ "master", "PG13" ]
+ branches: [ "master", "PG14" ]
pull_request:
- branches: [ "master", "PG13" ]
+ branches: [ "master", "PG14" ]
jobs:
build:
@@ -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/PG13" ]]; then
- echo "TAG=PG13_latest" >> $GITHUB_ENV
+ elif [[ "$GITHUB_REF" == "refs/heads/PG14" ]]; then
+ echo "TAG=PG14_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" == "PG13" ]]; then
- echo "TAG=PG13_latest" >> $GITHUB_ENV
+ elif [[ "$GITHUB_BASE_REF" == "PG14" ]]; then
+ echo "TAG=PG14_latest" >> $GITHUB_ENV
fi
fi
diff --git a/.github/workflows/nodejs-driver.yaml
b/.github/workflows/nodejs-driver.yaml
index 0d95af65..78303591 100644
--- a/.github/workflows/nodejs-driver.yaml
+++ b/.github/workflows/nodejs-driver.yaml
@@ -2,10 +2,10 @@ name: Nodejs Driver Tests
on:
push:
- branches: [ "master", "PG13" ]
+ branches: [ "master", "PG14" ]
pull_request:
- branches: [ "master", "PG13" ]
+ branches: [ "master", "PG14" ]
jobs:
build:
@@ -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/PG13" ]]; then
- echo "TAG=PG13_latest" >> $GITHUB_ENV
+ elif [[ "$GITHUB_REF" == "refs/heads/PG14" ]]; then
+ echo "TAG=PG14_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" == "PG13" ]]; then
- echo "TAG=PG13_latest" >> $GITHUB_ENV
+ elif [[ "$GITHUB_BASE_REF" == "PG14" ]]; then
+ echo "TAG=PG14_latest" >> $GITHUB_ENV
fi
fi
diff --git a/.github/workflows/python-driver.yaml
b/.github/workflows/python-driver.yaml
index af335e2f..2bb6206f 100644
--- a/.github/workflows/python-driver.yaml
+++ b/.github/workflows/python-driver.yaml
@@ -2,10 +2,10 @@ name: Python Driver Tests
on:
push:
- branches: [ "master", "PG13" ]
+ branches: [ "master", "PG14" ]
pull_request:
- branches: [ "master", "PG13" ]
+ branches: [ "master", "PG14" ]
jobs:
build:
@@ -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/PG13" ]]; then
- echo "TAG=PG13_latest" >> $GITHUB_ENV
+ elif [[ "$GITHUB_REF" == "refs/heads/PG14" ]]; then
+ echo "TAG=PG14_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" == "PG13" ]]; then
- echo "TAG=PG13_latest" >> $GITHUB_ENV
+ elif [[ "$GITHUB_BASE_REF" == "PG14" ]]; then
+ echo "TAG=PG14_latest" >> $GITHUB_ENV
fi
fi
diff --git a/META.json b/META.json
index 0e6c6655..bb63a056 100644
--- a/META.json
+++ b/META.json
@@ -18,7 +18,7 @@
"prereqs": {
"runtime": {
"requires": {
- "PostgreSQL": "13.0.0"
+ "PostgreSQL": "14.0.0"
}
}
},
diff --git a/README.md b/README.md
index acd0899c..60b3347c 100644
--- a/README.md
+++ b/README.md
@@ -33,8 +33,8 @@
<img
src="https://img.shields.io/badge/Release-v1.3.0-FFA500?labelColor=gray&style=flat&link=https://github.com/apache/age/releases"/>
</a>
- <a href="https://www.postgresql.org/docs/13/index.html">
- <img src="https://img.shields.io/badge/Version-PostgreSQL
13-00008B?labelColor=gray&style=flat&link=https://www.postgresql.org/docs/13/index.html"/>
+ <a href="https://www.postgresql.org/docs/14/index.html">
+ <img src="https://img.shields.io/badge/Version-PostgreSQL
14-00008B?labelColor=gray&style=flat&link=https://www.postgresql.org/docs/14/index.html"/>
</a>
<a href="https://github.com/apache/age/issues">
@@ -76,7 +76,7 @@ There is a strong need for cohesive, easy-to-implement
multi-model databases. As
<h2><img height="30" src="/img/tick.svg"> Overview</h2>
-Apache AGE is :
+Apache AGE is :
- **Powerful**: adds graph database support to the already popular PostgreSQL
database: PostgreSQL is used by organizations including Apple, Spotify, and
NASA.
- **Flexible**: allows you to perform openCypher queries, which makes complex
queries much easier to write. It also enables querying multiple graphs at the
same time.
@@ -131,7 +131,7 @@ Apache AGE is intended to be simple to install and run. It
can be installed with
Install PostgreSQL
</h4>
-You will need to install an AGE compatible version of Postgres<a>, for now AGE
supports Postgres 11, 12, & 13. Supporting the latest versions is on AGE
roadmap.
+You will need to install an AGE compatible version of Postgres<a>, for now AGE
supports Postgres 11, 12, 13 & 14. Supporting the latest versions is on AGE
roadmap.
<h4>
Installation via Package Manager
@@ -142,14 +142,14 @@ You can use a <a
href="https://www.postgresql.org/download/">package management
<br>
```bash
-sudo apt install postgresql
+sudo apt install postgresql
```
<h4>
Installation From Source Code
</h4>
-You can <a href="https://www.postgresql.org/ftp/source/"> download the
Postgres </a> source code and install your own instance of Postgres. You can
read instructions on how to install from source code for different versions on
the <a href="https://www.postgresql.org/docs/13/installation.html">official
Postgres Website.</a>
+You can <a href="https://www.postgresql.org/ftp/source/"> download the
Postgres </a> source code and install your own instance of Postgres. You can
read instructions on how to install from source code for different versions on
the <a href="https://www.postgresql.org/docs/14/installation.html">official
Postgres Website.</a>
@@ -158,7 +158,7 @@ You can <a href="https://www.postgresql.org/ftp/source/">
download the Postgres
Clone the <a href="https://github.com/apache/age">github repository</a> or
download the <a href="https://github.com/apache/age/releases">download an
official release.
</a>
-Run the pg_config utility and check the version of PostgreSQL. Currently, only
PostgreSQL versions 11, 12, & 13 are supported. If you have any other version
of Postgres, you will need to install PostgreSQL version 11, 12, or 13.
+Run the pg_config utility and check the version of PostgreSQL. Currently, only
PostgreSQL versions 11, 12, 13 & 14 are supported. If you have any other
version of Postgres, you will need to install PostgreSQL version 11, 12, 13, or
14.
<br>
```bash
diff --git a/RELEASE b/RELEASE
index dd217fa8..329a9307 100644
--- a/RELEASE
+++ b/RELEASE
@@ -15,50 +15,14 @@
# specific language governing permissions and limitations
# under the License.
-Release Notes for Apache AGE release v1.3.0 for PG 13
+Release Notes for Apache AGE release 0.0.0 for PG 14
-Apache AGE 1.3.0 - Release Notes
+Apache AGE 0.0.0 - Release Notes
-Implement CALL ...[YIELD] for cypher functions. (#630)
-Graph names with the empty string '' are no more allowed. (#251)
-Fix typos at multiple locations. (#470)
-Fix Bug with CALL... [YIELD], clause ignores WHERE.
-Fix EXPLAIN to allow for nested cypher commands.
-Fix delete_global_graphs and add regression tests. (#336)
-Invalid labels now return NULL.
-Update CONTRIBUTING.md (#348)
-Fix null pointer on name compare. (#376)
-Fix Travis CI warning messages.
-Additional regression tests added for age_global_graph. (#341)
-Readme Added for AGE-JDBC-Driver. (#383)
-Updated volitility categories for many functions.
-Fix issue 339 - entities in WHERE clause have wrong Expr. (#391)
-Create complete graph function. (#342) (#662)
-Fix issue 317: Graph naming convention. (#349)
-Update SET clause to support assigning a map to a variable. (#468)
-Patch to address PR 203 that appears to be inactive. (#671)
-Add additional comments for create_graph function. (#582)
-Optimize age_exists function. (#586)
-Implement plus-equal operator in SET clause. (#638)
-Implement CI test for python driver. (#587)
-Move from travis CI to github actions for build. (#673)
-Update all driver CIs to Github actions.
-Fix build warnings. (#709)
-Updated Readme for drivers folder. (#642)
-Removed async from function definitions. (#680)
-Barbell graph generation (#648) and Barbell regress tests. (#708)
-UPDATED Python Driver ANTLR 4.9.3 -> 4.11.1 (#706)
-Fix WITH ignoring WHERE clause. (#646)
-Implement isEmpty() predicate function. (#710)
-Fix cypher function input argument checks. (#718)
-Fix Issue 693 - server termination from return exists(path). (#721)
-Update regression tests for cypher_with. (#725)
-Fix issue 733 - create_complete_graph() terminates the server. (#734)
-Prevent MATCH from following OPTIONAL MATCH. (#740)
-Fix property constraints against resolved variables. (#724) (#751) (#701)
(#747)
-Include invalid labels in reused variables. (#751) (#762)
-Fix update_entity_tuple to use correct CommandId. (#769)
-Remove check for scalar agtypes in unwind. (#736)
-Update PG13 CI workflows. (#775)
-Update readme and version for python driver. (#780)
-Update README.md
+NOTE: This is an initial release of PG14. There are no upgrade
+ scripts to this release.
+
+**************************************************************
+***** THIS IS THE MASTER BRANCH TEMPLATE FOR THE RELEASE *****
+***** FILE. MODIFY AS NECESSARY FOR THE SPECIFIC RELEASE *****
+**************************************************************
diff --git a/age--1.0.0--1.1.0.sql b/age--1.0.0--1.1.0.sql
deleted file mode 100644
index 13b205a4..00000000
--- a/age--1.0.0--1.1.0.sql
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
--- complain if script is sourced in psql, rather than via CREATE EXTENSION
-\echo Use "ALTER EXTENSION age UPDATE TO '1.1.0'" to load this file. \quit
-
---
--- agtype - access operators ( ->, ->> )
---
-
-CREATE FUNCTION ag_catalog.agtype_object_field(agtype, text)
-RETURNS agtype
-LANGUAGE c
-IMMUTABLE
-RETURNS NULL ON NULL INPUT
-PARALLEL SAFE
-AS 'MODULE_PATHNAME';
-
--- get agtype object field
-CREATE OPERATOR -> (
- LEFTARG = agtype,
- RIGHTARG = text,
- FUNCTION = ag_catalog.agtype_object_field
-);
-
-CREATE FUNCTION ag_catalog.agtype_object_field_text(agtype, text)
-RETURNS text
-LANGUAGE c
-IMMUTABLE
-RETURNS NULL ON NULL INPUT
-PARALLEL SAFE
-AS 'MODULE_PATHNAME';
-
--- get agtype object field as text
-CREATE OPERATOR ->> (
- LEFTARG = agtype,
- RIGHTARG = text,
- FUNCTION = ag_catalog.agtype_object_field_text
-);
-
-CREATE FUNCTION ag_catalog.agtype_array_element(agtype, int4)
-RETURNS agtype
-LANGUAGE c
-IMMUTABLE
-RETURNS NULL ON NULL INPUT
-PARALLEL SAFE
-AS 'MODULE_PATHNAME';
-
--- get agtype array element
-CREATE OPERATOR -> (
- LEFTARG = agtype,
- RIGHTARG = int4,
- FUNCTION = ag_catalog.agtype_array_element
-);
-
-CREATE FUNCTION ag_catalog.agtype_array_element_text(agtype, int4)
-RETURNS text
-LANGUAGE c
-IMMUTABLE
-RETURNS NULL ON NULL INPUT
-PARALLEL SAFE
-AS 'MODULE_PATHNAME';
-
--- get agtype array element as text
-CREATE OPERATOR ->> (
- LEFTARG = agtype,
- RIGHTARG = int4,
- FUNCTION = ag_catalog.agtype_array_element_text
-);
-
---
--- Contains operators @> <@
---
-CREATE FUNCTION ag_catalog.agtype_contains(agtype, agtype)
-RETURNS boolean
-LANGUAGE c
-STABLE
-RETURNS NULL ON NULL INPUT
-PARALLEL SAFE
-AS 'MODULE_PATHNAME';
-
-CREATE OPERATOR @> (
- LEFTARG = agtype,
- RIGHTARG = agtype,
- FUNCTION = ag_catalog.agtype_contains,
- COMMUTATOR = '<@',
- RESTRICT = contsel,
- JOIN = contjoinsel
-);
-
-CREATE FUNCTION ag_catalog.agtype_contained_by(agtype, agtype)
-RETURNS boolean
-LANGUAGE c
-STABLE
-RETURNS NULL ON NULL INPUT
-PARALLEL SAFE
-AS 'MODULE_PATHNAME';
-
-CREATE OPERATOR <@ (
- LEFTARG = agtype,
- RIGHTARG = agtype,
- FUNCTION = ag_catalog.agtype_contained_by,
- COMMUTATOR = '@>',
- RESTRICT = contsel,
- JOIN = contjoinsel
-);
-
---
--- Key Existence Operators ? ?| ?&
---
-CREATE FUNCTION ag_catalog.agtype_exists(agtype, text)
-RETURNS boolean
-LANGUAGE c
-IMMUTABLE
-RETURNS NULL ON NULL INPUT
-PARALLEL SAFE
-AS 'MODULE_PATHNAME';
-
-CREATE OPERATOR ? (
- LEFTARG = agtype,
- RIGHTARG = text,
- FUNCTION = ag_catalog.agtype_exists,
- COMMUTATOR = '?',
- RESTRICT = contsel,
- JOIN = contjoinsel
-);
-
-CREATE FUNCTION ag_catalog.agtype_exists_any(agtype, text[])
-RETURNS boolean
-LANGUAGE c
-IMMUTABLE
-RETURNS NULL ON NULL INPUT
-PARALLEL SAFE
-AS 'MODULE_PATHNAME';
-
-CREATE OPERATOR ?| (
- LEFTARG = agtype,
- RIGHTARG = text[],
- FUNCTION = ag_catalog.agtype_exists_any,
- RESTRICT = contsel,
- JOIN = contjoinsel
-);
-
-CREATE FUNCTION ag_catalog.agtype_exists_all(agtype, text[])
-RETURNS boolean
-LANGUAGE c
-IMMUTABLE
-RETURNS NULL ON NULL INPUT
-PARALLEL SAFE
-AS 'MODULE_PATHNAME';
-
-CREATE OPERATOR ?& (
- LEFTARG = agtype,
- RIGHTARG = text[],
- FUNCTION = ag_catalog.agtype_exists_all,
- RESTRICT = contsel,
- JOIN = contjoinsel
-);
-
---
--- agtype GIN support
---
-CREATE FUNCTION ag_catalog.gin_compare_agtype(text, text)
-RETURNS int
-AS 'MODULE_PATHNAME'
-LANGUAGE C
-IMMUTABLE
-STRICT
-PARALLEL SAFE;
-
-CREATE FUNCTION gin_extract_agtype(agtype, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C
-IMMUTABLE
-STRICT
-PARALLEL SAFE;
-
-CREATE FUNCTION ag_catalog.gin_extract_agtype_query(agtype, internal, int2,
- internal, internal)
-RETURNS internal
-AS 'MODULE_PATHNAME'
-LANGUAGE C
-IMMUTABLE
-STRICT
-PARALLEL SAFE;
-
-CREATE FUNCTION ag_catalog.gin_consistent_agtype(internal, int2, agtype, int4,
- internal, internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C
-IMMUTABLE
-STRICT
-PARALLEL SAFE;
-
-CREATE FUNCTION ag_catalog.gin_triconsistent_agtype(internal, int2, agtype,
int4,
- internal, internal,
internal)
-RETURNS bool
-AS 'MODULE_PATHNAME'
-LANGUAGE C
-IMMUTABLE
-STRICT
-PARALLEL SAFE;
-
-CREATE OPERATOR CLASS ag_catalog.gin_agtype_ops
-DEFAULT FOR TYPE agtype USING gin AS
- OPERATOR 7 @>,
- OPERATOR 9 ?(agtype, text),
- OPERATOR 10 ?|(agtype, text[]),
- OPERATOR 11 ?&(agtype, text[]),
- FUNCTION 1 ag_catalog.gin_compare_agtype(text,text),
- FUNCTION 2 ag_catalog.gin_extract_agtype(agtype, internal),
- FUNCTION 3 ag_catalog.gin_extract_agtype_query(agtype, internal, int2,
- internal, internal),
- FUNCTION 4 ag_catalog.gin_consistent_agtype(internal, int2, agtype, int4,
- internal, internal),
- FUNCTION 6 ag_catalog.gin_triconsistent_agtype(internal, int2, agtype, int4,
- internal, internal, internal),
-STORAGE text;
-
---
--- graph id conversion function
---
-ALTER FUNCTION ag_catalog.agtype_access_operator(VARIADIC agtype[]) IMMUTABLE;
-
-DROP FUNCTION IF EXISTS ag_catalog._property_constraint_check(agtype, agtype);
-
---
--- end
---
diff --git a/age--1.1.0--1.1.1.sql b/age--1.1.0--1.1.1.sql
deleted file mode 100644
index e4ec742d..00000000
--- a/age--1.1.0--1.1.1.sql
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
--- complain if script is sourced in psql, rather than via ALTER EXTENSION
-\echo Use "ALTER EXTENSION age UPDATE TO '1.1.1'" to load this file. \quit
-
--- add in new age_prepare_cypher function
-CREATE FUNCTION ag_catalog.age_prepare_cypher(cstring, cstring)
-RETURNS boolean
-LANGUAGE c
-STABLE
-PARALLEL SAFE
-AS 'MODULE_PATHNAME';
-
--- modify the param defaults for cypher function
-CREATE OR REPLACE FUNCTION ag_catalog.cypher(graph_name name = NULL,
- query_string cstring = NULL,
- params agtype = NULL)
-RETURNS SETOF record
-LANGUAGE c
-AS 'MODULE_PATHNAME';
diff --git a/age--1.2.0--1.3.0.sql b/age--1.2.0--1.3.0.sql
deleted file mode 100644
index d06214c5..00000000
--- a/age--1.2.0--1.3.0.sql
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
--- complain if script is sourced in psql, rather than via CREATE EXTENSION
-\echo Use "ALTER EXTENSION age UPDATE TO '1.3.0'" to load this file. \quit
-
-CREATE FUNCTION ag_catalog.agtype_build_map_nonull(VARIADIC "any")
-RETURNS agtype
-LANGUAGE c
-STABLE
-CALLED ON NULL INPUT
-PARALLEL SAFE
-AS 'MODULE_PATHNAME';
-
-CREATE FUNCTION ag_catalog.age_isempty(agtype)
-RETURNS boolean
-LANGUAGE c
-IMMUTABLE
-RETURNS NULL ON NULL INPUT
-PARALLEL SAFE
-AS 'MODULE_PATHNAME';
-
-CREATE OR REPLACE FUNCTION ag_catalog.age_unnest(agtype)
-RETURNS SETOF agtype
-LANGUAGE c
-IMMUTABLE
-PARALLEL SAFE
-AS 'MODULE_PATHNAME';
-
-CREATE FUNCTION ag_catalog.age_create_barbell_graph(graph_name name,
- graph_size int,
- bridge_size int,
- node_label name = NULL,
- node_properties agtype = NULL,
- edge_label name = NULL,
- edge_properties agtype = NULL)
-RETURNS void
-LANGUAGE c
-CALLED ON NULL INPUT
-PARALLEL SAFE
-AS 'MODULE_PATHNAME';
-
---
--- End
---
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 3537d02c..c30d6931 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -16,14 +16,14 @@
# limitations under the License.
#
-FROM postgres:13
+FROM postgres:14
RUN apt-get update
RUN apt-get install --assume-yes --no-install-recommends --no-install-suggests
\
bison \
build-essential \
flex \
- postgresql-server-dev-13
+ postgresql-server-dev-14
COPY . /age
RUN cd /age && make install
diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev
index fe40788e..5e47d49b 100644
--- a/docker/Dockerfile.dev
+++ b/docker/Dockerfile.dev
@@ -17,14 +17,14 @@
#
-FROM postgres:13-buster
+FROM postgres:14-buster
RUN apt-get update
RUN apt-get install --assume-yes --no-install-recommends --no-install-suggests
\
bison \
build-essential \
flex \
- postgresql-server-dev-13
+ postgresql-server-dev-14
COPY . /age
diff --git a/regress/expected/expr.out b/regress/expected/expr.out
index b01cf977..94c8d180 100644
--- a/regress/expected/expr.out
+++ b/regress/expected/expr.out
@@ -1603,11 +1603,19 @@ ERROR: invalid input syntax for type numeric: "2:71"
SELECT * FROM cypher('expr', $$
RETURN ('inf'::numeric)::numeric
$$) AS r(result agtype);
-ERROR: invalid input syntax for type numeric: "inf"
+ result
+-------------------
+ Infinity::numeric
+(1 row)
+
SELECT * FROM cypher('expr', $$
RETURN ('infinity'::numeric)::numeric
$$) AS r(result agtype);
-ERROR: invalid input syntax for type numeric: "infinity"
+ result
+-------------------
+ Infinity::numeric
+(1 row)
+
-- verify that output can be accepted and reproduced correctly via agtype_in
SELECT agtype_in('2.71::numeric');
agtype_in
diff --git a/src/backend/catalog/ag_catalog.c b/src/backend/catalog/ag_catalog.c
index 2004f4d7..f7ed249c 100644
--- a/src/backend/catalog/ag_catalog.c
+++ b/src/backend/catalog/ag_catalog.c
@@ -39,7 +39,7 @@ static bool prev_object_hook_is_set;
static void object_access(ObjectAccessType access, Oid class_id, Oid object_id,
int sub_id, void *arg);
-void ag_ProcessUtility_hook(PlannedStmt *pstmt, const char *queryString,
+void ag_ProcessUtility_hook(PlannedStmt *pstmt, const char *queryString, bool
readOnlyTree,
ProcessUtilityContext context, ParamListInfo
params,
QueryEnvironment *queryEnv, DestReceiver *dest,
QueryCompletion *qc);
@@ -86,7 +86,7 @@ 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,
+void ag_ProcessUtility_hook(PlannedStmt *pstmt, const char *queryString, bool
readOnlyTree,
ProcessUtilityContext context, ParamListInfo
params,
QueryEnvironment *queryEnv, DestReceiver *dest,
QueryCompletion *qc)
@@ -94,10 +94,10 @@ void ag_ProcessUtility_hook(PlannedStmt *pstmt, const char
*queryString,
if (is_age_drop(pstmt))
drop_age_extension((DropStmt *)pstmt->utilityStmt);
else if (prev_process_utility_hook)
- (*prev_process_utility_hook) (pstmt, queryString, context, params,
+ (*prev_process_utility_hook) (pstmt, queryString, readOnlyTree,
context, params,
queryEnv, dest, qc);
else
- standard_ProcessUtility(pstmt, queryString, context, params, queryEnv,
+ standard_ProcessUtility(pstmt, queryString, readOnlyTree, context,
params, queryEnv,
dest, qc);
}
diff --git a/src/backend/commands/label_commands.c
b/src/backend/commands/label_commands.c
index bc0f74c8..6eb991da 100644
--- a/src/backend/commands/label_commands.c
+++ b/src/backend/commands/label_commands.c
@@ -377,7 +377,7 @@ static void create_table_for_label(char *graph_name, char
*label_name,
wrapper->stmt_location = -1;
wrapper->stmt_len = 0;
- ProcessUtility(wrapper, "(generated CREATE TABLE command)",
+ ProcessUtility(wrapper, "(generated CREATE TABLE command)", false,
PROCESS_UTILITY_SUBCOMMAND, NULL, NULL, None_Receiver,
NULL);
// CommandCounterIncrement() is called in ProcessUtility()
@@ -524,7 +524,7 @@ static FuncCall *build_id_default_func_expr(char
*graph_name, char *label_name,
label_name_const->val.val.str = label_name;
label_name_const->location = -1;
label_id_func_args = list_make2(graph_name_const, label_name_const);
- label_id_func = makeFuncCall(label_id_func_name, label_id_func_args, -1);
+ label_id_func = makeFuncCall(label_id_func_name, label_id_func_args,
COERCE_SQL_SYNTAX, -1);
//Build a node that will get the next val from the label's sequence
nextval_func_name = SystemFuncName("nextval");
@@ -538,7 +538,7 @@ static FuncCall *build_id_default_func_expr(char
*graph_name, char *label_name,
regclass_cast->arg = (Node *)qualified_seq_name_const;
regclass_cast->location = -1;
nextval_func_args = list_make1(regclass_cast);
- nextval_func = makeFuncCall(nextval_func_name, nextval_func_args, -1);
+ nextval_func = makeFuncCall(nextval_func_name, nextval_func_args,
COERCE_SQL_SYNTAX, -1);
/*
* Build a node that constructs the graphid from the label id function
@@ -547,7 +547,7 @@ static FuncCall *build_id_default_func_expr(char
*graph_name, char *label_name,
graphid_func_name = list_make2(makeString("ag_catalog"),
makeString("_graphid"));
graphid_func_args = list_make2(label_id_func, nextval_func);
- graphid_func = makeFuncCall(graphid_func_name, graphid_func_args, -1);
+ graphid_func = makeFuncCall(graphid_func_name, graphid_func_args,
COERCE_SQL_SYNTAX, -1);
return graphid_func;
}
@@ -595,7 +595,7 @@ static Constraint *build_properties_default(void)
// "ag_catalog"."agtype_build_map"()
func_name = list_make2(makeString("ag_catalog"),
makeString("agtype_build_map"));
- func = makeFuncCall(func_name, NIL, -1);
+ func = makeFuncCall(func_name, NIL, COERCE_SQL_SYNTAX, -1);
props_default = makeNode(Constraint);
props_default->contype = CONSTR_DEFAULT;
diff --git a/src/backend/executor/cypher_create.c
b/src/backend/executor/cypher_create.c
index 560d110b..be7825bf 100644
--- a/src/backend/executor/cypher_create.c
+++ b/src/backend/executor/cypher_create.c
@@ -346,7 +346,7 @@ static void create_edge(cypher_create_custom_scan_state
*css,
EState *estate = css->css.ss.ps.state;
ExprContext *econtext = css->css.ss.ps.ps_ExprContext;
ResultRelInfo *resultRelInfo = node->resultRelInfo;
- ResultRelInfo *old_estate_es_result_relation_info = NULL;
+ ResultRelInfo **old_estate_es_result_relations = NULL;
TupleTableSlot *elemTupleSlot = node->elemTupleSlot;
TupleTableSlot *scanTupleSlot = econtext->ecxt_scantuple;
Datum id;
@@ -393,9 +393,9 @@ static void create_edge(cypher_create_custom_scan_state
*css,
*/
/* save the old result relation info */
- old_estate_es_result_relation_info = estate->es_result_relation_info;
+ old_estate_es_result_relations = estate->es_result_relations;
- estate->es_result_relation_info = resultRelInfo;
+ estate->es_result_relations = &resultRelInfo;
ExecClearTuple(elemTupleSlot);
@@ -422,7 +422,7 @@ static void create_edge(cypher_create_custom_scan_state
*css,
insert_entity_tuple(resultRelInfo, elemTupleSlot, estate);
/* restore the old result relation info */
- estate->es_result_relation_info = old_estate_es_result_relation_info;
+ estate->es_result_relations = old_estate_es_result_relations;
/*
* When the edge is used by clauses higher in the execution tree
@@ -478,7 +478,7 @@ static Datum create_vertex(cypher_create_custom_scan_state
*css,
*/
if (CYPHER_TARGET_NODE_INSERT_ENTITY(node->flags))
{
- ResultRelInfo *old_estate_es_result_relation_info = NULL;
+ ResultRelInfo **old_estate_es_result_relations = NULL;
/*
* Set estate's result relation to the vertex's result
@@ -488,9 +488,9 @@ static Datum create_vertex(cypher_create_custom_scan_state
*css,
*/
/* save the old result relation info */
- old_estate_es_result_relation_info = estate->es_result_relation_info;
+ old_estate_es_result_relations = estate->es_result_relations;
- estate->es_result_relation_info = resultRelInfo;
+ estate->es_result_relations = &resultRelInfo;
ExecClearTuple(elemTupleSlot);
@@ -509,7 +509,7 @@ static Datum create_vertex(cypher_create_custom_scan_state
*css,
insert_entity_tuple(resultRelInfo, elemTupleSlot, estate);
/* restore the old result relation info */
- estate->es_result_relation_info = old_estate_es_result_relation_info;
+ estate->es_result_relations = old_estate_es_result_relations;
/*
* When the vertex is used by clauses higher in the execution tree
diff --git a/src/backend/executor/cypher_delete.c
b/src/backend/executor/cypher_delete.c
index a8300360..68fafae7 100644
--- a/src/backend/executor/cypher_delete.c
+++ b/src/backend/executor/cypher_delete.c
@@ -279,7 +279,7 @@ static agtype_value *extract_entity(CustomScanState *node,
static void delete_entity(EState *estate, ResultRelInfo *resultRelInfo,
HeapTuple tuple)
{
- ResultRelInfo *saved_resultRelInfo;
+ ResultRelInfo **saved_resultRels;
LockTupleMode lockmode;
TM_FailureData hufd;
TM_Result lock_result;
@@ -287,8 +287,8 @@ static void delete_entity(EState *estate, ResultRelInfo
*resultRelInfo,
Buffer buffer;
// Find the physical tuple, this variable is coming from
- saved_resultRelInfo = estate->es_result_relation_info;
- estate->es_result_relation_info = resultRelInfo;
+ saved_resultRels = estate->es_result_relations;
+ estate->es_result_relations = &resultRelInfo;
lockmode = ExecUpdateLockMode(estate, resultRelInfo);
@@ -352,7 +352,7 @@ static void delete_entity(EState *estate, ResultRelInfo
*resultRelInfo,
ReleaseBuffer(buffer);
- estate->es_result_relation_info = saved_resultRelInfo;
+ estate->es_result_relations = saved_resultRels;
}
/*
diff --git a/src/backend/executor/cypher_merge.c
b/src/backend/executor/cypher_merge.c
index ab9d4ed9..dbe98851 100644
--- a/src/backend/executor/cypher_merge.c
+++ b/src/backend/executor/cypher_merge.c
@@ -648,7 +648,7 @@ static Datum merge_vertex(cypher_merge_custom_scan_state
*css,
*/
if (CYPHER_TARGET_NODE_INSERT_ENTITY(node->flags))
{
- ResultRelInfo *old_estate_es_result_relation_info = NULL;
+ ResultRelInfo **old_estate_es_result_relations = NULL;
Datum prop;
/*
@@ -659,9 +659,9 @@ static Datum merge_vertex(cypher_merge_custom_scan_state
*css,
*/
/* save the old result relation info */
- old_estate_es_result_relation_info = estate->es_result_relation_info;
+ old_estate_es_result_relations = estate->es_result_relations;
- estate->es_result_relation_info = resultRelInfo;
+ estate->es_result_relations = &resultRelInfo;
ExecClearTuple(elemTupleSlot);
@@ -718,7 +718,7 @@ static Datum merge_vertex(cypher_merge_custom_scan_state
*css,
}
/* restore the old result relation info */
- estate->es_result_relation_info = old_estate_es_result_relation_info;
+ estate->es_result_relations = old_estate_es_result_relations;
/*
* When the vertex is used by clauses higher in the execution tree
@@ -857,7 +857,7 @@ static void merge_edge(cypher_merge_custom_scan_state *css,
EState *estate = css->css.ss.ps.state;
ExprContext *econtext = css->css.ss.ps.ps_ExprContext;
ResultRelInfo *resultRelInfo = node->resultRelInfo;
- ResultRelInfo *old_estate_es_result_relation_info = NULL;
+ ResultRelInfo **old_estate_es_result_relations = NULL;
TupleTableSlot *elemTupleSlot = node->elemTupleSlot;
Datum id;
Datum start_id, end_id, next_vertex_id;
@@ -904,9 +904,9 @@ static void merge_edge(cypher_merge_custom_scan_state *css,
*/
/* save the old result relation info */
- old_estate_es_result_relation_info = estate->es_result_relation_info;
+ old_estate_es_result_relations = estate->es_result_relations;
- estate->es_result_relation_info = resultRelInfo;
+ estate->es_result_relations = &resultRelInfo;
ExecClearTuple(elemTupleSlot);
@@ -932,7 +932,7 @@ static void merge_edge(cypher_merge_custom_scan_state *css,
insert_entity_tuple(resultRelInfo, elemTupleSlot, estate);
/* restore the old result relation info */
- estate->es_result_relation_info = old_estate_es_result_relation_info;
+ estate->es_result_relations = old_estate_es_result_relations;
/*
* When the edge is used by clauses higher in the execution tree
diff --git a/src/backend/executor/cypher_set.c
b/src/backend/executor/cypher_set.c
index 52e16771..4f941bf5 100644
--- a/src/backend/executor/cypher_set.c
+++ b/src/backend/executor/cypher_set.c
@@ -114,9 +114,9 @@ static HeapTuple update_entity_tuple(ResultRelInfo
*resultRelInfo,
bool update_indexes;
TM_Result result;
CommandId cid = GetCurrentCommandId(true);
- ResultRelInfo *saved_resultRelInfo = estate->es_result_relation_info;
+ ResultRelInfo **saved_resultRels = estate->es_result_relations;
- estate->es_result_relation_info = resultRelInfo;
+ estate->es_result_relations = &resultRelInfo;
lockmode = ExecUpdateLockMode(estate, resultRelInfo);
@@ -155,7 +155,7 @@ static HeapTuple update_entity_tuple(ResultRelInfo
*resultRelInfo,
}
ExecCloseIndices(resultRelInfo);
- estate->es_result_relation_info = saved_resultRelInfo;
+ estate->es_result_relations = saved_resultRels;
return tuple;
}
@@ -169,7 +169,7 @@ static HeapTuple update_entity_tuple(ResultRelInfo
*resultRelInfo,
// Insert index entries for the tuple
if (resultRelInfo->ri_NumIndices > 0 && update_indexes)
{
- ExecInsertIndexTuples(elemTupleSlot, estate, false, NULL, NIL);
+ ExecInsertIndexTuples(resultRelInfo, elemTupleSlot, estate, false,
false, NULL, NIL);
}
ExecCloseIndices(resultRelInfo);
@@ -191,7 +191,7 @@ static HeapTuple update_entity_tuple(ResultRelInfo
*resultRelInfo,
ReleaseBuffer(buffer);
- estate->es_result_relation_info = saved_resultRelInfo;
+ estate->es_result_relations = saved_resultRels;
return tuple;
}
@@ -613,12 +613,12 @@ static void process_update_list(CustomScanState *node)
static TupleTableSlot *exec_cypher_set(CustomScanState *node)
{
cypher_set_custom_scan_state *css = (cypher_set_custom_scan_state *)node;
- ResultRelInfo *saved_resultRelInfo;
+ ResultRelInfo **saved_resultRels;
EState *estate = css->css.ss.ps.state;
ExprContext *econtext = css->css.ss.ps.ps_ExprContext;
TupleTableSlot *slot;
- saved_resultRelInfo = estate->es_result_relation_info;
+ saved_resultRels = estate->es_result_relations;
//Process the subtree first
Decrement_Estate_CommandId(estate);
@@ -635,7 +635,7 @@ static TupleTableSlot *exec_cypher_set(CustomScanState
*node)
if (CYPHER_CLAUSE_IS_TERMINAL(css->flags))
{
- estate->es_result_relation_info = saved_resultRelInfo;
+ estate->es_result_relations = saved_resultRels;
process_all_tuples(node);
@@ -650,7 +650,7 @@ static TupleTableSlot *exec_cypher_set(CustomScanState
*node)
/* increment the command counter to reflect the updates */
CommandCounterIncrement();
- estate->es_result_relation_info = saved_resultRelInfo;
+ estate->es_result_relations = saved_resultRels;
econtext->ecxt_scantuple = ExecProject(node->ss.ps.lefttree->ps_ProjInfo);
diff --git a/src/backend/executor/cypher_utils.c
b/src/backend/executor/cypher_utils.c
index 7b92fbc6..0bf3430f 100644
--- a/src/backend/executor/cypher_utils.c
+++ b/src/backend/executor/cypher_utils.c
@@ -254,7 +254,8 @@ HeapTuple insert_entity_tuple_cid(ResultRelInfo
*resultRelInfo,
// Insert index entries for the tuple
if (resultRelInfo->ri_NumIndices > 0)
{
- ExecInsertIndexTuples(elemTupleSlot, estate, false, NULL, NIL);
+ ExecInsertIndexTuples(resultRelInfo, elemTupleSlot, estate, false,
+ false, NULL, NIL);
}
return tuple;
diff --git a/src/backend/parser/cypher_analyze.c
b/src/backend/parser/cypher_analyze.c
index a7895900..f1c481c8 100644
--- a/src/backend/parser/cypher_analyze.c
+++ b/src/backend/parser/cypher_analyze.c
@@ -59,7 +59,7 @@ static void build_explain_query(Query *query, Node
*explain_node);
static post_parse_analyze_hook_type prev_post_parse_analyze_hook;
-static void post_parse_analyze(ParseState *pstate, Query *query);
+static void post_parse_analyze(ParseState *pstate, Query *query, JumbleState
*jstate);
static bool convert_cypher_walker(Node *node, ParseState *pstate);
static bool is_rte_cypher(RangeTblEntry *rte);
static bool is_func_cypher(FuncExpr *funcexpr);
@@ -88,11 +88,11 @@ void post_parse_analyze_fini(void)
post_parse_analyze_hook = prev_post_parse_analyze_hook;
}
-static void post_parse_analyze(ParseState *pstate, Query *query)
+static void post_parse_analyze(ParseState *pstate, Query *query, JumbleState
*jstate)
{
if (prev_post_parse_analyze_hook)
{
- prev_post_parse_analyze_hook(pstate, query);
+ prev_post_parse_analyze_hook(pstate, query, jstate);
}
/*
@@ -512,7 +512,7 @@ static void convert_cypher_to_subquery(RangeTblEntry *rte,
ParseState *pstate)
if (extra_node == NULL)
{
extra_node = llast(stmt);
- list_delete_ptr(stmt, extra_node);
+ stmt = list_delete_ptr(stmt, extra_node);
}
else
{
@@ -522,7 +522,7 @@ static void convert_cypher_to_subquery(RangeTblEntry *rte,
ParseState *pstate)
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("too many extra_nodes passed from parser")));
- list_delete_ptr(stmt, temp);
+ stmt = list_delete_ptr(stmt, temp);
}
cancel_errpos_ecb(&ecb_state);
diff --git a/src/backend/parser/cypher_clause.c
b/src/backend/parser/cypher_clause.c
index 81f5cbfc..cb1c48bf 100644
--- a/src/backend/parser/cypher_clause.c
+++ b/src/backend/parser/cypher_clause.c
@@ -595,7 +595,7 @@ static Query *transform_cypher_union(cypher_parsestate
*cpstate,
nsitem = addRangeTableEntryForJoin(pstate, targetnames, sortnscolumns,
JOIN_INNER, 0, targetvars, NIL, NIL,
- NULL, false);
+ NULL, NULL, false);
sv_namespace = pstate->p_namespace;
pstate->p_namespace = NIL;
@@ -1344,12 +1344,15 @@ static Query *transform_cypher_unwind(cypher_parsestate
*cpstate,
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_ALIAS),
errmsg("duplicate variable \"%s\"",
self->target->name),
- parser_errposition((ParseState *) cpstate,
target_syntax_loc)));
+ parser_errposition((ParseState *) cpstate,
+ target_syntax_loc)));
}
- expr = transform_cypher_expr(cpstate, self->target->val,
EXPR_KIND_SELECT_TARGET);
+ expr = transform_cypher_expr(cpstate, self->target->val,
+ EXPR_KIND_SELECT_TARGET);
- unwind = makeFuncCall(list_make1(makeString("age_unnest")), NIL, -1);
+ unwind = makeFuncCall(list_make1(makeString("age_unnest")), NIL,
+ COERCE_SQL_SYNTAX, -1);
old_expr_kind = pstate->p_expr_kind;
pstate->p_expr_kind = EXPR_KIND_SELECT_TARGET;
@@ -1675,7 +1678,7 @@ cypher_update_information *transform_cypher_set_item_list(
makeString("age_properties"));
args = list_make1(set_item->expr);
set_item->expr = (Node *)makeFuncCall(qualified_name, args,
- -1);
+ COERCE_SQL_SYNTAX, -1);
}
}
else if (!IsA(set_item->prop, A_Indirection))
@@ -2513,6 +2516,7 @@ static RangeTblEntry
*transform_cypher_optional_match_clause(cypher_parsestate *
NIL,
NIL,
j->alias,
+ NULL,
false);
j->rtindex = jnsitem->p_rtindex;
@@ -3051,7 +3055,7 @@ static FuncCall
*prevent_duplicate_edges(cypher_parsestate *cpstate,
}
}
- return makeFuncCall(qualified_function_name, edges, -1);
+ return makeFuncCall(qualified_function_name, edges, COERCE_SQL_SYNTAX, -1);
}
/*
@@ -3167,7 +3171,8 @@ static List
*make_join_condition_for_edge(cypher_parsestate *cpstate,
args = list_make3(left_id, right_id, entity->expr);
// add to quals
- quals = lappend(quals, makeFuncCall(qualified_func_name, args,
-1));
+ quals = lappend(quals, makeFuncCall(qualified_func_name, args,
+ COERCE_EXPLICIT_CALL, -1));
}
/*
@@ -3193,7 +3198,7 @@ static List
*make_join_condition_for_edge(cypher_parsestate *cpstate,
args = list_make2(prev_edge->expr, entity->expr);
// create the function call
- fc = makeFuncCall(qualified_name, args, -1);
+ fc = makeFuncCall(qualified_name, args, COERCE_EXPLICIT_CALL, -1);
quals = lappend(quals, fc);
}
@@ -3428,7 +3433,7 @@ static List *join_to_entity(cypher_parsestate *cpstate,
args = list_make3(entity->expr, qual, make_bool_a_const(is_left_side));
// create the function call
- fc = makeFuncCall(qualified_name, args, -1);
+ fc = makeFuncCall(qualified_name, args, COERCE_EXPLICIT_CALL, -1);
quals = lappend(quals, fc);
@@ -3527,7 +3532,7 @@ static A_Expr
*filter_vertices_on_label_id(cypher_parsestate *cpstate,
extract_label_id = makeString("_extract_label_id");
fc = makeFuncCall(list_make2(ag_catalog, extract_label_id),
- list_make1(id_field), -1);
+ list_make1(id_field), COERCE_EXPLICIT_CALL, -1);
return makeSimpleA_Expr(AEXPR_OP, "=", (Node *)fc, (Node *)n, -1);
}
@@ -3973,7 +3978,7 @@ static List *transform_match_entities(cypher_parsestate
*cpstate, Query *query,
targs = lappend(targs, prop_var);
fname = list_make2(makeString("ag_catalog"),
makeString("age_properties"));
- fc = makeFuncCall(fname, targs, -1);
+ fc = makeFuncCall(fname, targs, COERCE_SQL_SYNTAX, -1);
/*
* Hand off to ParseFuncOrColumn to create the function
@@ -4102,7 +4107,7 @@ static List *transform_match_entities(cypher_parsestate
*cpstate, Query *query,
targs = lappend(targs, prop_var);
fname = list_make2(makeString("ag_catalog"),
makeString("age_properties"));
- fc = makeFuncCall(fname, targs, -1);
+ fc = makeFuncCall(fname, targs, COERCE_SQL_SYNTAX, -1);
/*
* Hand off to ParseFuncOrColumn to create the function
@@ -4356,7 +4361,8 @@ static Node *make_qual(cypher_parsestate *cpstate,
args = list_make1(entity->expr);
- node = (Node *)makeFuncCall(qualified_name, args, -1);
+ node = (Node *)makeFuncCall(qualified_name, args, COERCE_EXPLICIT_CALL,
+ -1);
}
else
{
@@ -6103,7 +6109,7 @@ transform_merge_make_lateral_join(cypher_parsestate
*cpstate, Query *query,
// make the RTE for the join
jnsitem = addRangeTableEntryForJoin(pstate, res_colnames, NULL,
j->jointype,
0, res_colvars, NIL, NIL, j->alias,
- true);
+ NULL, true);
j->rtindex = jnsitem->p_rtindex;
diff --git a/src/backend/parser/cypher_expr.c b/src/backend/parser/cypher_expr.c
index 31881f26..a5465230 100644
--- a/src/backend/parser/cypher_expr.c
+++ b/src/backend/parser/cypher_expr.c
@@ -289,7 +289,7 @@ static Node *transform_WholeRowRef(ParseState *pstate,
ParseNamespaceItem *pnsi,
result->location = location;
/* mark relation as requiring whole-row SELECT access */
- markVarForSelectPriv(pstate, result, rte);
+ markVarForSelectPriv(pstate, result);
return (Node *)result;
}
@@ -1054,7 +1054,7 @@ static Node *transform_cypher_typecast(cypher_parsestate
*cpstate,
}
/* make a function call node */
- fnode = makeFuncCall(fname, list_make1(ctypecast->expr),
+ fnode = makeFuncCall(fname, list_make1(ctypecast->expr), COERCE_SQL_SYNTAX,
ctypecast->location);
/* return the transformed function */
diff --git a/src/backend/parser/cypher_gram.y b/src/backend/parser/cypher_gram.y
index 901cb6a2..26908122 100644
--- a/src/backend/parser/cypher_gram.y
+++ b/src/backend/parser/cypher_gram.y
@@ -2166,11 +2166,11 @@ static Node *make_function_expr(List *func_name, List
*exprs, int location)
funcname = func_name;
/* build the function call */
- fnode = makeFuncCall(funcname, exprs, location);
+ fnode = makeFuncCall(funcname, exprs, COERCE_SQL_SYNTAX, location);
}
/* all other functions are passed as is */
else
- fnode = makeFuncCall(func_name, exprs, location);
+ fnode = makeFuncCall(func_name, exprs, COERCE_SQL_SYNTAX, location);
/* return the node */
return (Node *)fnode;
diff --git a/src/backend/parser/cypher_item.c b/src/backend/parser/cypher_item.c
index 6bcb4783..7d0ad88b 100644
--- a/src/backend/parser/cypher_item.c
+++ b/src/backend/parser/cypher_item.c
@@ -219,7 +219,7 @@ static List *expand_rel_attrs(ParseState *pstate,
RangeTblEntry *rte,
te_list = lappend(te_list, te);
/* Require read access to each column */
- markVarForSelectPriv(pstate, varnode, rte);
+ markVarForSelectPriv(pstate, varnode);
}
Assert(name == NULL && var == NULL); /* lists not the same length? */
diff --git a/src/backend/utils/cache/ag_cache.c
b/src/backend/utils/cache/ag_cache.c
index 7759f56e..a6321620 100644
--- a/src/backend/utils/cache/ag_cache.c
+++ b/src/backend/utils/cache/ag_cache.c
@@ -1159,7 +1159,7 @@ static void *label_seq_name_graph_cache_hash_search(Name
name, Oid graph,
label_seq_name_graph_cache_key key;
// initialize the hash key for label_seq_name_graph_cache_hash
- namecpy(&key.name, name);
+ namestrcpy(&key.name, name->data);
key.graph = graph;
return hash_search(label_seq_name_graph_cache_hash, &key, action, found);
@@ -1197,5 +1197,5 @@ static void fill_label_cache_data(label_cache_data
*cache_data,
// ag_label.seq_name
value = heap_getattr(tuple, Anum_ag_label_seq_name, tuple_desc, &is_null);
Assert(!is_null);
- namecpy(&cache_data->seq_name, DatumGetName(value));
+ namestrcpy(&cache_data->seq_name, DatumGetName(value)->data);
}
diff --git a/src/backend/utils/graph_generation.c
b/src/backend/utils/graph_generation.c
index 0d5d80aa..9b507e11 100644
--- a/src/backend/utils/graph_generation.c
+++ b/src/backend/utils/graph_generation.c
@@ -83,7 +83,7 @@ Datum create_complete_graph(PG_FUNCTION_ARGS)
int64 no_vertices;
int64 i,j,vid = 1, eid, start_vid, end_vid;
- Name vtx_label_name = NULL;
+ Name vtx_label_name;
Name edge_label_name;
int32 vtx_label_id;
int32 edge_label_id;
@@ -134,7 +134,6 @@ Datum create_complete_graph(PG_FUNCTION_ARGS)
graph_name = PG_GETARG_NAME(0);
no_vertices = (int64) PG_GETARG_INT64(1);
edge_label_name = PG_GETARG_NAME(2);
- namestrcpy(vtx_label_name, AG_DEFAULT_LABEL_VERTEX);
graph_name_str = NameStr(*graph_name);
vtx_name_str = AG_DEFAULT_LABEL_VERTEX;