diff options
author | serg@serg.mysql.com <> | 2003-02-12 11:03:41 +0100 |
---|---|---|
committer | serg@serg.mysql.com <> | 2003-02-12 11:03:41 +0100 |
commit | 9dd13a9a4ad7ccc134445d1c52643b8408092222 (patch) | |
tree | 3e1d84d3a8fe0c33b07879f20f2ff3c4ebebcd6b | |
parent | 92d6bdc1b6e21cf68091c9d8c56925dcab04d19a (diff) | |
download | mariadb-git-9dd13a9a4ad7ccc134445d1c52643b8408092222.tar.gz |
backported MERGE+MAX bugfix from 4.0
-rw-r--r-- | sql/opt_sum.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index b88cfb4e073..9385e993859 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -165,10 +165,9 @@ 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, - ref.key_length, - HA_READ_AFTER_KEY); - error=table->file->index_prev(table->record[0]) || + error = table->file->index_read(table->record[0], key_buff, + ref.key_length, + HA_READ_PREFIX_LAST) || key_cmp(table,key_buff,ref.key,ref.key_length); } if (table->key_read) |