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
e87960d3
Commit
e87960d3
authored
Aug 02, 2013
by
Andrew McDonnell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for spurious result when searching for non-existing vertex
parent
7644bed6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
mysql-test/suite/oqgraph/basic.result
mysql-test/suite/oqgraph/basic.result
+0
-12
storage/oqgraph/oqgraph_shim.h
storage/oqgraph/oqgraph_shim.h
+9
-0
No files found.
mysql-test/suite/oqgraph/basic.result
View file @
e87960d3
...
...
@@ -212,7 +212,6 @@ latch origid destid weight seq linkid
breadth_first 7 NULL 0 1 7
SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 8;
latch origid destid weight seq linkid
breadth_first 8 NULL 0 1 8
SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 9;
latch origid destid weight seq linkid
breadth_first 9 NULL 0 1 9
...
...
@@ -233,7 +232,6 @@ breadth_first 12 NULL 1 2 10
breadth_first 12 NULL 0 1 12
SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 666;
latch origid destid weight seq linkid
breadth_first 666 NULL 0 1 666
SELECT * FROM graph WHERE latch = 'breadth_first' AND origid = 1 AND weight = 1;
latch origid destid weight seq linkid
breadth_first 1 NULL 1 3 3
...
...
@@ -447,7 +445,6 @@ latch origid destid weight seq linkid
breadth_first NULL 7 0 1 7
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 8;
latch origid destid weight seq linkid
breadth_first NULL 8 0 1 8
SELECT * FROM graph WHERE latch = 'breadth_first' AND destid = 9;
latch origid destid weight seq linkid
breadth_first NULL 9 0 1 9
...
...
@@ -607,7 +604,6 @@ latch origid destid weight seq linkid
2 7 NULL 0 1 7
SELECT * FROM graph WHERE latch = '2' AND origid = 8;
latch origid destid weight seq linkid
2 8 NULL 0 1 8
SELECT * FROM graph WHERE latch = '2' AND origid = 9;
latch origid destid weight seq linkid
2 9 NULL 0 1 9
...
...
@@ -628,7 +624,6 @@ latch origid destid weight seq linkid
2 12 NULL 0 1 12
SELECT * FROM graph WHERE latch = '2' AND origid = 666;
latch origid destid weight seq linkid
2 666 NULL 0 1 666
SELECT * FROM graph WHERE latch = '2' AND origid = 1 AND weight = 1;
latch origid destid weight seq linkid
2 1 NULL 1 3 3
...
...
@@ -842,7 +837,6 @@ latch origid destid weight seq linkid
2 NULL 7 0 1 7
SELECT * FROM graph WHERE latch = '2' AND destid = 8;
latch origid destid weight seq linkid
2 NULL 8 0 1 8
SELECT * FROM graph WHERE latch = '2' AND destid = 9;
latch origid destid weight seq linkid
2 NULL 9 0 1 9
...
...
@@ -1061,7 +1055,6 @@ latch origid destid weight seq linkid
dijkstras 7 NULL 0 1 7
SELECT * FROM graph WHERE latch='dijkstras' AND origid=8;
latch origid destid weight seq linkid
dijkstras 8 NULL 0 1 8
SELECT * FROM graph WHERE latch='dijkstras' AND origid=9;
latch origid destid weight seq linkid
dijkstras 9 NULL 0 1 9
...
...
@@ -1082,7 +1075,6 @@ dijkstras 12 NULL 0 2 10
dijkstras 12 NULL 0 1 12
SELECT * FROM graph WHERE latch='dijkstras' AND origid=666;
latch origid destid weight seq linkid
dijkstras 666 NULL 0 1 666
SELECT * FROM graph WHERE latch='dijkstras' AND destid=1;
latch origid destid weight seq linkid
dijkstras NULL 1 2 4 4
...
...
@@ -1122,7 +1114,6 @@ latch origid destid weight seq linkid
dijkstras NULL 7 0 1 7
SELECT * FROM graph WHERE latch='dijkstras' AND destid=8;
latch origid destid weight seq linkid
dijkstras NULL 8 0 1 8
SELECT * FROM graph WHERE latch='dijkstras' AND destid=9;
latch origid destid weight seq linkid
dijkstras NULL 9 0 1 9
...
...
@@ -1239,7 +1230,6 @@ latch origid destid weight seq linkid
1 7 NULL 0 1 7
SELECT * FROM graph WHERE latch='1' AND origid=8;
latch origid destid weight seq linkid
1 8 NULL 0 1 8
SELECT * FROM graph WHERE latch='1' AND origid=9;
latch origid destid weight seq linkid
1 9 NULL 0 1 9
...
...
@@ -1260,7 +1250,6 @@ latch origid destid weight seq linkid
1 12 NULL 0 1 12
SELECT * FROM graph WHERE latch='1' AND origid=666;
latch origid destid weight seq linkid
1 666 NULL 0 1 666
SELECT * FROM graph WHERE latch='1' AND destid=1;
latch origid destid weight seq linkid
1 NULL 1 2 4 4
...
...
@@ -1300,7 +1289,6 @@ latch origid destid weight seq linkid
1 NULL 7 0 1 7
SELECT * FROM graph WHERE latch='1' AND destid=8;
latch origid destid weight seq linkid
1 NULL 8 0 1 8
SELECT * FROM graph WHERE latch='1' AND destid=9;
latch origid destid weight seq linkid
1 NULL 9 0 1 9
...
...
storage/oqgraph/oqgraph_shim.h
View file @
e87960d3
...
...
@@ -479,6 +479,15 @@ namespace boost
inline
optional
<
graph_traits
<
oqgraph3
::
graph
>::
vertex_descriptor
>
find_vertex
(
oqgraph3
::
vertex_id
id
,
const
oqgraph3
::
graph
&
g
)
{
// Fix for https://bugs.launchpad.net/oqgraph/+bug/1196020 returning vertex even when not in graph
// Psuedocode for fix:
// if count(*) from g->TABLE where source=id or target=id > 0 then return id else return null
oqgraph3
::
cursor
*
found
=
new
oqgraph3
::
cursor
(
const_cast
<
oqgraph3
::
graph
*>
(
&
g
));
if
(
found
->
seek_to
(
id
,
boost
::
none
)
&&
found
->
seek_to
(
boost
::
none
,
id
))
{
// id is neither a from or a to in a link
return
optional
<
graph_traits
<
oqgraph3
::
graph
>::
vertex_descriptor
>
();
}
return
id
;
}
...
...
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