From de9ef03ae6a6cf573062c89d22ca446154f435f5 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 18 Sep 2019 14:18:08 +0200 Subject: [PATCH] fix max_rows calculations for internal on-disk temp tables --- sql/opt_subselect.cc | 2 +- sql/sql_select.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 87458357865..80f3b242e59 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -4607,7 +4607,7 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd) share->max_rows= (ha_rows) (((share->db_type() == heap_hton) ? MY_MIN(thd->variables.tmp_memory_table_size, thd->variables.max_heap_table_size) : - thd->variables.tmp_memory_table_size) / + thd->variables.tmp_disk_table_size) / share->reclength); set_if_bigger(share->max_rows,1); // For dummy start options diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 36d9eda3383..eb1d039683d 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -18543,7 +18543,7 @@ bool Create_tmp_table::finalize(THD *thd, share->max_rows= (ha_rows) (((share->db_type() == heap_hton) ? MY_MIN(thd->variables.tmp_memory_table_size, thd->variables.max_heap_table_size) : - thd->variables.tmp_memory_table_size) / + thd->variables.tmp_disk_table_size) / share->reclength); set_if_bigger(share->max_rows,1); // For dummy start options /*