Commit 8d4d185a authored by Monty's avatar Monty

Simple optimization and removal of compiler warnings

parent 86377d07
...@@ -447,10 +447,11 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, ...@@ -447,10 +447,11 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
void filesort_free_buffers(TABLE *table, bool full) void filesort_free_buffers(TABLE *table, bool full)
{ {
DBUG_ENTER("filesort_free_buffers"); DBUG_ENTER("filesort_free_buffers");
my_free(table->sort.record_pointers); my_free(table->sort.record_pointers);
table->sort.record_pointers= NULL; table->sort.record_pointers= NULL;
if (full) if (unlikely(full))
{ {
table->sort.free_sort_buffer(); table->sort.free_sort_buffer();
my_free(table->sort.buffpek); my_free(table->sort.buffpek);
...@@ -458,10 +459,14 @@ void filesort_free_buffers(TABLE *table, bool full) ...@@ -458,10 +459,14 @@ void filesort_free_buffers(TABLE *table, bool full)
table->sort.buffpek_len= 0; table->sort.buffpek_len= 0;
} }
my_free(table->sort.addon_buf); /* addon_buf is only allocated if addon_field is set */
if (unlikely(table->sort.addon_field))
{
my_free(table->sort.addon_field); my_free(table->sort.addon_field);
my_free(table->sort.addon_buf);
table->sort.addon_buf= NULL; table->sort.addon_buf= NULL;
table->sort.addon_field= NULL; table->sort.addon_field= NULL;
}
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment