1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fix LP BUG#680058

Analysis:
The send_data method of the result sink class used to collect
data statistics about materialized subqueries incorrectly assumed
that duplicate rows are removed prior to calling send_data. As
a result the collected statistics was wrong, which resulted in
an incorrect maximal number of keys in the Ordered_key buffer.
  
Solution:
Try to insert each row into the materialized temp table before
collecting statistics, and if the insertion results in a duplicate
row, do not count the current row.
This commit is contained in:
unknown
2010-11-25 00:34:50 +02:00
parent ea94906c23
commit 0574bc894b
5 changed files with 45 additions and 7 deletions

View File

@ -3057,6 +3057,13 @@ bool select_materialize_with_stats::send_data(List<Item> &items)
Column_statistics *cur_col_stat= col_stat;
uint nulls_in_row= 0;
if (select_union::send_data(items))
return 1;
/* Skip duplicate rows. */
if (write_err == HA_ERR_FOUND_DUPP_KEY ||
write_err == HA_ERR_FOUND_DUPP_UNIQUE)
return 0;
++count_rows;
while ((cur_item= item_it++))
@ -3074,7 +3081,7 @@ bool select_materialize_with_stats::send_data(List<Item> &items)
if (nulls_in_row > max_nulls_in_row)
max_nulls_in_row= nulls_in_row;
return select_union::send_data(items);
return 0;
}