V3 What should be returned when using no_search with 'and origid=x and destid=y'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OQGRAPH |
New
|
Undecided
|
Unassigned |
Bug Description
(Added so we dont forget to fix this)
On 29/05/13 08:08, Arjen Lentz wrote:
> Hi Andrew
>
>> what should a no_search latch return?
> For latch=0/no_search, the table should look as inserted (i.e. like a regular table)
According to v2 documentation: http://
Query vertices stored in graph engine (latch=0)
SELECT * FROM foo WHERE latch = 0;
Results:
vertex id in linkid column
Thus:
INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1);
INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1);
INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3);
INSERT INTO graph_base(from_id, to_id) VALUES (5,6), (6,5);
SELECT * FROM graph;
latch origid destid weight seq linkid
NULL 1 2 1 NULL NULL
NULL 2 1 1 NULL NULL
NULL 1 3 1 NULL NULL
NULL 3 1 1 NULL NULL
NULL 3 4 1 NULL NULL
NULL 4 3 1 NULL NULL
NULL 5 6 1 NULL NULL
NULL 6 5 1 NULL NULL
Thus, the following result is actually correct:
SELECT * FROM graph WHERE latch='no_search';
latch origid destid weight seq linkid
no_search NULL NULL NULL NULL 1
no_search NULL NULL NULL NULL 2
no_search NULL NULL NULL NULL 3
no_search NULL NULL NULL NULL 4
no_search NULL NULL NULL NULL 5
no_search NULL NULL NULL NULL 6
Why does the following query return three rows?
Naively possibly, I'm thinking there should be two rows, with linkid in (1,2)
SELECT * FROM graph WHERE latch='no_search' and destid=2 and origid=1;
latch origid destid weight seq linkid
no_search 1 2 1 3 1
no_search 1 2 1 2 3
no_search 1 2 1 1 2
description: | updated |
summary: |
- Inconsistent OQGRAPH results returned when using no_search + What should be returned when using no_search with 'and origid=x and + destid=y' |
summary: |
- What should be returned when using no_search with 'and origid=x and + V3 What should be returned when using no_search with 'and origid=x and destid=y' |
So:
no_search+origid finds out edges
no_search+destid finds in edges
So I wondered if using both just formed a union, but it doesnt:
+SELECT * FROM graph where latch='no_search' and origid = 1;
+latch origid destid weight seq linkid
+no_search 1 NULL 1 2 3
+no_search 1 NULL 1 1 2
+SELECT * FROM graph where latch='no_search' and destid = 2;
+latch origid destid weight seq linkid
+no_search NULL 2 1 1 1
+SELECT * FROM graph where latch='no_search' and origid=1 and destid = 2;
+latch origid destid weight seq linkid
+no_search 1 2 1 3 1
+no_search 1 2 1 2 3
+no_search 1 2 1 1 2