1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fixed a problem where the temp table of a materialized subquery

was not cleaned up between PS re-executions. The reason was two-fold:
- a merge with mysql-6.0 missed select_union::cleanup() that should
  have cleaned up the temp table, and
- the subclass of select_union used by materialization didn't call
  the base class cleanup() method.
This commit is contained in:
unknown
2010-07-16 14:02:15 +03:00
parent 75bba30c5a
commit 2d78ffb8d5
5 changed files with 79 additions and 9 deletions

View File

@ -2994,14 +2994,28 @@ create_result_table(THD *thd_arg, List<Item> *column_types,
if (!stat)
return TRUE;
cleanup();
reset();
table->file->extra(HA_EXTRA_WRITE_CACHE);
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
return FALSE;
}
void select_materialize_with_stats::reset()
{
memset(col_stat, 0, table->s->fields * sizeof(Column_statistics));
max_nulls_in_row= 0;
count_rows= 0;
}
void select_materialize_with_stats::cleanup()
{
reset();
select_union::cleanup();
}
/**
Override select_union::send_data to analyze each row for NULLs and to
update null_statistics before sending data to the client.