summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-02-02 11:08:36 +0200
committerMonty <monty@mariadb.org>2018-02-02 11:08:36 +0200
commitd69642deddf4f8d51f8c6807361576451334f1f9 (patch)
tree4b20cf71f484a31fabbfbd85f2173cc1fea5be05 /libmysqld
parent1e5e3d562b867ae83c3fbb003465e1596c748690 (diff)
downloadmariadb-git-d69642deddf4f8d51f8c6807361576451334f1f9.tar.gz
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
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/emb_qcache.cc2
-rw-r--r--libmysqld/lib_sql.cc4
-rw-r--r--libmysqld/libmysql.c7
3 files changed, 7 insertions, 6 deletions
diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc
index 429b16b2dee..5b990ddf8d0 100644
--- a/libmysqld/emb_qcache.cc
+++ b/libmysqld/emb_qcache.cc
@@ -418,7 +418,7 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
if (!data)
goto err;
- init_alloc_root(&data->alloc, 8192,0,MYF(0));
+ init_alloc_root(&data->alloc, "embedded_query_cache", 8192,0,MYF(0));
f_alloc= &data->alloc;
data->fields= src->load_int();
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 25ef6e9b18e..e715836b6ac 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -655,7 +655,7 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag)
thd->mysql= mysql;
mysql->server_version= server_version;
mysql->client_flag= client_flag;
- init_alloc_root(&mysql->field_alloc, 8192, 0, MYF(0));
+ init_alloc_root(&mysql->field_alloc, "fields", 8192, 0, MYF(0));
}
/**
@@ -972,7 +972,7 @@ int Protocol::begin_dataset()
return 1;
alloc= &data->alloc;
/* Assume rowlength < 8192 */
- init_alloc_root(alloc, 8192, 0, MYF(0));
+ init_alloc_root(alloc, "protocol", 8192, 0, MYF(0));
alloc->min_malloc= sizeof(MYSQL_ROWS);
return 0;
}
diff --git a/libmysqld/libmysql.c b/libmysqld/libmysql.c
index 767afed06b1..5aaa7e01fc9 100644
--- a/libmysqld/libmysql.c
+++ b/libmysqld/libmysql.c
@@ -1533,8 +1533,9 @@ mysql_stmt_init(MYSQL *mysql)
DBUG_RETURN(NULL);
}
- init_alloc_root(&stmt->mem_root, 2048,2048, MYF(MY_THREAD_SPECIFIC));
- init_alloc_root(&stmt->result.alloc, 4096, 4096, MYF(MY_THREAD_SPECIFIC));
+ init_alloc_root(&stmt->mem_root, "stmt", 2048,2048, MYF(MY_THREAD_SPECIFIC));
+ init_alloc_root(&stmt->result.alloc, "result", 4096, 4096,
+ MYF(MY_THREAD_SPECIFIC));
stmt->result.alloc.min_malloc= sizeof(MYSQL_ROWS);
mysql->stmts= list_add(mysql->stmts, &stmt->list);
stmt->list.data= stmt;
@@ -1545,7 +1546,7 @@ mysql_stmt_init(MYSQL *mysql)
strmov(stmt->sqlstate, not_error_sqlstate);
/* The rest of statement members was bzeroed inside malloc */
- init_alloc_root(&stmt->extension->fields_mem_root, 2048, 0,
+ init_alloc_root(&stmt->extension->fields_mem_root, "extension", 2048, 0,
MYF(MY_THREAD_SPECIFIC));
DBUG_RETURN(stmt);