summaryrefslogtreecommitdiff
path: root/storage/oqgraph
diff options
context:
space:
mode:
authorAndrew McDonnell <bugs@andrewmcdonnell.net>2013-09-12 22:32:58 +0930
committerAndrew McDonnell <bugs@andrewmcdonnell.net>2013-09-12 22:32:58 +0930
commit323d45826f946afb01eafb8e9851059b5ca4b48b (patch)
tree0a56c401aeac8c8983b05e2f979c6cb4c5d18d2e /storage/oqgraph
parent2560ce008518b7ec9533d6cd3d6b20d0febd6c11 (diff)
downloadmariadb-git-323d45826f946afb01eafb8e9851059b5ca4b48b.tar.gz
Ensure we have an up to date count of edges of backing table
Diffstat (limited to 'storage/oqgraph')
-rw-r--r--storage/oqgraph/ha_oqgraph.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc
index 34d3f3a5f56..8cd15dec2e8 100644
--- a/storage/oqgraph/ha_oqgraph.cc
+++ b/storage/oqgraph/ha_oqgraph.cc
@@ -1050,6 +1050,7 @@ int ha_oqgraph::fill_record(byte *record, const open_query::row &row)
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();
return error_code(graph->random(scan));
}
@@ -1057,7 +1058,15 @@ int ha_oqgraph::rnd_init(bool scan)
int ha_oqgraph::rnd_next(byte *buf)
{
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...
res= fill_record(buf, row);
table->status= res ? STATUS_NOT_FOUND: 0;