Added tests for no latch specified.

This commit is contained in:
Andrew McDonnell 2013-05-31 18:56:41 +09:30
commit 83a23f31d2
2 changed files with 18 additions and 0 deletions

View file

@ -83,6 +83,20 @@ latch origid destid weight seq linkid
# Expect no result, because of NULL latch
SELECT * FROM graph WHERE latch=NULL and destid=2 and origid=1;
latch origid destid weight seq linkid
# With no latch, original data, filtered by destid, etc if present
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
SELECT * FROM graph WHERE destid=2 and origid=1;
latch origid destid weight seq linkid
NULL 1 2 1 NULL NULL
SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND (weight = 1 OR weight = 2);
latch origid destid weight seq linkid
breadth_first 1 NULL 2 4 4

View file

@ -90,6 +90,10 @@ SELECT * FROM graph WHERE latch=0 and destid=2 and origid=1;
--echo # Expect no result, because of NULL latch
SELECT * FROM graph WHERE latch=NULL and destid=2 and origid=1;
--echo # With no latch, original data, filtered by destid, etc if present
SELECT * FROM graph;
SELECT * FROM graph WHERE destid=2 and origid=1;
SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND (weight = 1 OR weight = 2);
--echo # Now we add a connection from 4->6