mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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.
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user