Commit a2356e30 authored by Sinisa@sinisa.nasamreza.org's avatar Sinisa@sinisa.nasamreza.org
Browse files

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 ...
parent b44b4854
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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)))
  {
+5 −6
Original line number Diff line number Diff line
@@ -152,10 +152,9 @@ 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,
	    (void)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);
	  }