backported MERGE+MAX bugfix from 4.0

This commit is contained in:
unknown 2003-02-12 11:03:41 +01:00
parent 02132f55c2
commit cad553de49

View file

@ -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)