Commit db048e78 authored by Andrew McDonnell's avatar Andrew McDonnell

Updated unit test results arising from prior bugs

parent 55d9cfc8
......@@ -46,6 +46,22 @@ NULL 12 10 1 NULL NULL
SELECT count(*) FROM graph;
count(*)
13
# Return all edges when latch is NULL
SELECT * FROM graph where latch is NULL;
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
NULL 5 7 1 NULL NULL
NULL 9 9 1 NULL NULL
NULL 10 11 1 NULL NULL
NULL 11 12 1 NULL NULL
NULL 12 10 1 NULL NULL
# Return all vertices, and subsets of vertices
SELECT * FROM graph where latch='';
latch origid destid weight seq linkid
......@@ -1018,37 +1034,37 @@ dijkstras 12 11 1 1 10
dijkstras 12 11 1 2 11
SELECT * FROM graph WHERE latch='dijkstras' AND origid=1;
latch origid destid weight seq linkid
dijkstras 1 NULL 0 4 4
dijkstras 1 NULL 0 3 3
dijkstras 1 NULL 0 2 2
dijkstras 1 NULL 2 4 4
dijkstras 1 NULL 1 3 3
dijkstras 1 NULL 1 2 2
dijkstras 1 NULL 0 1 1
SELECT * FROM graph WHERE latch='dijkstras' AND origid=2;
latch origid destid weight seq linkid
dijkstras 2 NULL 0 4 4
dijkstras 2 NULL 0 3 3
dijkstras 2 NULL 0 2 1
dijkstras 2 NULL 3 4 4
dijkstras 2 NULL 2 3 3
dijkstras 2 NULL 1 2 1
dijkstras 2 NULL 0 1 2
SELECT * FROM graph WHERE latch='dijkstras' AND origid=3;
latch origid destid weight seq linkid
dijkstras 3 NULL 0 4 2
dijkstras 3 NULL 0 3 4
dijkstras 3 NULL 0 2 1
dijkstras 3 NULL 2 4 2
dijkstras 3 NULL 1 3 4
dijkstras 3 NULL 1 2 1
dijkstras 3 NULL 0 1 3
SELECT * FROM graph WHERE latch='dijkstras' AND origid=4;
latch origid destid weight seq linkid
dijkstras 4 NULL 0 4 2
dijkstras 4 NULL 0 3 1
dijkstras 4 NULL 0 2 3
dijkstras 4 NULL 3 4 2
dijkstras 4 NULL 2 3 1
dijkstras 4 NULL 1 2 3
dijkstras 4 NULL 0 1 4
SELECT * FROM graph WHERE latch='dijkstras' AND origid=5;
latch origid destid weight seq linkid
dijkstras 5 NULL 0 3 7
dijkstras 5 NULL 0 2 6
dijkstras 5 NULL 1 3 7
dijkstras 5 NULL 1 2 6
dijkstras 5 NULL 0 1 5
SELECT * FROM graph WHERE latch='dijkstras' AND origid=6;
latch origid destid weight seq linkid
dijkstras 6 NULL 0 3 7
dijkstras 6 NULL 0 2 5
dijkstras 6 NULL 2 3 7
dijkstras 6 NULL 1 2 5
dijkstras 6 NULL 0 1 6
SELECT * FROM graph WHERE latch='dijkstras' AND origid=7;
latch origid destid weight seq linkid
......@@ -1060,18 +1076,18 @@ latch origid destid weight seq linkid
dijkstras 9 NULL 0 1 9
SELECT * FROM graph WHERE latch='dijkstras' AND origid=10;
latch origid destid weight seq linkid
dijkstras 10 NULL 0 3 12
dijkstras 10 NULL 0 2 11
dijkstras 10 NULL 2 3 12
dijkstras 10 NULL 1 2 11
dijkstras 10 NULL 0 1 10
SELECT * FROM graph WHERE latch='dijkstras' AND origid=11;
latch origid destid weight seq linkid
dijkstras 11 NULL 0 3 10
dijkstras 11 NULL 0 2 12
dijkstras 11 NULL 2 3 10
dijkstras 11 NULL 1 2 12
dijkstras 11 NULL 0 1 11
SELECT * FROM graph WHERE latch='dijkstras' AND origid=12;
latch origid destid weight seq linkid
dijkstras 12 NULL 0 3 11
dijkstras 12 NULL 0 2 10
dijkstras 12 NULL 2 3 11
dijkstras 12 NULL 1 2 10
dijkstras 12 NULL 0 1 12
SELECT * FROM graph WHERE latch='dijkstras' AND origid=666;
latch origid destid weight seq linkid
......@@ -1193,37 +1209,37 @@ latch origid destid weight seq linkid
1 12 11 1 2 11
SELECT * FROM graph WHERE latch='1' AND origid=1;
latch origid destid weight seq linkid
1 1 NULL 0 4 4
1 1 NULL 0 3 3
1 1 NULL 0 2 2
1 1 NULL 2 4 4
1 1 NULL 1 3 3
1 1 NULL 1 2 2
1 1 NULL 0 1 1
SELECT * FROM graph WHERE latch='1' AND origid=2;
latch origid destid weight seq linkid
1 2 NULL 0 4 4
1 2 NULL 0 3 3
1 2 NULL 0 2 1
1 2 NULL 3 4 4
1 2 NULL 2 3 3
1 2 NULL 1 2 1
1 2 NULL 0 1 2
SELECT * FROM graph WHERE latch='1' AND origid=3;
latch origid destid weight seq linkid
1 3 NULL 0 4 2
1 3 NULL 0 3 4
1 3 NULL 0 2 1
1 3 NULL 2 4 2
1 3 NULL 1 3 4
1 3 NULL 1 2 1
1 3 NULL 0 1 3
SELECT * FROM graph WHERE latch='1' AND origid=4;
latch origid destid weight seq linkid
1 4 NULL 0 4 2
1 4 NULL 0 3 1
1 4 NULL 0 2 3
1 4 NULL 3 4 2
1 4 NULL 2 3 1
1 4 NULL 1 2 3
1 4 NULL 0 1 4
SELECT * FROM graph WHERE latch='1' AND origid=5;
latch origid destid weight seq linkid
1 5 NULL 0 3 7
1 5 NULL 0 2 6
1 5 NULL 1 3 7
1 5 NULL 1 2 6
1 5 NULL 0 1 5
SELECT * FROM graph WHERE latch='1' AND origid=6;
latch origid destid weight seq linkid
1 6 NULL 0 3 7
1 6 NULL 0 2 5
1 6 NULL 2 3 7
1 6 NULL 1 2 5
1 6 NULL 0 1 6
SELECT * FROM graph WHERE latch='1' AND origid=7;
latch origid destid weight seq linkid
......@@ -1235,18 +1251,18 @@ latch origid destid weight seq linkid
1 9 NULL 0 1 9
SELECT * FROM graph WHERE latch='1' AND origid=10;
latch origid destid weight seq linkid
1 10 NULL 0 3 12
1 10 NULL 0 2 11
1 10 NULL 2 3 12
1 10 NULL 1 2 11
1 10 NULL 0 1 10
SELECT * FROM graph WHERE latch='1' AND origid=11;
latch origid destid weight seq linkid
1 11 NULL 0 3 10
1 11 NULL 0 2 12
1 11 NULL 2 3 10
1 11 NULL 1 2 12
1 11 NULL 0 1 11
SELECT * FROM graph WHERE latch='1' AND origid=12;
latch origid destid weight seq linkid
1 12 NULL 0 3 11
1 12 NULL 0 2 10
1 12 NULL 2 3 11
1 12 NULL 1 2 10
1 12 NULL 0 1 12
SELECT * FROM graph WHERE latch='1' AND origid=666;
latch origid destid weight seq linkid
......@@ -1331,14 +1347,14 @@ dijkstras 10 13 1 1 11
dijkstras 10 13 1 2 13
SELECT * FROM graph WHERE latch='dijkstras' AND origid=1;
latch origid destid weight seq linkid
dijkstras 1 NULL 0 4 4
dijkstras 1 NULL 0 3 3
dijkstras 1 NULL 0 2 2
dijkstras 1 NULL 2 4 4
dijkstras 1 NULL 1 3 3
dijkstras 1 NULL 1 2 2
dijkstras 1 NULL 0 1 1
INSERT INTO graph_base(from_id, to_id) VALUES (21,22);
SELECT * FROM graph WHERE latch='dijkstras' AND origid=21;
latch origid destid weight seq linkid
dijkstras 21 NULL 0 2 22
dijkstras 21 NULL 1 2 22
dijkstras 21 NULL 0 1 21
SELECT * FROM graph WHERE latch='dijkstras' AND origid=22;
latch origid destid weight seq linkid
......@@ -1346,29 +1362,29 @@ dijkstras 22 NULL 0 1 22
INSERT INTO graph_base(from_id, to_id) VALUES (4,17);
SELECT * FROM graph WHERE latch='dijkstras' AND origid=1;
latch origid destid weight seq linkid
dijkstras 1 NULL 0 5 17
dijkstras 1 NULL 0 4 4
dijkstras 1 NULL 0 3 3
dijkstras 1 NULL 0 2 2
dijkstras 1 NULL 3 5 17
dijkstras 1 NULL 2 4 4
dijkstras 1 NULL 1 3 3
dijkstras 1 NULL 1 2 2
dijkstras 1 NULL 0 1 1
INSERT INTO graph_base(from_id, to_id) VALUES (4,16);
SELECT * FROM graph WHERE latch='dijkstras' AND origid=1;
latch origid destid weight seq linkid
dijkstras 1 NULL 0 6 17
dijkstras 1 NULL 0 5 16
dijkstras 1 NULL 0 4 4
dijkstras 1 NULL 0 3 3
dijkstras 1 NULL 0 2 2
dijkstras 1 NULL 3 6 17
dijkstras 1 NULL 3 5 16
dijkstras 1 NULL 2 4 4
dijkstras 1 NULL 1 3 3
dijkstras 1 NULL 1 2 2
dijkstras 1 NULL 0 1 1
INSERT INTO graph_base(from_id, to_id) VALUES (17,18);
SELECT * FROM graph WHERE latch='dijkstras' AND origid=1;
latch origid destid weight seq linkid
dijkstras 1 NULL 0 7 18
dijkstras 1 NULL 0 6 17
dijkstras 1 NULL 0 5 16
dijkstras 1 NULL 0 4 4
dijkstras 1 NULL 0 3 3
dijkstras 1 NULL 0 2 2
dijkstras 1 NULL 4 7 18
dijkstras 1 NULL 3 6 17
dijkstras 1 NULL 3 5 16
dijkstras 1 NULL 2 4 4
dijkstras 1 NULL 1 3 3
dijkstras 1 NULL 1 2 2
dijkstras 1 NULL 0 1 1
SELECT * FROM graph WHERE latch='dijkstras' AND destid=1;
latch origid destid weight seq linkid
......
1--disable_warnings
--disable_warnings
DROP TABLE IF EXISTS graph_base;
DROP TABLE IF EXISTS graph;
DROP TABLE IF EXISTS graph2;
......@@ -212,8 +212,6 @@ SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 11 AND (weight =
SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 12 AND (weight = 1 or weight = 2);
#-- now do it in reverse - using destid find originating vertices
#-- FIXME - currently these are returning NULL which is incorrect
#-- https://bugs.launchpad.net/oqgraph/+bug/1196027
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1;
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2;
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 3;
......
......@@ -21,6 +21,15 @@ INSERT INTO graph_base(from_id, to_id, weight) VALUES (1,2,16), (2,1,16);
INSERT INTO graph_base(from_id, to_id, weight) VALUES (2,3,256), (3,2,256);
INSERT INTO graph_base(from_id, to_id, weight) VALUES (3,4,65536), (4,3,65536);
INSERT INTO graph_base(from_id, to_id, weight) VALUES (2,4,768);
SELECT * FROM graph WHERE latch is NULL;
latch origid destid weight seq linkid
NULL 1 2 16 NULL NULL
NULL 2 1 16 NULL NULL
NULL 2 3 256 NULL NULL
NULL 3 2 256 NULL NULL
NULL 3 4 65536 NULL NULL
NULL 4 3 65536 NULL NULL
NULL 2 4 768 NULL NULL
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1;
latch origid destid weight seq linkid
dijkstras 1 NULL 784 4 4
......
......@@ -32,6 +32,8 @@ INSERT INTO graph_base(from_id, to_id, weight) VALUES (2,3,256), (3,2,256);
INSERT INTO graph_base(from_id, to_id, weight) VALUES (3,4,65536), (4,3,65536);
INSERT INTO graph_base(from_id, to_id, weight) VALUES (2,4,768);
SELECT * FROM graph WHERE latch is NULL;
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 1;
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 2;
SELECT * FROM graph WHERE latch = 'dijkstras' AND origid = 3;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment