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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4d33c742
Commit
4d33c742
authored
Oct 20, 2016
by
Heinz Wiesinger
Committed by
Vicențiu-Marian Ciorbaru
Oct 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-10980: Fix reverse queries in OQGRAPH.
parent
172cc70b
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
190 additions
and
202 deletions
+190
-202
storage/oqgraph/graphcore.cc
storage/oqgraph/graphcore.cc
+6
-6
storage/oqgraph/mysql-test/oqgraph/general-Aria.result
storage/oqgraph/mysql-test/oqgraph/general-Aria.result
+48
-51
storage/oqgraph/mysql-test/oqgraph/general-MyISAM.result
storage/oqgraph/mysql-test/oqgraph/general-MyISAM.result
+48
-51
storage/oqgraph/mysql-test/oqgraph/general-innodb.result
storage/oqgraph/mysql-test/oqgraph/general-innodb.result
+48
-51
storage/oqgraph/mysql-test/oqgraph/regression_1196036.result
storage/oqgraph/mysql-test/oqgraph/regression_1196036.result
+3
-3
storage/oqgraph/mysql-test/oqgraph/regression_1213120.result
storage/oqgraph/mysql-test/oqgraph/regression_1213120.result
+34
-37
storage/oqgraph/oqgraph_shim.h
storage/oqgraph/oqgraph_shim.h
+3
-3
No files found.
storage/oqgraph/graphcore.cc
View file @
4d33c742
...
...
@@ -897,12 +897,12 @@ namespace open_query
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
();
...
...
storage/oqgraph/mysql-test/oqgraph/general-Aria.result
View file @
4d33c742
This diff is collapsed.
Click to expand it.
storage/oqgraph/mysql-test/oqgraph/general-MyISAM.result
View file @
4d33c742
This diff is collapsed.
Click to expand it.
storage/oqgraph/mysql-test/oqgraph/general-innodb.result
View file @
4d33c742
This diff is collapsed.
Click to expand it.
storage/oqgraph/mysql-test/oqgraph/regression_1196036.result
View file @
4d33c742
...
...
@@ -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
...
...
storage/oqgraph/mysql-test/oqgraph/regression_1213120.result
View file @
4d33c742
...
...
@@ -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 1
2
breadth_first NULL 10 1 2 1
1
breadth_first NULL 10 2 3 1
1
breadth_first NULL 10 1 2 1
2
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 1
0
breadth_first NULL 11 1 2 1
2
breadth_first NULL 11 2 3 1
2
breadth_first NULL 11 1 2 1
0
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 1
1
breadth_first NULL 12 1 2 1
0
breadth_first NULL 12 2 3 1
0
breadth_first NULL 12 1 2 1
1
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 1
1
breadth_first NULL 10 1 2 1
2
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 1
2
breadth_first NULL 11 1 2 1
0
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 1
0
breadth_first NULL 12 1 2 1
1
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 1
2
breadth_first NULL 10 2 3 1
1
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 1
0
breadth_first NULL 11 2 3 1
2
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 1
1
breadth_first NULL 12 2 3 1
0
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 1
1
2 NULL 12 1 2 1
0
2 NULL 12 2 3 1
0
2 NULL 12 1 2 1
1
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 1
2
dijkstras NULL 10 1 2 1
1
dijkstras NULL 10 2 3 1
1
dijkstras NULL 10 1 2 1
2
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 1
0
dijkstras NULL 11 1 2 1
2
dijkstras NULL 11 2 3 1
2
dijkstras NULL 11 1 2 1
0
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 1
1
dijkstras NULL 12 1 2 1
0
dijkstras NULL 12 2 3 1
0
dijkstras NULL 12 1 2 1
1
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 1
2
1 NULL 10 1 2 1
1
1 NULL 10 2 3 1
1
1 NULL 10 1 2 1
2
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 1
0
1 NULL 11 1 2 1
2
1 NULL 11 2 3 1
2
1 NULL 11 1 2 1
0
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 1
1
1 NULL 12 1 2 1
0
1 NULL 12 2 3 1
0
1 NULL 12 1 2 1
1
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
...
...
storage/oqgraph/oqgraph_shim.h
View file @
4d33c742
...
...
@@ -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
;
};
...
...
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