diff options
author | monty@mysql.com <> | 2003-12-21 19:39:32 +0200 |
---|---|---|
committer | monty@mysql.com <> | 2003-12-21 19:39:32 +0200 |
commit | 0279dc42342b662b935838dea177d07dc775f6db (patch) | |
tree | 82780d2f52e09f3ef112e35fc6f6b3e1dadc3a56 /sql/filesort.cc | |
parent | 734870d0ce43d21457939f93358a5a95e395b97c (diff) | |
download | mariadb-git-0279dc42342b662b935838dea177d07dc775f6db.tar.gz |
Portability fixes found during 5.0 test compilation
Fixed bug in ORDER BY on a small column (Bug #2147)
Fixed error from pthread_mutex_destroy() when one had wrong errmsg file
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r-- | sql/filesort.cc | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc index 720c059a70b..b69aaf44e46 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -151,8 +151,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)))) @@ -182,7 +180,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, @@ -408,16 +406,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); |