diff options
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r-- | sql/filesort.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc index 04431a2bccc..d2e167ce7bf 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -140,7 +140,8 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort, table_map first_table_bit) { int error; - size_t memory_available= thd->variables.sortbuff_size; + DBUG_ASSERT(thd->variables.sortbuff_size <= SIZE_T_MAX); + size_t memory_available= (size_t)thd->variables.sortbuff_size; uint maxbuffer; BUFFPEK *buffpek; ha_rows num_rows= HA_POS_ERROR; @@ -1805,7 +1806,7 @@ int merge_buffers(Sort_param *param, IO_CACHE *from_file, if (flag == 0) { if (my_b_write(to_file, (uchar*) buffpek->key, - (rec_length*buffpek->mem_count))) + (size_t)(rec_length*buffpek->mem_count))) { error= 1; goto err; /* purecov: inspected */ } |