summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2021-10-06 12:34:54 +0300
committerSergei Petrunia <sergey@mariadb.com>2023-01-30 15:24:15 +0200
commit7d0bef6cd7be6a2764be05071b4ea78729698f6b (patch)
treef406e8ee1ac8c50a5750734d4b440ecfea48fc4d /sql/sql_select.cc
parentfc0c157aaa0b1603a321890c6c43b4b6b5e3b2e3 (diff)
downloadmariadb-git-bb-11.0-jan23-rebase-try2.tar.gz
Fixed bug in SQL_SELECT_LIMITbb-11.0-jan23-rebase-try2
We where comparing costs when we should be comparing number of rows that will be examined
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 88a3c1e12de..13131ecf7f6 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -2621,7 +2621,7 @@ int JOIN::optimize_stage2()
goto setup_subq_exit;
}
if (!(thd->variables.option_bits & OPTION_BIG_SELECTS) &&
- best_read > (double) thd->variables.max_join_size &&
+ join_record_count > (double) thd->variables.max_join_size &&
!(select_options & SELECT_DESCRIBE))
{ /* purecov: inspected */
my_message(ER_TOO_BIG_SELECT, ER_THD(thd, ER_TOO_BIG_SELECT), MYF(0));