diff options
author | unknown <Sinisa@sinisa.nasamreza.org> | 2002-06-15 20:59:42 +0300 |
---|---|---|
committer | unknown <Sinisa@sinisa.nasamreza.org> | 2002-06-15 20:59:42 +0300 |
commit | e9c43803dd2ecd182a0f6e68cd6404577ffb77bb (patch) | |
tree | 9843d9f75a46bd100e12e4677570ece39501909c /sql/opt_sum.cc | |
parent | 451a5e510b2733fde176be53b45a915f85c53152 (diff) | |
download | mariadb-git-e9c43803dd2ecd182a0f6e68cd6404577ffb77bb.tar.gz |
Fixed a bug in optimiser with MERGE tables with non-unique values
with aggregating functions.
This consistently crashed Mysql
Diffstat (limited to 'sql/opt_sum.cc')
-rw-r--r-- | sql/opt_sum.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index efb4c4916a5..7ffbb7ba8ea 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -152,11 +152,12 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) error=table->file->index_last(table->record[0]) !=0; else { - (void) table->file->index_read(table->record[0], key_buff, + error= table->file->index_read(table->record[0], key_buff, ref.key_length, HA_READ_AFTER_KEY); - error=table->file->index_prev(table->record[0]) || - key_cmp(table,key_buff,ref.key,ref.key_length); + if (!error) + error=table->file->index_prev(table->record[0]) || + key_cmp(table,key_buff,ref.key,ref.key_length); } if (table->key_read) { |