Skip to content

Commit d9fc953

Browse files
committed
Support SELECT * FROM tbl
Really Basic, but going to be needed for debugging
1 parent cb9c994 commit d9fc953

File tree

5 files changed

+560
-34
lines changed

5 files changed

+560
-34
lines changed

regress/expected/new_cypher.out

+17
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,23 @@ CREATE TABLE tst5 (i text) PARTITION BY LIST (i COLLATE de_DE);
106106
CREATE TABLE tst6 (i text) PARTITION BY LIST (i COLLATE de_DE text_ops);
107107
CREATE TABLE tst7 (i text) USING heap;
108108
CREATE TABLE tst8 (i text) WITH (fillfactor=70);
109+
SELECT;
110+
--
111+
(1 row)
112+
113+
SELECT ALL;
114+
--
115+
(1 row)
116+
117+
SELECT *;
118+
ERROR: SELECT * with no tables specified is not valid
119+
LINE 1: SELECT *;
120+
^
121+
SELECT * FROM tst;
122+
i
123+
---
124+
(0 rows)
125+
109126
DROP GRAPH new_cypher CASCADE;
110127
NOTICE: drop cascades to 2 other objects
111128
DETAIL: drop cascades to table new_cypher._ag_label_vertex

regress/sql/new_cypher.sql

+6
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,11 @@ CREATE TABLE tst6 (i text) PARTITION BY LIST (i COLLATE de_DE text_ops);
6262
CREATE TABLE tst7 (i text) USING heap;
6363
CREATE TABLE tst8 (i text) WITH (fillfactor=70);
6464

65+
SELECT;
66+
SELECT ALL;
67+
68+
SELECT *;
69+
SELECT * FROM tst;
70+
6571
DROP GRAPH new_cypher CASCADE;
6672
DROP GRAPH new_cypher_2 CASCADE;

src/backend/parser/cypher_analyze.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,7 @@ cypher_parse_analyze(RawStmt *parseTree, const char *sourceText,
13971397
if (list_length(parseTree->stmt) == 1) {
13981398
Node *n = linitial(parseTree->stmt);
13991399

1400-
if (IsA(n, CreateExtensionStmt) || IsA(n,CreateStmt)) {
1400+
if (IsA(n, CreateExtensionStmt) || IsA(n,CreateStmt) || IsA(n, SelectStmt)) {
14011401
query = parse_analyze((makeRawStmt(n, 0)), sourceText, paramTypes, numParams,
14021402
queryEnv);
14031403

@@ -1452,6 +1452,8 @@ cypher_parse_analyze(RawStmt *parseTree, const char *sourceText,
14521452

14531453
}
14541454
}
1455+
1456+
14551457
Oid graph_oid = get_session_graph_oid();
14561458
graph_cache_data *gcd = search_graph_namespace_cache(graph_oid);
14571459

0 commit comments

Comments
 (0)