summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorsergefp@mysql.com <>2007-07-31 15:19:06 +0400
committersergefp@mysql.com <>2007-07-31 15:19:06 +0400
commitc37f9b9e7948f84d2d3aa4f9f6b38d4b2ca4b903 (patch)
tree60a41568ca63538bab34c0c18863aa163cba4323 /sql/sql_select.cc
parentb38206978dd29149bf414a46b25571633ed778bc (diff)
downloadmariadb-git-c37f9b9e7948f84d2d3aa4f9f6b38d4b2ca4b903.tar.gz
BUG#29582: huge memory consumption with union, subselect, joins:
- Don't call mysql_select() several times for the select that enumerates a temporary table with the results of the UNION. Making this call for every subquery execution caused O(#enumerated-rows-in-the-outer-query) memory allocations. - Instead, call join->reinit() and join->exec(), and = disable constant table detection for such joins, = provide special handling for table-less constant subqueries.
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 c62a19b2752..ebc48c2967c 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -2416,7 +2416,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
if ((table->s->system || table->file->records <= 1) && ! s->dependent &&
!(table->file->table_flags() & HA_NOT_EXACT_COUNT) &&
- !table->fulltext_searched)
+ !table->fulltext_searched && !join->no_const_tables)
{
set_position(join,const_count++,s,(KEYUSE*) 0);
}