summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@sun.com>2010-07-15 10:10:16 +0400
committerAlexey Kopytov <Alexey.Kopytov@sun.com>2010-07-15 10:10:16 +0400
commit4c28b6776884b3890cc82c251eb4b54fe5dd81d4 (patch)
tree4dca1ff60260ed2418dfdb9c899881ea6c65a0d3 /sql/opt_range.cc
parentb2318bce9e8ed93d4566896c05806c6bf547b54f (diff)
downloadmariadb-git-4c28b6776884b3890cc82c251eb4b54fe5dd81d4.tar.gz
Backport of the fix for bug#25421 to 5.0.
Calculating the estimated number of records for a range scan may take a significant time, and it was impossible for a user to interrupt that process by killing the connection or the query. Fixed by checking the thread's 'killed' status in check_quick_keys() and interrupting the calculation process if it is set to a non-zero value.
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 84519c091b9..35d1216387c 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -6066,6 +6066,9 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree,
tmp_max_flag=max_key_flag | key_tree->max_flag;
}
+ if (unlikely(param->thd->killed != 0))
+ return HA_POS_ERROR;
+
keynr=param->real_keynr[idx];
param->range_count++;
if (!tmp_min_flag && ! tmp_max_flag &&