Skip to content

Commit ef441d2

Browse files
committed
Support a_expr typecasting
1 parent a872917 commit ef441d2

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

regress/expected/new_cypher.out

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1616
*/
1717
-- Regression tests don't preload extensions, gotta load it first
18+
SET search_path TO postgraph;
1819
LOAD 'postgraph';
1920
CREATE EXTENSION postgraph;
2021
ERROR: extension "postgraph" already exists
@@ -212,6 +213,12 @@ SELECT * FROM tst;
212213
Hello
213214
(1 row)
214215

216+
SELECT '"Hello"'::gtype = '"Hello"'::gtype;
217+
?column?
218+
----------
219+
t
220+
(1 row)
221+
215222
DROP GRAPH new_cypher CASCADE;
216223
NOTICE: drop cascades to 2 other objects
217224
DETAIL: drop cascades to table new_cypher._ag_label_vertex

regress/sql/new_cypher.sql

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1616
*/
1717
-- Regression tests don't preload extensions, gotta load it first
18-
18+
SET search_path TO postgraph;
1919
LOAD 'postgraph';
2020

2121
CREATE EXTENSION postgraph;
@@ -108,5 +108,7 @@ INSERT INTO tst SELECT 'Hello';
108108

109109
SELECT * FROM tst;
110110

111+
SELECT '"Hello"'::gtype = '"Hello"'::gtype;
112+
111113
DROP GRAPH new_cypher CASCADE;
112114
DROP GRAPH new_cypher_2 CASCADE;

src/backend/parser/cypher_gram.y

+2-5
Original file line numberDiff line numberDiff line change
@@ -642,9 +642,6 @@ simple_select:
642642
}
643643
;
644644

645-
646-
647-
648645
opt_all_clause:
649646
ALL
650647
| /*EMPTY*/
@@ -2142,9 +2139,9 @@ indirection_el:
21422139
* you expect! So we use %prec annotations freely to set precedences.
21432140
*/
21442141
a_expr: c_expr { $$ = $1; }
2145-
/*| a_expr TYPECAST Typename
2142+
| a_expr TYPECAST Typename
21462143
{ $$ = makeTypeCast($1, $3, @2); }
2147-
| a_expr COLLATE any_name
2144+
/*| a_expr COLLATE any_name
21482145
{
21492146
CollateClause *n = makeNode(CollateClause);
21502147
n->arg = $1;

0 commit comments

Comments
 (0)