diff options
author | Sinisa@sinisa.nasamreza.org <> | 2002-06-17 20:58:09 +0300 |
---|---|---|
committer | Sinisa@sinisa.nasamreza.org <> | 2002-06-17 20:58:09 +0300 |
commit | a2356e30333dda01e54920bc2cc2aac758cdc8fa (patch) | |
tree | 6d6e9fa6a893b908c345c7c3841b5e4e83e1f103 | |
parent | b44b485491fe3b9355f918dd506acada2105263e (diff) | |
download | mariadb-git-a2356e30333dda01e54920bc2cc2aac758cdc8fa.tar.gz |
My previous patch was not good at all.
This one is better, but should not be final.
Better fix is to make some changes in ha_myisammrg::index_read
This patch also reverts my previous one ...
-rw-r--r-- | myisammrg/myrg_rprev.c | 3 | ||||
-rw-r--r-- | sql/opt_sum.cc | 11 |
2 files changed, 8 insertions, 6 deletions
diff --git a/myisammrg/myrg_rprev.c b/myisammrg/myrg_rprev.c index bd7e6a1f6d2..cb56acd1a73 100644 --- a/myisammrg/myrg_rprev.c +++ b/myisammrg/myrg_rprev.c @@ -25,6 +25,9 @@ int myrg_rprev(MYRG_INFO *info, byte *buf, int inx) int err; MI_INFO *mi; + if (!info || !info->current_table) + return HA_ERR_UNSUPPORTED; + /* at first, do rprev for the table found before */ if ((err=mi_rprev(info->current_table->table,NULL,inx))) { diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index 7ffbb7ba8ea..74e7b2ef3be 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -152,12 +152,11 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) error=table->file->index_last(table->record[0]) !=0; else { - error= table->file->index_read(table->record[0], key_buff, - ref.key_length, - HA_READ_AFTER_KEY); - if (!error) - error=table->file->index_prev(table->record[0]) || - key_cmp(table,key_buff,ref.key,ref.key_length); + (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]) || + key_cmp(table,key_buff,ref.key,ref.key_length); } if (table->key_read) { |