mirror of
https://github.com/MariaDB/server.git
synced 2026-05-06 23:25:34 +02:00
Merge mysql.com:/my/mysql-4.1 into mysql.com:/my/mysql-5.0
client/mysqltest.c: Auto merged sql/filesort.cc: Auto merged sql/item.h: Auto merged sql/item_func.cc: Auto merged sql/log_event.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_prepare.cc: Auto merged
This commit is contained in:
commit
9385323db8
13 changed files with 59 additions and 35 deletions
|
|
@ -161,8 +161,6 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
|
|||
records=table->file->estimate_number_of_rows();
|
||||
selected_records_file= 0;
|
||||
}
|
||||
if (param.rec_length == param.ref_length && records > param.max_rows)
|
||||
records=param.max_rows; /* purecov: inspected */
|
||||
|
||||
if (multi_byte_charset &&
|
||||
!(param.tmp_buffer=my_malloc(param.sort_length,MYF(MY_WME))))
|
||||
|
|
@ -192,7 +190,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
|
|||
DISK_BUFFER_SIZE, MYF(MY_WME)))
|
||||
goto err;
|
||||
|
||||
param.keys--;
|
||||
param.keys--; /* TODO: check why we do this */
|
||||
param.sort_form= table;
|
||||
param.end=(param.local_sortorder=sortorder)+s_length;
|
||||
if ((records=find_all_keys(¶m,select,sort_keys, &buffpek_pointers,
|
||||
|
|
@ -432,16 +430,6 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
|
|||
if (write_keys(param,sort_keys,idx,buffpek_pointers,tempfile))
|
||||
DBUG_RETURN(HA_POS_ERROR);
|
||||
idx=0;
|
||||
if (param->ref_length == param->rec_length &&
|
||||
my_b_tell(tempfile)/param->rec_length >= param->max_rows)
|
||||
{
|
||||
/*
|
||||
We are writing the result index file and have found all
|
||||
rows that we need. Abort the sort and return the result.
|
||||
*/
|
||||
error=HA_ERR_END_OF_FILE;
|
||||
break; /* Found enough records */
|
||||
}
|
||||
indexpos++;
|
||||
}
|
||||
make_sortkey(param,sort_keys[idx++],ref_pos);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue