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 | fc12cafff26e9372568c71b91ee73680c77605d4 (patch) | |
tree | 9843d9f75a46bd100e12e4677570ece39501909c /sql/opt_sum.cc | |
parent | 1986f3b64d0f46fffb89bcc914e1715c80259dc9 (diff) | |
download | mariadb-git-fc12cafff26e9372568c71b91ee73680c77605d4.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) { |