Skip to content

Commit 9c04dc2

Browse files
committed
Update
1 parent 5a305fe commit 9c04dc2

File tree

8 files changed

+292
-94
lines changed

8 files changed

+292
-94
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ EXTENSION = postgraph
7171
DATA = postgraph--0.1.0.sql
7272

7373
REGRESS = new_cypher \
74-
vertex_am \
7574
cypher_create
7675

7776
srcdir=`pwd`

regress/sql/cypher_create.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ MATCH () RETURN 1;
4646

4747
CREATE ()-[]->();
4848

49+
EXPLAIN MATCH ()-[]->() RETURN 1;
50+
51+
52+
MATCH ()-[]->() RETURN 1;
53+
4954
SELECT * FROM cypher_create._ag_label_vertex;
5055

5156
SELECT * FROM cypher_create._adj__adj__ag_label_vertex;

regress/sql/vertex_am.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
-- Regression tests don't preload extensions, gotta load it first
1818

1919
LOAD 'postgraph';
20-
set search_path 'postgraph';
21-
/*
20+
set search_path = 'postgraph';
21+
2222
CREATE TABLE vertex_am_tst (id postgraph.graphid not null, props postgraph.gtype not null) USING vertex_adjlist;
2323

2424

2525
INSERT INTO vertex_am_tst (id, props)
2626
VALUES ('1'::postgraph.graphid, postgraph.gtype_build_map('id', 1));
2727

28-
29-
SELECT '1'::postgraph.graphid OPERATOR(postgraph.=) '1'::postgraph.graphid;
28+
/*
29+
--SELECT '1'::postgraph.graphid OPERATOR(postgraph.=) '1'::postgraph.graphid;
3030
EXPLAIN SELECT * FROM vertex_am_tst WHERE id OPERATOR(postgraph.=) '1'::postgraph.graphid;
3131
SELECT * FROM vertex_am_tst WHERE id OPERATOR(postgraph.=) '1'::postgraph.graphid;
3232

src/backend/access/vertex_heap/vertex_heapam_handler.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,9 +1301,16 @@ void vertex_scan_rescan(TableScanDesc scan, struct ScanKeyData *key,
13011301
bool vertex_scan_getnextslot(TableScanDesc sscan, ScanDirection direction,
13021302
TupleTableSlot *slot) {
13031303
VertexScanDescData *vertex_desc = sscan;
1304-
TableAmRoutine *tableam = GetHeapamTableAmRoutine();
13051304

1305+
1306+
if(vertex_desc->rs_base.rs_nkeys != 1)
13061307
ereport(WARNING,errmsg_internal("here"));
1308+
else
1309+
ereport(WARNING,errmsg_internal("there"));
1310+
1311+
1312+
TableAmRoutine *tableam = GetHeapamTableAmRoutine();
1313+
13071314
return tableam->scan_getnextslot(vertex_desc->desc[0], direction, slot);
13081315

13091316
VertexHeapScanDesc so = (VertexHeapScanDesc) sscan;
@@ -2784,18 +2791,18 @@ vertex_hash_doinsert(Relation rel, HeapTuple itup, Relation heapRel)
27842791
}
27852792

27862793
#include "executor/nodeSeqscan.h"
2787-
2794+
#include "utils/ag_cache.h"
27882795
static exec_seq_scan_scan_key_hook_type prev_exec_seq_scan_scan_key_hook = NULL;
27892796

27902797
void postgraph_seq_scan_key_hook (SeqScanState *node,
27912798
int *numScanKeys, ScanKey scanKeys) {
27922799

2793-
ereport(WARNING, errmsg("In hook"));
2794-
2795-
vertex_exec_index_build_ScanKeys(node, node->ss.ss_currentRelation,
2796-
node->ss.ps.plan->qual,
2797-
scanKeys, numScanKeys);
27982800

2801+
label_cache_data *lcd = search_label_vertex_adjlist_cache(RelationGetRelid(node->ss.ss_currentRelation));
2802+
if (lcd) {
2803+
ereport(WARNING, errmsg("Found an edge scan"));
2804+
vertex_exec_index_build_ScanKeys(node, node->ss.ss_currentRelation, node->ss.ps.plan->qual, scanKeys, numScanKeys);
2805+
}
27992806
return;
28002807
}
28012808

0 commit comments

Comments
 (0)