summaryrefslogtreecommitdiff
path: root/storage/oqgraph
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-10-30 16:42:46 +0400
committerAlexander Barkov <bar@mariadb.org>2017-10-30 16:42:46 +0400
commit003cb2f42477772ae43228c0bc0f8492246b9340 (patch)
tree680314d232d55b5a41dc2b2f5b500677e4aff183 /storage/oqgraph
parent84ed288f6807a4602e0af8615bfb17080df15160 (diff)
parent58e0dcb93dc2b2bf49f76c754bd216dbdf875a0d (diff)
downloadmariadb-git-003cb2f42477772ae43228c0bc0f8492246b9340.tar.gz
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Diffstat (limited to 'storage/oqgraph')
-rw-r--r--storage/oqgraph/graphcore.cc14
-rw-r--r--storage/oqgraph/mysql-test/oqgraph/general-Aria.result99
-rw-r--r--storage/oqgraph/mysql-test/oqgraph/general-MyISAM.result99
-rw-r--r--storage/oqgraph/mysql-test/oqgraph/general-innodb.result99
-rw-r--r--storage/oqgraph/mysql-test/oqgraph/regression_1196036.result6
-rw-r--r--storage/oqgraph/mysql-test/oqgraph/regression_1213120.result71
-rw-r--r--storage/oqgraph/oqgraph_shim.h6
7 files changed, 191 insertions, 203 deletions
diff --git a/storage/oqgraph/graphcore.cc b/storage/oqgraph/graphcore.cc
index fb2b105f2fd..bf454aa3333 100644
--- a/storage/oqgraph/graphcore.cc
+++ b/storage/oqgraph/graphcore.cc
@@ -891,18 +891,18 @@ namespace open_query
boost::unordered_map<Vertex, Vertex> p;
boost::unordered_map<Vertex, EdgeWeight> d;
boost::queue<Vertex> Q;
- reverse_graph<Graph> r(share->g);
+ const reverse_graph<Graph> r(share->g);
p[ *dest ]= *dest;
d[ *dest ] = EdgeWeight();
switch (ALGORITHM & op)
{
case DIJKSTRAS:
- dijkstra_shortest_paths_no_init(share->g, *dest,
+ dijkstra_shortest_paths_no_init(r, *dest,
make_lazy_property_map(p, identity_initializer<Vertex>()),
make_lazy_property_map(d, value_initializer<EdgeWeight>(
(std::numeric_limits<EdgeWeight>::max)())),
- get(edge_weight, share->g),
- get(vertex_index, share->g),
+ get(edge_weight, r),
+ get(vertex_index, r),
std::less<EdgeWeight>(),
closed_plus<EdgeWeight>(),
EdgeWeight(),
@@ -913,10 +913,10 @@ namespace open_query
static_cast<stack_cursor*>(cursor)
)
),
- make_two_bit_judy_map(get(vertex_index, share->g)));
+ make_two_bit_judy_map(get(vertex_index, r)));
break;
case BREADTH_FIRST:
- breadth_first_visit(share->g, *dest, Q,
+ breadth_first_visit(r, *dest, Q,
make_bfs_visitor(
std::make_pair(
record_predecessors(
@@ -935,7 +935,7 @@ namespace open_query
)
))
),
- make_two_bit_judy_map(get(vertex_index, share->g)));
+ make_two_bit_judy_map(get(vertex_index, r)));
break;
default:
abort();
diff --git a/storage/oqgraph/mysql-test/oqgraph/general-Aria.result b/storage/oqgraph/mysql-test/oqgraph/general-Aria.result
index a35b5182611..e527705045f 100644
--- a/storage/oqgraph/mysql-test/oqgraph/general-Aria.result
+++ b/storage/oqgraph/mysql-test/oqgraph/general-Aria.result
@@ -455,16 +455,16 @@ breadth_first NULL 4 1 2 3
breadth_first NULL 4 0 1 4
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5;
latch origid destid weight seq linkid
-breadth_first NULL 5 1 3 7
breadth_first NULL 5 1 2 6
breadth_first NULL 5 0 1 5
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6;
latch origid destid weight seq linkid
-breadth_first NULL 6 2 3 7
breadth_first NULL 6 1 2 5
breadth_first NULL 6 0 1 6
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7;
latch origid destid weight seq linkid
+breadth_first NULL 7 2 3 6
+breadth_first NULL 7 1 2 5
breadth_first NULL 7 0 1 7
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8;
latch origid destid weight seq linkid
@@ -473,18 +473,18 @@ latch origid destid weight seq linkid
breadth_first NULL 9 0 1 9
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10;
latch origid destid weight seq linkid
-breadth_first NULL 10 2 3 12
-breadth_first NULL 10 1 2 11
+breadth_first NULL 10 2 3 11
+breadth_first NULL 10 1 2 12
breadth_first NULL 10 0 1 10
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11;
latch origid destid weight seq linkid
-breadth_first NULL 11 2 3 10
-breadth_first NULL 11 1 2 12
+breadth_first NULL 11 2 3 12
+breadth_first NULL 11 1 2 10
breadth_first NULL 11 0 1 11
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12;
latch origid destid weight seq linkid
-breadth_first NULL 12 2 3 11
-breadth_first NULL 12 1 2 10
+breadth_first NULL 12 2 3 10
+breadth_first NULL 12 1 2 11
breadth_first NULL 12 0 1 12
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 1;
latch origid destid weight seq linkid
@@ -502,26 +502,26 @@ latch origid destid weight seq linkid
breadth_first NULL 4 1 2 3
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 5 1 3 7
breadth_first NULL 5 1 2 6
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 1;
latch origid destid weight seq linkid
breadth_first NULL 6 1 2 5
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 1;
latch origid destid weight seq linkid
+breadth_first NULL 7 1 2 5
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 10 1 2 11
+breadth_first NULL 10 1 2 12
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 11 1 2 12
+breadth_first NULL 11 1 2 10
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 12 1 2 10
+breadth_first NULL 12 1 2 11
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 2;
latch origid destid weight seq linkid
breadth_first NULL 1 2 4 4
@@ -538,22 +538,22 @@ SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 6 2 3 7
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 2;
latch origid destid weight seq linkid
+breadth_first NULL 7 2 3 6
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 10 2 3 12
+breadth_first NULL 10 2 3 11
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 11 2 3 10
+breadth_first NULL 11 2 3 12
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 12 2 3 11
+breadth_first NULL 12 2 3 10
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 3;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 3;
@@ -847,16 +847,16 @@ latch origid destid weight seq linkid
2 NULL 4 0 1 4
SELECT * FROM graph WHERE latch = '2' AND destid = 5;
latch origid destid weight seq linkid
-2 NULL 5 1 3 7
2 NULL 5 1 2 6
2 NULL 5 0 1 5
SELECT * FROM graph WHERE latch = '2' AND destid = 6;
latch origid destid weight seq linkid
-2 NULL 6 2 3 7
2 NULL 6 1 2 5
2 NULL 6 0 1 6
SELECT * FROM graph WHERE latch = '2' AND destid = 7;
latch origid destid weight seq linkid
+2 NULL 7 2 3 6
+2 NULL 7 1 2 5
2 NULL 7 0 1 7
SELECT * FROM graph WHERE latch = '2' AND destid = 8;
latch origid destid weight seq linkid
@@ -865,18 +865,18 @@ latch origid destid weight seq linkid
2 NULL 9 0 1 9
SELECT * FROM graph WHERE latch = '2' AND destid = 10;
latch origid destid weight seq linkid
-2 NULL 10 2 3 12
-2 NULL 10 1 2 11
+2 NULL 10 2 3 11
+2 NULL 10 1 2 12
2 NULL 10 0 1 10
SELECT * FROM graph WHERE latch = '2' AND destid = 11;
latch origid destid weight seq linkid
-2 NULL 11 2 3 10
-2 NULL 11 1 2 12
+2 NULL 11 2 3 12
+2 NULL 11 1 2 10
2 NULL 11 0 1 11
SELECT * FROM graph WHERE latch = '2' AND destid = 12;
latch origid destid weight seq linkid
-2 NULL 12 2 3 11
-2 NULL 12 1 2 10
+2 NULL 12 2 3 10
+2 NULL 12 1 2 11
2 NULL 12 0 1 12
SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 1;
latch origid destid weight seq linkid
@@ -894,26 +894,26 @@ latch origid destid weight seq linkid
2 NULL 4 1 2 3
SELECT * FROM graph WHERE latch = '2' AND destid = 5 and weight = 1;
latch origid destid weight seq linkid
-2 NULL 5 1 3 7
2 NULL 5 1 2 6
SELECT * FROM graph WHERE latch = '2' AND destid = 6 and weight = 1;
latch origid destid weight seq linkid
2 NULL 6 1 2 5
SELECT * FROM graph WHERE latch = '2' AND destid = 7 and weight = 1;
latch origid destid weight seq linkid
+2 NULL 7 1 2 5
SELECT * FROM graph WHERE latch = '2' AND destid = 8 and weight = 1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 9 and weight = 1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 10 and weight = 1;
latch origid destid weight seq linkid
-2 NULL 10 1 2 11
+2 NULL 10 1 2 12
SELECT * FROM graph WHERE latch = '2' AND destid = 11 and weight = 1;
latch origid destid weight seq linkid
-2 NULL 11 1 2 12
+2 NULL 11 1 2 10
SELECT * FROM graph WHERE latch = '2' AND destid = 12 and weight = 1;
latch origid destid weight seq linkid
-2 NULL 12 1 2 10
+2 NULL 12 1 2 11
SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 2;
latch origid destid weight seq linkid
2 NULL 1 2 4 4
@@ -930,22 +930,22 @@ SELECT * FROM graph WHERE latch = '2' AND destid = 5 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 6 and weight = 2;
latch origid destid weight seq linkid
-2 NULL 6 2 3 7
SELECT * FROM graph WHERE latch = '2' AND destid = 7 and weight = 2;
latch origid destid weight seq linkid
+2 NULL 7 2 3 6
SELECT * FROM graph WHERE latch = '2' AND destid = 8 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 9 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 10 and weight = 2;
latch origid destid weight seq linkid
-2 NULL 10 2 3 12
+2 NULL 10 2 3 11
SELECT * FROM graph WHERE latch = '2' AND destid = 11 and weight = 2;
latch origid destid weight seq linkid
-2 NULL 11 2 3 10
+2 NULL 11 2 3 12
SELECT * FROM graph WHERE latch = '2' AND destid = 12 and weight = 2;
latch origid destid weight seq linkid
-2 NULL 12 2 3 11
+2 NULL 12 2 3 10
SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 3;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 2 and weight = 3;
@@ -1124,16 +1124,16 @@ dijkstras NULL 4 1 2 3
dijkstras NULL 4 0 1 4
SELECT * FROM graph WHERE latch='dijkstras' AND destid=5;
latch origid destid weight seq linkid
-dijkstras NULL 5 1 3 7
dijkstras NULL 5 1 2 6
dijkstras NULL 5 0 1 5
SELECT * FROM graph WHERE latch='dijkstras' AND destid=6;
latch origid destid weight seq linkid
-dijkstras NULL 6 2 3 7
dijkstras NULL 6 1 2 5
dijkstras NULL 6 0 1 6
SELECT * FROM graph WHERE latch='dijkstras' AND destid=7;
latch origid destid weight seq linkid
+dijkstras NULL 7 2 3 6
+dijkstras NULL 7 1 2 5
dijkstras NULL 7 0 1 7
SELECT * FROM graph WHERE latch='dijkstras' AND destid=8;
latch origid destid weight seq linkid
@@ -1142,18 +1142,18 @@ latch origid destid weight seq linkid
dijkstras NULL 9 0 1 9
SELECT * FROM graph WHERE latch='dijkstras' AND destid=10;
latch origid destid weight seq linkid
-dijkstras NULL 10 2 3 12
-dijkstras NULL 10 1 2 11
+dijkstras NULL 10 2 3 11
+dijkstras NULL 10 1 2 12
dijkstras NULL 10 0 1 10
SELECT * FROM graph WHERE latch='dijkstras' AND destid=11;
latch origid destid weight seq linkid
-dijkstras NULL 11 2 3 10
-dijkstras NULL 11 1 2 12
+dijkstras NULL 11 2 3 12
+dijkstras NULL 11 1 2 10
dijkstras NULL 11 0 1 11
SELECT * FROM graph WHERE latch='dijkstras' AND destid=12;
latch origid destid weight seq linkid
-dijkstras NULL 12 2 3 11
-dijkstras NULL 12 1 2 10
+dijkstras NULL 12 2 3 10
+dijkstras NULL 12 1 2 11
dijkstras NULL 12 0 1 12
# legacy string number
SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=1;
@@ -1299,16 +1299,16 @@ latch origid destid weight seq linkid
1 NULL 4 0 1 4
SELECT * FROM graph WHERE latch='1' AND destid=5;
latch origid destid weight seq linkid
-1 NULL 5 1 3 7
1 NULL 5 1 2 6
1 NULL 5 0 1 5
SELECT * FROM graph WHERE latch='1' AND destid=6;
latch origid destid weight seq linkid
-1 NULL 6 2 3 7
1 NULL 6 1 2 5
1 NULL 6 0 1 6
SELECT * FROM graph WHERE latch='1' AND destid=7;
latch origid destid weight seq linkid
+1 NULL 7 2 3 6
+1 NULL 7 1 2 5
1 NULL 7 0 1 7
SELECT * FROM graph WHERE latch='1' AND destid=8;
latch origid destid weight seq linkid
@@ -1317,18 +1317,18 @@ latch origid destid weight seq linkid
1 NULL 9 0 1 9
SELECT * FROM graph WHERE latch='1' AND destid=10;
latch origid destid weight seq linkid
-1 NULL 10 2 3 12
-1 NULL 10 1 2 11
+1 NULL 10 2 3 11
+1 NULL 10 1 2 12
1 NULL 10 0 1 10
SELECT * FROM graph WHERE latch='1' AND destid=11;
latch origid destid weight seq linkid
-1 NULL 11 2 3 10
-1 NULL 11 1 2 12
+1 NULL 11 2 3 12
+1 NULL 11 1 2 10
1 NULL 11 0 1 11
SELECT * FROM graph WHERE latch='1' AND destid=12;
latch origid destid weight seq linkid
-1 NULL 12 2 3 11
-1 NULL 12 1 2 10
+1 NULL 12 2 3 10
+1 NULL 12 1 2 11
1 NULL 12 0 1 12
INSERT INTO graph_base(from_id, to_id) VALUES (11,13);
INSERT INTO graph_base(from_id, to_id) VALUES (10,14);
@@ -1395,9 +1395,6 @@ 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
-dijkstras NULL 1 4 7 18
-dijkstras NULL 1 3 6 17
-dijkstras NULL 1 3 5 16
dijkstras NULL 1 2 4 4
dijkstras NULL 1 1 3 3
dijkstras NULL 1 1 2 2
diff --git a/storage/oqgraph/mysql-test/oqgraph/general-MyISAM.result b/storage/oqgraph/mysql-test/oqgraph/general-MyISAM.result
index f12e160a2b7..bbf660e7db4 100644
--- a/storage/oqgraph/mysql-test/oqgraph/general-MyISAM.result
+++ b/storage/oqgraph/mysql-test/oqgraph/general-MyISAM.result
@@ -455,16 +455,16 @@ breadth_first NULL 4 1 2 3
breadth_first NULL 4 0 1 4
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5;
latch origid destid weight seq linkid
-breadth_first NULL 5 1 3 7
breadth_first NULL 5 1 2 6
breadth_first NULL 5 0 1 5
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6;
latch origid destid weight seq linkid
-breadth_first NULL 6 2 3 7
breadth_first NULL 6 1 2 5
breadth_first NULL 6 0 1 6
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7;
latch origid destid weight seq linkid
+breadth_first NULL 7 2 3 6
+breadth_first NULL 7 1 2 5
breadth_first NULL 7 0 1 7
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8;
latch origid destid weight seq linkid
@@ -473,18 +473,18 @@ latch origid destid weight seq linkid
breadth_first NULL 9 0 1 9
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10;
latch origid destid weight seq linkid
-breadth_first NULL 10 2 3 12
-breadth_first NULL 10 1 2 11
+breadth_first NULL 10 2 3 11
+breadth_first NULL 10 1 2 12
breadth_first NULL 10 0 1 10
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11;
latch origid destid weight seq linkid
-breadth_first NULL 11 2 3 10
-breadth_first NULL 11 1 2 12
+breadth_first NULL 11 2 3 12
+breadth_first NULL 11 1 2 10
breadth_first NULL 11 0 1 11
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12;
latch origid destid weight seq linkid
-breadth_first NULL 12 2 3 11
-breadth_first NULL 12 1 2 10
+breadth_first NULL 12 2 3 10
+breadth_first NULL 12 1 2 11
breadth_first NULL 12 0 1 12
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 1;
latch origid destid weight seq linkid
@@ -502,26 +502,26 @@ latch origid destid weight seq linkid
breadth_first NULL 4 1 2 3
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 5 1 3 7
breadth_first NULL 5 1 2 6
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 1;
latch origid destid weight seq linkid
breadth_first NULL 6 1 2 5
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 1;
latch origid destid weight seq linkid
+breadth_first NULL 7 1 2 5
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 10 1 2 11
+breadth_first NULL 10 1 2 12
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 11 1 2 12
+breadth_first NULL 11 1 2 10
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 12 1 2 10
+breadth_first NULL 12 1 2 11
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 2;
latch origid destid weight seq linkid
breadth_first NULL 1 2 4 4
@@ -538,22 +538,22 @@ SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 6 2 3 7
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 2;
latch origid destid weight seq linkid
+breadth_first NULL 7 2 3 6
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 10 2 3 12
+breadth_first NULL 10 2 3 11
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 11 2 3 10
+breadth_first NULL 11 2 3 12
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 12 2 3 11
+breadth_first NULL 12 2 3 10
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 3;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 3;
@@ -847,16 +847,16 @@ latch origid destid weight seq linkid
2 NULL 4 0 1 4
SELECT * FROM graph WHERE latch = '2' AND destid = 5;
latch origid destid weight seq linkid
-2 NULL 5 1 3 7
2 NULL 5 1 2 6
2 NULL 5 0 1 5
SELECT * FROM graph WHERE latch = '2' AND destid = 6;
latch origid destid weight seq linkid
-2 NULL 6 2 3 7
2 NULL 6 1 2 5
2 NULL 6 0 1 6
SELECT * FROM graph WHERE latch = '2' AND destid = 7;
latch origid destid weight seq linkid
+2 NULL 7 2 3 6
+2 NULL 7 1 2 5
2 NULL 7 0 1 7
SELECT * FROM graph WHERE latch = '2' AND destid = 8;
latch origid destid weight seq linkid
@@ -865,18 +865,18 @@ latch origid destid weight seq linkid
2 NULL 9 0 1 9
SELECT * FROM graph WHERE latch = '2' AND destid = 10;
latch origid destid weight seq linkid
-2 NULL 10 2 3 12
-2 NULL 10 1 2 11
+2 NULL 10 2 3 11
+2 NULL 10 1 2 12
2 NULL 10 0 1 10
SELECT * FROM graph WHERE latch = '2' AND destid = 11;
latch origid destid weight seq linkid
-2 NULL 11 2 3 10
-2 NULL 11 1 2 12
+2 NULL 11 2 3 12
+2 NULL 11 1 2 10
2 NULL 11 0 1 11
SELECT * FROM graph WHERE latch = '2' AND destid = 12;
latch origid destid weight seq linkid
-2 NULL 12 2 3 11
-2 NULL 12 1 2 10
+2 NULL 12 2 3 10
+2 NULL 12 1 2 11
2 NULL 12 0 1 12
SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 1;
latch origid destid weight seq linkid
@@ -894,26 +894,26 @@ latch origid destid weight seq linkid
2 NULL 4 1 2 3
SELECT * FROM graph WHERE latch = '2' AND destid = 5 and weight = 1;
latch origid destid weight seq linkid
-2 NULL 5 1 3 7
2 NULL 5 1 2 6
SELECT * FROM graph WHERE latch = '2' AND destid = 6 and weight = 1;
latch origid destid weight seq linkid
2 NULL 6 1 2 5
SELECT * FROM graph WHERE latch = '2' AND destid = 7 and weight = 1;
latch origid destid weight seq linkid
+2 NULL 7 1 2 5
SELECT * FROM graph WHERE latch = '2' AND destid = 8 and weight = 1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 9 and weight = 1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 10 and weight = 1;
latch origid destid weight seq linkid
-2 NULL 10 1 2 11
+2 NULL 10 1 2 12
SELECT * FROM graph WHERE latch = '2' AND destid = 11 and weight = 1;
latch origid destid weight seq linkid
-2 NULL 11 1 2 12
+2 NULL 11 1 2 10
SELECT * FROM graph WHERE latch = '2' AND destid = 12 and weight = 1;
latch origid destid weight seq linkid
-2 NULL 12 1 2 10
+2 NULL 12 1 2 11
SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 2;
latch origid destid weight seq linkid
2 NULL 1 2 4 4
@@ -930,22 +930,22 @@ SELECT * FROM graph WHERE latch = '2' AND destid = 5 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 6 and weight = 2;
latch origid destid weight seq linkid
-2 NULL 6 2 3 7
SELECT * FROM graph WHERE latch = '2' AND destid = 7 and weight = 2;
latch origid destid weight seq linkid
+2 NULL 7 2 3 6
SELECT * FROM graph WHERE latch = '2' AND destid = 8 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 9 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 10 and weight = 2;
latch origid destid weight seq linkid
-2 NULL 10 2 3 12
+2 NULL 10 2 3 11
SELECT * FROM graph WHERE latch = '2' AND destid = 11 and weight = 2;
latch origid destid weight seq linkid
-2 NULL 11 2 3 10
+2 NULL 11 2 3 12
SELECT * FROM graph WHERE latch = '2' AND destid = 12 and weight = 2;
latch origid destid weight seq linkid
-2 NULL 12 2 3 11
+2 NULL 12 2 3 10
SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 3;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 2 and weight = 3;
@@ -1124,16 +1124,16 @@ dijkstras NULL 4 1 2 3
dijkstras NULL 4 0 1 4
SELECT * FROM graph WHERE latch='dijkstras' AND destid=5;
latch origid destid weight seq linkid
-dijkstras NULL 5 1 3 7
dijkstras NULL 5 1 2 6
dijkstras NULL 5 0 1 5
SELECT * FROM graph WHERE latch='dijkstras' AND destid=6;
latch origid destid weight seq linkid
-dijkstras NULL 6 2 3 7
dijkstras NULL 6 1 2 5
dijkstras NULL 6 0 1 6
SELECT * FROM graph WHERE latch='dijkstras' AND destid=7;
latch origid destid weight seq linkid
+dijkstras NULL 7 2 3 6
+dijkstras NULL 7 1 2 5
dijkstras NULL 7 0 1 7
SELECT * FROM graph WHERE latch='dijkstras' AND destid=8;
latch origid destid weight seq linkid
@@ -1142,18 +1142,18 @@ latch origid destid weight seq linkid
dijkstras NULL 9 0 1 9
SELECT * FROM graph WHERE latch='dijkstras' AND destid=10;
latch origid destid weight seq linkid
-dijkstras NULL 10 2 3 12
-dijkstras NULL 10 1 2 11
+dijkstras NULL 10 2 3 11
+dijkstras NULL 10 1 2 12
dijkstras NULL 10 0 1 10
SELECT * FROM graph WHERE latch='dijkstras' AND destid=11;
latch origid destid weight seq linkid
-dijkstras NULL 11 2 3 10
-dijkstras NULL 11 1 2 12
+dijkstras NULL 11 2 3 12
+dijkstras NULL 11 1 2 10
dijkstras NULL 11 0 1 11
SELECT * FROM graph WHERE latch='dijkstras' AND destid=12;
latch origid destid weight seq linkid
-dijkstras NULL 12 2 3 11
-dijkstras NULL 12 1 2 10
+dijkstras NULL 12 2 3 10
+dijkstras NULL 12 1 2 11
dijkstras NULL 12 0 1 12
# legacy string number
SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=1;
@@ -1299,16 +1299,16 @@ latch origid destid weight seq linkid
1 NULL 4 0 1 4
SELECT * FROM graph WHERE latch='1' AND destid=5;
latch origid destid weight seq linkid
-1 NULL 5 1 3 7
1 NULL 5 1 2 6
1 NULL 5 0 1 5
SELECT * FROM graph WHERE latch='1' AND destid=6;
latch origid destid weight seq linkid
-1 NULL 6 2 3 7
1 NULL 6 1 2 5
1 NULL 6 0 1 6
SELECT * FROM graph WHERE latch='1' AND destid=7;
latch origid destid weight seq linkid
+1 NULL 7 2 3 6
+1 NULL 7 1 2 5
1 NULL 7 0 1 7
SELECT * FROM graph WHERE latch='1' AND destid=8;
latch origid destid weight seq linkid
@@ -1317,18 +1317,18 @@ latch origid destid weight seq linkid
1 NULL 9 0 1 9
SELECT * FROM graph WHERE latch='1' AND destid=10;
latch origid destid weight seq linkid
-1 NULL 10 2 3 12
-1 NULL 10 1 2 11
+1 NULL 10 2 3 11
+1 NULL 10 1 2 12
1 NULL 10 0 1 10
SELECT * FROM graph WHERE latch='1' AND destid=11;
latch origid destid weight seq linkid
-1 NULL 11 2 3 10
-1 NULL 11 1 2 12
+1 NULL 11 2 3 12
+1 NULL 11 1 2 10
1 NULL 11 0 1 11
SELECT * FROM graph WHERE latch='1' AND destid=12;
latch origid destid weight seq linkid
-1 NULL 12 2 3 11
-1 NULL 12 1 2 10
+1 NULL 12 2 3 10
+1 NULL 12 1 2 11
1 NULL 12 0 1 12
INSERT INTO graph_base(from_id, to_id) VALUES (11,13);
INSERT INTO graph_base(from_id, to_id) VALUES (10,14);
@@ -1395,9 +1395,6 @@ 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
-dijkstras NULL 1 4 7 18
-dijkstras NULL 1 3 6 17
-dijkstras NULL 1 3 5 16
dijkstras NULL 1 2 4 4
dijkstras NULL 1 1 3 3
dijkstras NULL 1 1 2 2
diff --git a/storage/oqgraph/mysql-test/oqgraph/general-innodb.result b/storage/oqgraph/mysql-test/oqgraph/general-innodb.result
index b390dd38e34..927d856bc84 100644
--- a/storage/oqgraph/mysql-test/oqgraph/general-innodb.result
+++ b/storage/oqgraph/mysql-test/oqgraph/general-innodb.result
@@ -455,16 +455,16 @@ breadth_first NULL 4 1 2 3
breadth_first NULL 4 0 1 4
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5;
latch origid destid weight seq linkid
-breadth_first NULL 5 1 3 7
breadth_first NULL 5 1 2 6
breadth_first NULL 5 0 1 5
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6;
latch origid destid weight seq linkid
-breadth_first NULL 6 2 3 7
breadth_first NULL 6 1 2 5
breadth_first NULL 6 0 1 6
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7;
latch origid destid weight seq linkid
+breadth_first NULL 7 2 3 6
+breadth_first NULL 7 1 2 5
breadth_first NULL 7 0 1 7
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8;
latch origid destid weight seq linkid
@@ -473,18 +473,18 @@ latch origid destid weight seq linkid
breadth_first NULL 9 0 1 9
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10;
latch origid destid weight seq linkid
-breadth_first NULL 10 2 3 12
-breadth_first NULL 10 1 2 11
+breadth_first NULL 10 2 3 11
+breadth_first NULL 10 1 2 12
breadth_first NULL 10 0 1 10
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11;
latch origid destid weight seq linkid
-breadth_first NULL 11 2 3 10
-breadth_first NULL 11 1 2 12
+breadth_first NULL 11 2 3 12
+breadth_first NULL 11 1 2 10
breadth_first NULL 11 0 1 11
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12;
latch origid destid weight seq linkid
-breadth_first NULL 12 2 3 11
-breadth_first NULL 12 1 2 10
+breadth_first NULL 12 2 3 10
+breadth_first NULL 12 1 2 11
breadth_first NULL 12 0 1 12
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 1;
latch origid destid weight seq linkid
@@ -502,26 +502,26 @@ latch origid destid weight seq linkid
breadth_first NULL 4 1 2 3
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 5 1 3 7
breadth_first NULL 5 1 2 6
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 1;
latch origid destid weight seq linkid
breadth_first NULL 6 1 2 5
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 1;
latch origid destid weight seq linkid
+breadth_first NULL 7 1 2 5
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 10 1 2 11
+breadth_first NULL 10 1 2 12
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 11 1 2 12
+breadth_first NULL 11 1 2 10
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 12 1 2 10
+breadth_first NULL 12 1 2 11
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 2;
latch origid destid weight seq linkid
breadth_first NULL 1 2 4 4
@@ -538,22 +538,22 @@ SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 6 2 3 7
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 2;
latch origid destid weight seq linkid
+breadth_first NULL 7 2 3 6
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 10 2 3 12
+breadth_first NULL 10 2 3 11
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 11 2 3 10
+breadth_first NULL 11 2 3 12
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 12 2 3 11
+breadth_first NULL 12 2 3 10
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 3;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 3;
@@ -847,16 +847,16 @@ latch origid destid weight seq linkid
2 NULL 4 0 1 4
SELECT * FROM graph WHERE latch = '2' AND destid = 5;
latch origid destid weight seq linkid
-2 NULL 5 1 3 7
2 NULL 5 1 2 6
2 NULL 5 0 1 5
SELECT * FROM graph WHERE latch = '2' AND destid = 6;
latch origid destid weight seq linkid
-2 NULL 6 2 3 7
2 NULL 6 1 2 5
2 NULL 6 0 1 6
SELECT * FROM graph WHERE latch = '2' AND destid = 7;
latch origid destid weight seq linkid
+2 NULL 7 2 3 6
+2 NULL 7 1 2 5
2 NULL 7 0 1 7
SELECT * FROM graph WHERE latch = '2' AND destid = 8;
latch origid destid weight seq linkid
@@ -865,18 +865,18 @@ latch origid destid weight seq linkid
2 NULL 9 0 1 9
SELECT * FROM graph WHERE latch = '2' AND destid = 10;
latch origid destid weight seq linkid
-2 NULL 10 2 3 12
-2 NULL 10 1 2 11
+2 NULL 10 2 3 11
+2 NULL 10 1 2 12
2 NULL 10 0 1 10
SELECT * FROM graph WHERE latch = '2' AND destid = 11;
latch origid destid weight seq linkid
-2 NULL 11 2 3 10
-2 NULL 11 1 2 12
+2 NULL 11 2 3 12
+2 NULL 11 1 2 10
2 NULL 11 0 1 11
SELECT * FROM graph WHERE latch = '2' AND destid = 12;
latch origid destid weight seq linkid
-2 NULL 12 2 3 11
-2 NULL 12 1 2 10
+2 NULL 12 2 3 10
+2 NULL 12 1 2 11
2 NULL 12 0 1 12
SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 1;
latch origid destid weight seq linkid
@@ -894,26 +894,26 @@ latch origid destid weight seq linkid
2 NULL 4 1 2 3
SELECT * FROM graph WHERE latch = '2' AND destid = 5 and weight = 1;
latch origid destid weight seq linkid
-2 NULL 5 1 3 7
2 NULL 5 1 2 6
SELECT * FROM graph WHERE latch = '2' AND destid = 6 and weight = 1;
latch origid destid weight seq linkid
2 NULL 6 1 2 5
SELECT * FROM graph WHERE latch = '2' AND destid = 7 and weight = 1;
latch origid destid weight seq linkid
+2 NULL 7 1 2 5
SELECT * FROM graph WHERE latch = '2' AND destid = 8 and weight = 1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 9 and weight = 1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 10 and weight = 1;
latch origid destid weight seq linkid
-2 NULL 10 1 2 11
+2 NULL 10 1 2 12
SELECT * FROM graph WHERE latch = '2' AND destid = 11 and weight = 1;
latch origid destid weight seq linkid
-2 NULL 11 1 2 12
+2 NULL 11 1 2 10
SELECT * FROM graph WHERE latch = '2' AND destid = 12 and weight = 1;
latch origid destid weight seq linkid
-2 NULL 12 1 2 10
+2 NULL 12 1 2 11
SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 2;
latch origid destid weight seq linkid
2 NULL 1 2 4 4
@@ -930,22 +930,22 @@ SELECT * FROM graph WHERE latch = '2' AND destid = 5 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 6 and weight = 2;
latch origid destid weight seq linkid
-2 NULL 6 2 3 7
SELECT * FROM graph WHERE latch = '2' AND destid = 7 and weight = 2;
latch origid destid weight seq linkid
+2 NULL 7 2 3 6
SELECT * FROM graph WHERE latch = '2' AND destid = 8 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 9 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 10 and weight = 2;
latch origid destid weight seq linkid
-2 NULL 10 2 3 12
+2 NULL 10 2 3 11
SELECT * FROM graph WHERE latch = '2' AND destid = 11 and weight = 2;
latch origid destid weight seq linkid
-2 NULL 11 2 3 10
+2 NULL 11 2 3 12
SELECT * FROM graph WHERE latch = '2' AND destid = 12 and weight = 2;
latch origid destid weight seq linkid
-2 NULL 12 2 3 11
+2 NULL 12 2 3 10
SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 3;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = '2' AND destid = 2 and weight = 3;
@@ -1124,16 +1124,16 @@ dijkstras NULL 4 1 2 3
dijkstras NULL 4 0 1 4
SELECT * FROM graph WHERE latch='dijkstras' AND destid=5;
latch origid destid weight seq linkid
-dijkstras NULL 5 1 3 7
dijkstras NULL 5 1 2 6
dijkstras NULL 5 0 1 5
SELECT * FROM graph WHERE latch='dijkstras' AND destid=6;
latch origid destid weight seq linkid
-dijkstras NULL 6 2 3 7
dijkstras NULL 6 1 2 5
dijkstras NULL 6 0 1 6
SELECT * FROM graph WHERE latch='dijkstras' AND destid=7;
latch origid destid weight seq linkid
+dijkstras NULL 7 2 3 6
+dijkstras NULL 7 1 2 5
dijkstras NULL 7 0 1 7
SELECT * FROM graph WHERE latch='dijkstras' AND destid=8;
latch origid destid weight seq linkid
@@ -1142,18 +1142,18 @@ latch origid destid weight seq linkid
dijkstras NULL 9 0 1 9
SELECT * FROM graph WHERE latch='dijkstras' AND destid=10;
latch origid destid weight seq linkid
-dijkstras NULL 10 2 3 12
-dijkstras NULL 10 1 2 11
+dijkstras NULL 10 2 3 11
+dijkstras NULL 10 1 2 12
dijkstras NULL 10 0 1 10
SELECT * FROM graph WHERE latch='dijkstras' AND destid=11;
latch origid destid weight seq linkid
-dijkstras NULL 11 2 3 10
-dijkstras NULL 11 1 2 12
+dijkstras NULL 11 2 3 12
+dijkstras NULL 11 1 2 10
dijkstras NULL 11 0 1 11
SELECT * FROM graph WHERE latch='dijkstras' AND destid=12;
latch origid destid weight seq linkid
-dijkstras NULL 12 2 3 11
-dijkstras NULL 12 1 2 10
+dijkstras NULL 12 2 3 10
+dijkstras NULL 12 1 2 11
dijkstras NULL 12 0 1 12
# legacy string number
SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=1;
@@ -1299,16 +1299,16 @@ latch origid destid weight seq linkid
1 NULL 4 0 1 4
SELECT * FROM graph WHERE latch='1' AND destid=5;
latch origid destid weight seq linkid
-1 NULL 5 1 3 7
1 NULL 5 1 2 6
1 NULL 5 0 1 5
SELECT * FROM graph WHERE latch='1' AND destid=6;
latch origid destid weight seq linkid
-1 NULL 6 2 3 7
1 NULL 6 1 2 5
1 NULL 6 0 1 6
SELECT * FROM graph WHERE latch='1' AND destid=7;
latch origid destid weight seq linkid
+1 NULL 7 2 3 6
+1 NULL 7 1 2 5
1 NULL 7 0 1 7
SELECT * FROM graph WHERE latch='1' AND destid=8;
latch origid destid weight seq linkid
@@ -1317,18 +1317,18 @@ latch origid destid weight seq linkid
1 NULL 9 0 1 9
SELECT * FROM graph WHERE latch='1' AND destid=10;
latch origid destid weight seq linkid
-1 NULL 10 2 3 12
-1 NULL 10 1 2 11
+1 NULL 10 2 3 11
+1 NULL 10 1 2 12
1 NULL 10 0 1 10
SELECT * FROM graph WHERE latch='1' AND destid=11;
latch origid destid weight seq linkid
-1 NULL 11 2 3 10
-1 NULL 11 1 2 12
+1 NULL 11 2 3 12
+1 NULL 11 1 2 10
1 NULL 11 0 1 11
SELECT * FROM graph WHERE latch='1' AND destid=12;
latch origid destid weight seq linkid
-1 NULL 12 2 3 11
-1 NULL 12 1 2 10
+1 NULL 12 2 3 10
+1 NULL 12 1 2 11
1 NULL 12 0 1 12
INSERT INTO graph_base(from_id, to_id) VALUES (11,13);
INSERT INTO graph_base(from_id, to_id) VALUES (10,14);
@@ -1395,9 +1395,6 @@ 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
-dijkstras NULL 1 4 7 18
-dijkstras NULL 1 3 6 17
-dijkstras NULL 1 3 5 16
dijkstras NULL 1 2 4 4
dijkstras NULL 1 1 3 3
dijkstras NULL 1 1 2 2
diff --git a/storage/oqgraph/mysql-test/oqgraph/regression_1196036.result b/storage/oqgraph/mysql-test/oqgraph/regression_1196036.result
index 45bbccfa87e..c372a0c088f 100644
--- a/storage/oqgraph/mysql-test/oqgraph/regression_1196036.result
+++ b/storage/oqgraph/mysql-test/oqgraph/regression_1196036.result
@@ -41,19 +41,19 @@ dijkstras 3 NULL 256 2 2
dijkstras 3 NULL 0 1 3
SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 1;
latch origid destid weight seq linkid
-dijkstras NULL 1 784 4 4
+dijkstras NULL 1 65808 4 4
dijkstras NULL 1 272 3 3
dijkstras NULL 1 16 2 2
dijkstras NULL 1 0 1 1
SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 2;
latch origid destid weight seq linkid
-dijkstras NULL 2 768 4 4
+dijkstras NULL 2 65792 4 4
dijkstras NULL 2 256 3 3
dijkstras NULL 2 16 2 1
dijkstras NULL 2 0 1 2
SELECT * FROM graph WHERE latch = 'dijkstras' AND destid = 3;
latch origid destid weight seq linkid
-dijkstras NULL 3 1024 4 4
+dijkstras NULL 3 65536 4 4
dijkstras NULL 3 272 3 1
dijkstras NULL 3 256 2 2
dijkstras NULL 3 0 1 3
diff --git a/storage/oqgraph/mysql-test/oqgraph/regression_1213120.result b/storage/oqgraph/mysql-test/oqgraph/regression_1213120.result
index b6cd53ab673..642c0aa3b5d 100644
--- a/storage/oqgraph/mysql-test/oqgraph/regression_1213120.result
+++ b/storage/oqgraph/mysql-test/oqgraph/regression_1213120.result
@@ -464,16 +464,16 @@ breadth_first NULL 4 1 2 3
breadth_first NULL 4 0 1 4
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5;
latch origid destid weight seq linkid
-breadth_first NULL 5 1 3 7
breadth_first NULL 5 1 2 6
breadth_first NULL 5 0 1 5
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6;
latch origid destid weight seq linkid
-breadth_first NULL 6 2 3 7
breadth_first NULL 6 1 2 5
breadth_first NULL 6 0 1 6
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7;
latch origid destid weight seq linkid
+breadth_first NULL 7 2 3 6
+breadth_first NULL 7 1 2 5
breadth_first NULL 7 0 1 7
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8;
latch origid destid weight seq linkid
@@ -482,18 +482,18 @@ latch origid destid weight seq linkid
breadth_first NULL 9 0 1 9
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10;
latch origid destid weight seq linkid
-breadth_first NULL 10 2 3 12
-breadth_first NULL 10 1 2 11
+breadth_first NULL 10 2 3 11
+breadth_first NULL 10 1 2 12
breadth_first NULL 10 0 1 10
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11;
latch origid destid weight seq linkid
-breadth_first NULL 11 2 3 10
-breadth_first NULL 11 1 2 12
+breadth_first NULL 11 2 3 12
+breadth_first NULL 11 1 2 10
breadth_first NULL 11 0 1 11
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12;
latch origid destid weight seq linkid
-breadth_first NULL 12 2 3 11
-breadth_first NULL 12 1 2 10
+breadth_first NULL 12 2 3 10
+breadth_first NULL 12 1 2 11
breadth_first NULL 12 0 1 12
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 1;
latch origid destid weight seq linkid
@@ -511,26 +511,26 @@ latch origid destid weight seq linkid
breadth_first NULL 4 1 2 3
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 5 1 3 7
breadth_first NULL 5 1 2 6
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 1;
latch origid destid weight seq linkid
breadth_first NULL 6 1 2 5
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 1;
latch origid destid weight seq linkid
+breadth_first NULL 7 1 2 5
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 1;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 10 1 2 11
+breadth_first NULL 10 1 2 12
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 11 1 2 12
+breadth_first NULL 11 1 2 10
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 1;
latch origid destid weight seq linkid
-breadth_first NULL 12 1 2 10
+breadth_first NULL 12 1 2 11
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 2;
latch origid destid weight seq linkid
breadth_first NULL 1 2 4 4
@@ -547,22 +547,22 @@ SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 5 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 6 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 6 2 3 7
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 7 and weight = 2;
latch origid destid weight seq linkid
+breadth_first NULL 7 2 3 6
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9 and weight = 2;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 10 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 10 2 3 12
+breadth_first NULL 10 2 3 11
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 11 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 11 2 3 10
+breadth_first NULL 11 2 3 12
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 12 and weight = 2;
latch origid destid weight seq linkid
-breadth_first NULL 12 2 3 11
+breadth_first NULL 12 2 3 10
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 1 and weight = 3;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 2 and weight = 3;
@@ -838,8 +838,8 @@ latch origid destid weight seq linkid
2 NULL 1 0 1 1
SELECT * FROM graph WHERE latch = '2' AND destid = 12;
latch origid destid weight seq linkid
-2 NULL 12 2 3 11
-2 NULL 12 1 2 10
+2 NULL 12 2 3 10
+2 NULL 12 1 2 11
2 NULL 12 0 1 12
SELECT * FROM graph WHERE latch = '2' AND destid = 1 and weight = 1;
latch origid destid weight seq linkid
@@ -997,16 +997,16 @@ dijkstras NULL 4 1 2 3
dijkstras NULL 4 0 1 4
SELECT * FROM graph WHERE latch='dijkstras' AND destid=5;
latch origid destid weight seq linkid
-dijkstras NULL 5 1 3 7
dijkstras NULL 5 1 2 6
dijkstras NULL 5 0 1 5
SELECT * FROM graph WHERE latch='dijkstras' AND destid=6;
latch origid destid weight seq linkid
-dijkstras NULL 6 2 3 7
dijkstras NULL 6 1 2 5
dijkstras NULL 6 0 1 6
SELECT * FROM graph WHERE latch='dijkstras' AND destid=7;
latch origid destid weight seq linkid
+dijkstras NULL 7 2 3 6
+dijkstras NULL 7 1 2 5
dijkstras NULL 7 0 1 7
SELECT * FROM graph WHERE latch='dijkstras' AND destid=8;
latch origid destid weight seq linkid
@@ -1015,18 +1015,18 @@ latch origid destid weight seq linkid
dijkstras NULL 9 0 1 9
SELECT * FROM graph WHERE latch='dijkstras' AND destid=10;
latch origid destid weight seq linkid
-dijkstras NULL 10 2 3 12
-dijkstras NULL 10 1 2 11
+dijkstras NULL 10 2 3 11
+dijkstras NULL 10 1 2 12
dijkstras NULL 10 0 1 10
SELECT * FROM graph WHERE latch='dijkstras' AND destid=11;
latch origid destid weight seq linkid
-dijkstras NULL 11 2 3 10
-dijkstras NULL 11 1 2 12
+dijkstras NULL 11 2 3 12
+dijkstras NULL 11 1 2 10
dijkstras NULL 11 0 1 11
SELECT * FROM graph WHERE latch='dijkstras' AND destid=12;
latch origid destid weight seq linkid
-dijkstras NULL 12 2 3 11
-dijkstras NULL 12 1 2 10
+dijkstras NULL 12 2 3 10
+dijkstras NULL 12 1 2 11
dijkstras NULL 12 0 1 12
# legacy string number
SELECT * FROM graph WHERE latch='1' AND origid=1 AND destid=1;
@@ -1172,16 +1172,16 @@ latch origid destid weight seq linkid
1 NULL 4 0 1 4
SELECT * FROM graph WHERE latch='1' AND destid=5;
latch origid destid weight seq linkid
-1 NULL 5 1 3 7
1 NULL 5 1 2 6
1 NULL 5 0 1 5
SELECT * FROM graph WHERE latch='1' AND destid=6;
latch origid destid weight seq linkid
-1 NULL 6 2 3 7
1 NULL 6 1 2 5
1 NULL 6 0 1 6
SELECT * FROM graph WHERE latch='1' AND destid=7;
latch origid destid weight seq linkid
+1 NULL 7 2 3 6
+1 NULL 7 1 2 5
1 NULL 7 0 1 7
SELECT * FROM graph WHERE latch='1' AND destid=8;
latch origid destid weight seq linkid
@@ -1190,18 +1190,18 @@ latch origid destid weight seq linkid
1 NULL 9 0 1 9
SELECT * FROM graph WHERE latch='1' AND destid=10;
latch origid destid weight seq linkid
-1 NULL 10 2 3 12
-1 NULL 10 1 2 11
+1 NULL 10 2 3 11
+1 NULL 10 1 2 12
1 NULL 10 0 1 10
SELECT * FROM graph WHERE latch='1' AND destid=11;
latch origid destid weight seq linkid
-1 NULL 11 2 3 10
-1 NULL 11 1 2 12
+1 NULL 11 2 3 12
+1 NULL 11 1 2 10
1 NULL 11 0 1 11
SELECT * FROM graph WHERE latch='1' AND destid=12;
latch origid destid weight seq linkid
-1 NULL 12 2 3 11
-1 NULL 12 1 2 10
+1 NULL 12 2 3 10
+1 NULL 12 1 2 11
1 NULL 12 0 1 12
SELECT count(*) FROM graph;
count(*)
@@ -1280,9 +1280,6 @@ 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
-dijkstras NULL 1 4 7 18
-dijkstras NULL 1 3 6 17
-dijkstras NULL 1 3 5 16
dijkstras NULL 1 2 4 4
dijkstras NULL 1 1 3 3
dijkstras NULL 1 1 2 2
diff --git a/storage/oqgraph/oqgraph_shim.h b/storage/oqgraph/oqgraph_shim.h
index c0a9dbb2b40..f24732af4ef 100644
--- a/storage/oqgraph/oqgraph_shim.h
+++ b/storage/oqgraph/oqgraph_shim.h
@@ -154,12 +154,12 @@ namespace oqgraph3
typedef std::input_iterator_tag iterator_category;
in_edge_iterator() { }
in_edge_iterator(const cursor_ptr& cursor) : _cursor(cursor) { }
- value_type operator*() { return value_type(_cursor); }
+ value_type operator*() const { return value_type(_cursor); }
self& operator++() { _cursor->seek_next(); return *this; }
self operator++(int)
{ cursor_ptr t(new cursor(*_cursor)); ++(*this); return in_edge_iterator(t); }
- bool operator==(const self& x) { return _cursor == x._cursor; }
- bool operator!=(const self& x) { return _cursor != x._cursor; }
+ bool operator==(const self& x) const { return _cursor == x._cursor; }
+ bool operator!=(const self& x) const { return _cursor != x._cursor; }
cursor_ptr _cursor;
};