mirror of
https://github.com/MariaDB/server.git
synced 2026-04-30 20:25:32 +02:00
Merge kaamos.(none):/data/src/opt/mysql-5.0-opt
into kaamos.(none):/data/src/opt/mysql-5.1-opt sql/field.h: Auto merged sql/item_timefunc.cc: Auto merged sql/item_timefunc.h: Auto merged sql/set_var.cc: Auto merged sql/sql_base.cc: Auto merged mysql-test/r/subselect.result: Manual merge. mysql-test/t/subselect.test: Manual merge. sql/filesort.cc: Manual merge.
This commit is contained in:
commit
1040bea9ae
3 changed files with 44 additions and 8 deletions
|
|
@ -37,7 +37,8 @@ if (my_b_write((file),(uchar*) (from),param->ref_length)) \
|
|||
|
||||
static char **make_char_array(char **old_pos, register uint fields,
|
||||
uint length, myf my_flag);
|
||||
static BUFFPEK *read_buffpek_from_file(IO_CACHE *buffer_file, uint count);
|
||||
static byte *read_buffpek_from_file(IO_CACHE *buffer_file, uint count,
|
||||
byte *buf);
|
||||
static ha_rows find_all_keys(SORTPARAM *param,SQL_SELECT *select,
|
||||
uchar * *sort_keys, IO_CACHE *buffer_file,
|
||||
IO_CACHE *tempfile,IO_CACHE *indexfile);
|
||||
|
|
@ -244,9 +245,10 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!table_sort.buffpek && table_sort.buffpek_len < maxbuffer &&
|
||||
!(table_sort.buffpek=
|
||||
(uchar *) read_buffpek_from_file(&buffpek_pointers, maxbuffer)))
|
||||
if (!(table_sort.buffpek=
|
||||
(uchar *) read_buffpek_from_file(&buffpek_pointers, maxbuffer,
|
||||
(table_sort.buffpek_len < maxbuffer ?
|
||||
NULL : table_sort.buffpek))))
|
||||
goto err;
|
||||
buffpek= (BUFFPEK *) table_sort.buffpek;
|
||||
table_sort.buffpek_len= maxbuffer;
|
||||
|
|
@ -374,14 +376,16 @@ static char **make_char_array(char **old_pos, register uint fields,
|
|||
|
||||
/* Read 'count' number of buffer pointers into memory */
|
||||
|
||||
static BUFFPEK *read_buffpek_from_file(IO_CACHE *buffpek_pointers, uint count)
|
||||
static byte *read_buffpek_from_file(IO_CACHE *buffpek_pointers, uint count,
|
||||
byte *buf)
|
||||
{
|
||||
ulong length;
|
||||
BUFFPEK *tmp;
|
||||
ulong length= sizeof(BUFFPEK)*count;
|
||||
byte *tmp= buf;
|
||||
DBUG_ENTER("read_buffpek_from_file");
|
||||
if (count > UINT_MAX/sizeof(BUFFPEK))
|
||||
return 0; /* sizeof(BUFFPEK)*count will overflow */
|
||||
tmp=(BUFFPEK*) my_malloc(length=sizeof(BUFFPEK)*count, MYF(MY_WME));
|
||||
if (!tmp)
|
||||
tmp= (byte *)my_malloc(length, MYF(MY_WME));
|
||||
if (tmp)
|
||||
{
|
||||
if (reinit_io_cache(buffpek_pointers,READ_CACHE,0L,0,0) ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue