mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Added name to MEM_ROOT for esier debugging
This will make it easier to how memory allocation is done when debugging with either DBUG or gdb. Will especially help when debugging stored procedures Main change is a name argument as second argument to init_alloc_root() init_sql_alloc() Other things: - Added DBUG_ENTER/EXIT to some Virtual_tmp_table functions
This commit is contained in:
@ -16890,7 +16890,8 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields,
|
||||
if (param->precomputed_group_by)
|
||||
copy_func_count+= param->sum_func_count;
|
||||
|
||||
init_sql_alloc(&own_root, TABLE_ALLOC_BLOCK_SIZE, 0, MYF(MY_THREAD_SPECIFIC));
|
||||
init_sql_alloc(&own_root, "tmp_table", TABLE_ALLOC_BLOCK_SIZE, 0,
|
||||
MYF(MY_THREAD_SPECIFIC));
|
||||
|
||||
if (!multi_alloc_root(&own_root,
|
||||
&table, sizeof(*table),
|
||||
@ -17641,18 +17642,19 @@ bool Virtual_tmp_table::init(uint field_count)
|
||||
{
|
||||
uint *blob_field;
|
||||
uchar *bitmaps;
|
||||
DBUG_ENTER("Virtual_tmp_table::init");
|
||||
if (!multi_alloc_root(in_use->mem_root,
|
||||
&s, sizeof(*s),
|
||||
&field, (field_count + 1) * sizeof(Field*),
|
||||
&blob_field, (field_count + 1) * sizeof(uint),
|
||||
&bitmaps, bitmap_buffer_size(field_count) * 6,
|
||||
NullS))
|
||||
return true;
|
||||
DBUG_RETURN(true);
|
||||
bzero(s, sizeof(*s));
|
||||
s->blob_field= blob_field;
|
||||
setup_tmp_table_column_bitmaps(this, bitmaps, field_count);
|
||||
m_alloced_field_count= field_count;
|
||||
return false;
|
||||
DBUG_RETURN(false);
|
||||
};
|
||||
|
||||
|
||||
@ -17661,17 +17663,18 @@ bool Virtual_tmp_table::add(List<Spvar_definition> &field_list)
|
||||
/* Create all fields and calculate the total length of record */
|
||||
Spvar_definition *cdef; /* column definition */
|
||||
List_iterator_fast<Spvar_definition> it(field_list);
|
||||
for ( ; (cdef= it++); )
|
||||
DBUG_ENTER("Virtual_tmp_table::add");
|
||||
while ((cdef= it++))
|
||||
{
|
||||
Field *tmp;
|
||||
if (!(tmp= cdef->make_field(s, in_use->mem_root, 0,
|
||||
(uchar*) (f_maybe_null(cdef->pack_flag) ? "" : 0),
|
||||
f_maybe_null(cdef->pack_flag) ? 1 : 0,
|
||||
&cdef->field_name)))
|
||||
return true;
|
||||
add(tmp);
|
||||
DBUG_RETURN(true);
|
||||
add(tmp);
|
||||
}
|
||||
return false;
|
||||
DBUG_RETURN(false);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user