summaryrefslogtreecommitdiff
path: root/sql/filesort.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-02-03 19:09:19 +0100
committerSergei Golubchik <serg@mariadb.org>2017-02-13 18:12:05 +0100
commitdafb507e3ed09699230e3dd52fdc68c6094ee148 (patch)
treea1022c0b43ab611ed2324e3122f16e35d78c115c /sql/filesort.cc
parente46c42217f4fc7ba43992ca54c039f2556d1859f (diff)
downloadmariadb-git-dafb507e3ed09699230e3dd52fdc68c6094ee148.tar.gz
find_all_keys: add an assert, remove current_thd
Filesort temporarily changes read_set to be tmp_set and marks only fields needed for filesort. Add an assert to ensure that it doesn't overwrite the old value of tmp_set, that is that read_set was *not* already tmp_set when filesort was invoked. Fix sql_update.cc that was was doing exactly that - changing read_set to tmp_set, configuring tmp_set for keyread, and then invoking filesort.
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r--sql/filesort.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 2283e6e3d0a..baeb75b3b0b 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -747,8 +747,7 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select,
DBUG_SET("+d,ha_rnd_init_fail"););
if (file->ha_rnd_init_with_error(1))
DBUG_RETURN(HA_POS_ERROR);
- file->extra_opt(HA_EXTRA_CACHE,
- current_thd->variables.read_buff_size);
+ file->extra_opt(HA_EXTRA_CACHE, thd->variables.read_buff_size);
}
/* Remember original bitmaps */
@@ -757,6 +756,7 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select,
save_vcol_set= sort_form->vcol_set;
/* Set up temporary column read map for columns used by sort */
+ DBUG_ASSERT(save_read_set != &sort_form->tmp_set);
bitmap_clear_all(&sort_form->tmp_set);
sort_form->column_bitmaps_set(&sort_form->tmp_set, &sort_form->tmp_set,
&sort_form->tmp_set);