From 62513bb1bca33902fa909ca13b25c550046ee3ae Mon Sep 17 00:00:00 2001 From: Sergey Petrunia Date: Tue, 15 Jul 2008 18:13:21 +0400 Subject: BUG#35478: sort_union() returns bad data when sort_buffer_size is hit - In QUICK_INDEX_MERGE_SELECT::read_keys_and_merge: when we got table->sort from Unique, tell init_read_record() not to use rr_from_cache() because a) rowids are already sorted and b) it might be that the the data is used by filesort(), which will need record rowids (which rr_from_cache() cannot provide). - Fully de-initialize the table->sort read in QUICK_INDEX_MERGE_SELECT::get_next(). This fixes BUG#35477. (bk trigger: file as fix for BUG#35478). sql/filesort.cc: BUG#35478: sort_union() returns bad data when sort_buffer_size is hit - make find_all_keys() use quick->get_next() instead of init_read_record(r)/r.read_record() calls - added dbug printout sql/mysql_priv.h: BUG#35478: sort_union() returns bad data when sort_buffer_size is hit - Added parameter to init_read_record sql/opt_range.cc: BUG#35478: sort_union() returns bad data when sort_buffer_size is hit - In QUICK_INDEX_MERGE_SELECT::read_keys_and_merge: when we got table->sort from Unique, tell init_read_record() not to use rr_from_cache() because a) rowids are already sorted and b) it might be that the the data is used by filesort(), which will need record rowids (which rr_from_cache() cannot provide). - Fully de-initialize the table->sort read in QUICK_INDEX_MERGE_SELECT::get_next(). sql/records.cc: BUG#35478: sort_union() returns bad data when sort_buffer_size is hit - Added disable_rr_cache parameter to init_read_record - Added comment sql/sql_acl.cc: BUG#35478: sort_union() returns bad data when sort_buffer_size is hit - Added parameter to init_read_record sql/sql_delete.cc: BUG#35478: sort_union() returns bad data when sort_buffer_size is hit - Added parameter to init_read_record sql/sql_help.cc: BUG#35478: sort_union() returns bad data when sort_buffer_size is hit - Added parameter to init_read_record sql/sql_select.cc: BUG#35478: sort_union() returns bad data when sort_buffer_size is hit - Added parameter to init_read_record sql/sql_table.cc: BUG#35478: sort_union() returns bad data when sort_buffer_size is hit - Added parameter to init_read_record sql/sql_udf.cc: BUG#35478: sort_union() returns bad data when sort_buffer_size is hit - Added parameter to init_read_record sql/sql_update.cc: BUG#35478: sort_union() returns bad data when sort_buffer_size is hit - Added parameter to init_read_record --- sql/sql_delete.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_delete.cc') diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 213da1d49e8..38f89683065 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -214,7 +214,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, DBUG_RETURN(TRUE); } if (usable_index==MAX_KEY) - init_read_record(&info,thd,table,select,1,1); + init_read_record(&info, thd, table, select, 1, 1, FALSE); else init_read_record_idx(&info, thd, table, 1, usable_index); @@ -772,7 +772,7 @@ int multi_delete::do_deletes() } READ_RECORD info; - init_read_record(&info,thd,table,NULL,0,1); + init_read_record(&info, thd, table, NULL, 0, 1, FALSE); /* Ignore any rows not found in reference tables as they may already have been deleted by foreign key handling -- cgit v1.2.1