From dc0a59a2e7e5ae44723e142566d7164c84f5fdb2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 7 Nov 2007 15:08:50 +0300 Subject: [PATCH] Fix for bug #25421: MySQL threads don't respond to the kill command 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. sql/opt_range.cc: Check the thread's 'killed' status in check_quick_keys() and interrupt the calculation process if it is set to a non-zero value. --- sql/opt_range.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 99c28be36b0..c1c2ea17715 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -7352,6 +7352,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 &&