summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@sun.com>2010-02-09 12:53:13 +0400
committerSergey Vojtovich <svoj@sun.com>2010-02-09 12:53:13 +0400
commit0897669cba1b314c36f41a8a31ee73b6d0d11115 (patch)
tree4399c5a586ac17afc75f2a3776d0bf12b75315fe /sql/sql_update.cc
parentc12c9780cdbe965bcdce0326b14a171d2f2b8635 (diff)
downloadmariadb-git-0897669cba1b314c36f41a8a31ee73b6d0d11115.tar.gz
BUG#49902 - SELECT returns incorrect results
Queries optimized with GROUP_MIN_MAX didn't cleanup KEYREAD optimization properly. As a result subsequent queries may return incomplete rows (fields are initialized to default values). mysql-test/r/group_min_max.result: A test case for BUG#49902. mysql-test/t/group_min_max.test: A test case for BUG#49902. sql/opt_range.cc: Refactor of KEYREAD optimization switch so that KEYREAD handler state is in sync with st_table::key_read flag. All SQL code is supposed to switch KEYREAD optimization via st_table::set_keyread(). sql/opt_sum.cc: Refactor of KEYREAD optimization switch so that KEYREAD handler state is in sync with st_table::key_read flag. All SQL code is supposed to switch KEYREAD optimization via st_table::set_keyread(). sql/sql_select.cc: Refactor of KEYREAD optimization switch so that KEYREAD handler state is in sync with st_table::key_read flag. All SQL code is supposed to switch KEYREAD optimization via st_table::set_keyread(). sql/sql_update.cc: Refactor of KEYREAD optimization switch so that KEYREAD handler state is in sync with st_table::key_read flag. All SQL code is supposed to switch KEYREAD optimization via st_table::set_keyread(). sql/table.cc: Refactor of KEYREAD optimization switch so that KEYREAD handler state is in sync with st_table::key_read flag. All SQL code is supposed to switch KEYREAD optimization via st_table::set_keyread(). sql/table.h: Refactor of KEYREAD optimization switch so that KEYREAD handler state is in sync with st_table::key_read flag. All SQL code is supposed to switch KEYREAD optimization via st_table::set_keyread().
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc9
1 files changed, 1 insertions, 8 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 433e2619aca..32add8679ef 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -397,10 +397,7 @@ int mysql_update(THD *thd,
matching rows before updating the table!
*/
if (used_index < MAX_KEY && old_covering_keys.is_set(used_index))
- {
- table->key_read=1;
table->mark_columns_used_by_index(used_index);
- }
else
{
table->use_all_columns();
@@ -844,11 +841,7 @@ int mysql_update(THD *thd,
err:
delete select;
free_underlaid_joins(thd, select_lex);
- if (table->key_read)
- {
- table->key_read=0;
- table->file->extra(HA_EXTRA_NO_KEYREAD);
- }
+ table->set_keyread(FALSE);
thd->abort_on_warning= 0;
DBUG_RETURN(1);
}