Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0cd1f495
Commit
0cd1f495
authored
Jun 29, 2013
by
Andrew McDonnell
Browse files
Options
Browse Files
Download
Plain Diff
Fix for breadth_first originating vertices returning no result.
parents
6f12d8b3
d1650f82
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
303 additions
and
6 deletions
+303
-6
mysql-test/suite/oqgraph/basic.result
mysql-test/suite/oqgraph/basic.result
+209
-1
mysql-test/suite/oqgraph/basic.test
mysql-test/suite/oqgraph/basic.test
+90
-2
storage/oqgraph/graphcore.cc
storage/oqgraph/graphcore.cc
+4
-3
No files found.
mysql-test/suite/oqgraph/basic.result
View file @
0cd1f495
This diff is collapsed.
Click to expand it.
mysql-test/suite/oqgraph/basic.test
View file @
0cd1f495
...
...
@@ -226,6 +226,8 @@ SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 4;
SELECT
*
FROM
graph
WHERE
latch
=
'breadth_first'
AND
destid
=
5
;
SELECT
*
FROM
graph
WHERE
latch
=
'breadth_first'
AND
destid
=
6
;
SELECT
*
FROM
graph
WHERE
latch
=
'breadth_first'
AND
destid
=
7
;
#-- FIXME This is returning one result set, suspect this is a bug...?
#-- https://bugs.launchpad.net/oqgraph/+bug/1196020
SELECT
*
FROM
graph
WHERE
latch
=
'breadth_first'
AND
destid
=
8
;
SELECT
*
FROM
graph
WHERE
latch
=
'breadth_first'
AND
destid
=
9
;
SELECT
*
FROM
graph
WHERE
latch
=
'breadth_first'
AND
destid
=
10
;
...
...
@@ -354,15 +356,66 @@ SELECT * FROM graph WHERE latch = '2' AND origid = 10 AND (weight = 1 or weight
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
origid
=
11
AND
(
weight
=
1
or
weight
=
2
);
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
origid
=
12
AND
(
weight
=
1
or
weight
=
2
);
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
4
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
5
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
6
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
7
;
#-- FIXME This is returning one result set, suspect this is a bug...?
#-- https://bugs.launchpad.net/oqgraph/+bug/1196020
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
8
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
9
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
10
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
11
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
12
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
1
and
weight
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
2
and
weight
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
3
and
weight
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
4
and
weight
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
5
and
weight
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
6
and
weight
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
7
and
weight
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
8
and
weight
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
9
and
weight
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
10
and
weight
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
11
and
weight
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
12
and
weight
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
1
and
weight
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
2
and
weight
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
3
and
weight
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
4
and
weight
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
5
and
weight
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
6
and
weight
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
7
and
weight
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
8
and
weight
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
9
and
weight
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
10
and
weight
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
11
and
weight
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
12
and
weight
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
1
and
weight
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
2
and
weight
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
3
and
weight
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
4
and
weight
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
5
and
weight
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
6
and
weight
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
7
and
weight
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
8
and
weight
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
9
and
weight
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
10
and
weight
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
11
and
weight
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
12
and
weight
=
3
;
#-- These return empty sets - origid must be specified and non null to get a result set
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
origid
=
NULL
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
destid
=
NULL
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
AND
weight
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'2'
;
--
echo
# Dijkstras algorithm tests
#-- We ask 'What is the path (if any) between 'origid' and 'destid'
#-- We ask 'What is the
shortest
path (if any) between 'origid' and 'destid'
#-- This returns the number of directed hops +1 (for the starting node)
#-- 'weight' is NULL for the starting point, or 1
#-- 'linkid' is the way point id
...
...
@@ -396,6 +449,41 @@ SELECT * FROM graph WHERE latch='dijkstras' AND origid=11 AND destid=12;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
12
AND
destid
=
10
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
12
AND
destid
=
11
;
#-- reachable vertices
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
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
4
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
5
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
6
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
7
;
#-- FIXME This is returning one result set, suspect this is a bug...?
#-- https://bugs.launchpad.net/oqgraph/+bug/1196020
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
8
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
9
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
10
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
11
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
12
;
#-- FIXME This is returning one result set, suspect this is a bug...?
#-- https://bugs.launchpad.net/oqgraph/+bug/1196020
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
origid
=
666
;
#-- originating vertices
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
destid
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
destid
=
2
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
destid
=
3
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
destid
=
4
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
destid
=
5
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
destid
=
6
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
destid
=
7
;
#-- FIXME This is returning one result set, suspect this is a bug...?
#-- https://bugs.launchpad.net/oqgraph/+bug/1196020
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
destid
=
8
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
destid
=
9
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
destid
=
10
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
destid
=
11
;
SELECT
*
FROM
graph
WHERE
latch
=
'dijkstras'
AND
destid
=
12
;
--
echo
# legacy string number
SELECT
*
FROM
graph
WHERE
latch
=
'1'
AND
origid
=
1
AND
destid
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'1'
AND
origid
=
1
AND
destid
=
2
;
...
...
storage/oqgraph/graphcore.cc
View file @
0cd1f495
...
...
@@ -856,10 +856,10 @@ namespace open_query
}
}
break
;
#if 0
case
BREADTH_FIRST
|
HAVE_DEST
:
#ifdef FIXME
case
DIJKSTRAS
|
HAVE_DEST
:
#endif
if
((
cursor
=
new
(
std
::
nothrow
)
stack_cursor
(
share
))
&&
(
orig
||
dest
))
{
boost
::
unordered_map
<
Vertex
,
Vertex
>
p
;
...
...
@@ -870,6 +870,7 @@ namespace open_query
d
[
*
dest
]
=
EdgeWeight
();
switch
(
ALGORITHM
&
op
)
{
#ifdef FIXME
case
DIJKSTRAS
:
dijkstra_shortest_paths_no_init
(
share
->
g
,
*
dest
,
make_lazy_property_map
(
p
,
identity_initializer
<
Vertex
>
()),
...
...
@@ -891,6 +892,7 @@ namespace open_query
),
make_two_bit_judy_map
(
get
(
vertex_index
,
share
->
g
)));
break
;
#endif
case
BREADTH_FIRST
:
breadth_first_visit
(
share
->
g
,
*
dest
,
Q
,
make_bfs_visitor
(
...
...
@@ -918,7 +920,6 @@ namespace open_query
}
}
break
;
#endif
default:
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment