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
323d4582
Commit
323d4582
authored
Sep 12, 2013
by
Andrew McDonnell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure we have an up to date count of edges of backing table
parent
2560ce00
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
mysql-test/suite/oqgraph/legacy_upgrade.result
mysql-test/suite/oqgraph/legacy_upgrade.result
+2
-2
storage/oqgraph/ha_oqgraph.cc
storage/oqgraph/ha_oqgraph.cc
+10
-1
No files found.
mysql-test/suite/oqgraph/legacy_upgrade.result
View file @
323d4582
...
@@ -17,7 +17,7 @@ linkid BIGINT UNSIGNED NULL,
...
@@ -17,7 +17,7 @@ linkid BIGINT UNSIGNED NULL,
KEY (latch, origid, destid) USING HASH,
KEY (latch, origid, destid) USING HASH,
KEY (latch, destid, origid) USING HASH
KEY (latch, destid, origid) USING HASH
) ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id', DESTID='to_id';
) ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id', DESTID='to_id';
ERROR HY000: Can't create table
'test.graph'
(errno: 140 "Wrong create options")
ERROR HY000: Can't create table
`test`.`graph`
(errno: 140 "Wrong create options")
SET GLOBAL oqgraph_allow_create_integer_latch=true;
SET GLOBAL oqgraph_allow_create_integer_latch=true;
The next warning 1287 is expected
The next warning 1287 is expected
CREATE TABLE graph (
CREATE TABLE graph (
...
@@ -44,7 +44,7 @@ linkid BIGINT UNSIGNED NULL,
...
@@ -44,7 +44,7 @@ linkid BIGINT UNSIGNED NULL,
KEY (latch, origid, destid) USING HASH,
KEY (latch, origid, destid) USING HASH,
KEY (latch, destid, origid) USING HASH
KEY (latch, destid, origid) USING HASH
) ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id', DESTID='to_id';
) ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id', DESTID='to_id';
ERROR HY000: Can't create table
'test.graph_again'
(errno: 140 "Wrong create options")
ERROR HY000: Can't create table
`test`.`graph_again`
(errno: 140 "Wrong create options")
# Populating base table
# Populating base table
INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1);
INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1);
INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1);
INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1);
...
...
storage/oqgraph/ha_oqgraph.cc
View file @
323d4582
...
@@ -1050,6 +1050,7 @@ int ha_oqgraph::fill_record(byte *record, const open_query::row &row)
...
@@ -1050,6 +1050,7 @@ int ha_oqgraph::fill_record(byte *record, const open_query::row &row)
int
ha_oqgraph
::
rnd_init
(
bool
scan
)
int
ha_oqgraph
::
rnd_init
(
bool
scan
)
{
{
edges
->
file
->
info
(
HA_STATUS_VARIABLE
);
// Fix for bug 1195735 - ensure we operate with up to date count!
edges
->
prepare_for_position
();
edges
->
prepare_for_position
();
return
error_code
(
graph
->
random
(
scan
));
return
error_code
(
graph
->
random
(
scan
));
}
}
...
@@ -1057,7 +1058,15 @@ int ha_oqgraph::rnd_init(bool scan)
...
@@ -1057,7 +1058,15 @@ int ha_oqgraph::rnd_init(bool scan)
int
ha_oqgraph
::
rnd_next
(
byte
*
buf
)
int
ha_oqgraph
::
rnd_next
(
byte
*
buf
)
{
{
int
res
;
int
res
;
open_query
::
row
row
;
open_query
::
row
row
=
{};
// Problem: bug 1195735 - mysqld hang if we delete * from the underlying table, we get an infinite loop through here
// fetch_row() --> fetch_row() --> num_edges() --> _table->file->stats->records
// _table is actually a handle on the backing table we just deleted everything from. so the statistics are out of date.
// so we really need to force a refresh on the backing store statistics, when starting a new query
// So we probably need to fix this bug in rnd_init
// Note, close() never called in between; this would otherwise clean things up
if
(
!
(
res
=
graph
->
fetch_row
(
row
)))
// FIXME - this called after DELETE FROM graph_base; hangs...
if
(
!
(
res
=
graph
->
fetch_row
(
row
)))
// FIXME - this called after DELETE FROM graph_base; hangs...
res
=
fill_record
(
buf
,
row
);
res
=
fill_record
(
buf
,
row
);
table
->
status
=
res
?
STATUS_NOT_FOUND
:
0
;
table
->
status
=
res
?
STATUS_NOT_FOUND
:
0
;
...
...
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