Skip to content

Commit 217fc12

Browse files
author
Alexander Barkov
committed
Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3
2 parents d6ed077 + 28d4cf0 commit 217fc12

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+483
-205
lines changed

client/completion_hash.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ int completion_hash_init(HashTable *ht, uint nSize)
4949
ht->initialized = 0;
5050
return FAILURE;
5151
}
52-
init_alloc_root(&ht->mem_root, 8192, 0, MYF(0));
52+
init_alloc_root(&ht->mem_root, "completion_hash", 8192, 0, MYF(0));
5353
ht->pHashFunction = hashpjw;
5454
ht->nTableSize = nSize;
5555
ht->initialized = 1;

client/mysql.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ int main(int argc,char *argv[])
12051205
}
12061206
glob_buffer.realloc(512);
12071207
completion_hash_init(&ht, 128);
1208-
init_alloc_root(&hash_mem_root, 16384, 0, MYF(0));
1208+
init_alloc_root(&hash_mem_root, "hash", 16384, 0, MYF(0));
12091209
if (sql_connect(current_host,current_db,current_user,opt_password,
12101210
opt_silent))
12111211
{

client/mysqldump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4980,7 +4980,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
49804980
if (init_dumping(db, init_dumping_tables))
49814981
DBUG_RETURN(1);
49824982

4983-
init_alloc_root(&glob_root, 8192, 0, MYF(0));
4983+
init_alloc_root(&glob_root, "glob_root", 8192, 0, MYF(0));
49844984
if (!(dump_tables= pos= (char**) alloc_root(&glob_root,
49854985
tables * sizeof(char *))))
49864986
die(EX_EOM, "alloc_root failure.");

client/mysqltest.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9146,7 +9146,7 @@ int main(int argc, char **argv)
91469146
#endif
91479147

91489148
init_dynamic_string(&ds_res, "", 2048, 2048);
9149-
init_alloc_root(&require_file_root, 1024, 1024, MYF(0));
9149+
init_alloc_root(&require_file_root, "require_file", 1024, 1024, MYF(0));
91509150

91519151
parse_args(argc, argv);
91529152

include/my_alloc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ typedef struct st_mem_root
5252
unsigned int first_block_usage;
5353

5454
void (*error_handler)(void);
55+
const char *name;
5556
} MEM_ROOT;
5657

5758
#ifdef __cplusplus

include/my_sys.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,9 @@ extern void my_free_lock(void *ptr);
893893
#define alloc_root_inited(A) ((A)->min_malloc != 0)
894894
#define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8)
895895
#define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; (A)->min_malloc=0;} while(0)
896-
extern void init_alloc_root(MEM_ROOT *mem_root, size_t block_size,
897-
size_t pre_alloc_size, myf my_flags);
896+
extern void init_alloc_root(MEM_ROOT *mem_root, const char *name,
897+
size_t block_size, size_t pre_alloc_size,
898+
myf my_flags);
898899
extern void *alloc_root(MEM_ROOT *mem_root, size_t Size);
899900
extern void *multi_alloc_root(MEM_ROOT *mem_root, ...);
900901
extern void free_root(MEM_ROOT *root, myf MyFLAGS);

include/mysql.h.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@
242242
unsigned int block_num;
243243
unsigned int first_block_usage;
244244
void (*error_handler)(void);
245+
const char *name;
245246
} MEM_ROOT;
246247
typedef struct st_typelib {
247248
unsigned int count;

libmysqld/emb_qcache.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
418418

419419
if (!data)
420420
goto err;
421-
init_alloc_root(&data->alloc, 8192,0,MYF(0));
421+
init_alloc_root(&data->alloc, "embedded_query_cache", 8192,0,MYF(0));
422422
f_alloc= &data->alloc;
423423

424424
data->fields= src->load_int();

libmysqld/lib_sql.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag)
655655
thd->mysql= mysql;
656656
mysql->server_version= server_version;
657657
mysql->client_flag= client_flag;
658-
init_alloc_root(&mysql->field_alloc, 8192, 0, MYF(0));
658+
init_alloc_root(&mysql->field_alloc, "fields", 8192, 0, MYF(0));
659659
}
660660

661661
/**
@@ -971,7 +971,7 @@ int Protocol::begin_dataset()
971971
return 1;
972972
alloc= &data->alloc;
973973
/* Assume rowlength < 8192 */
974-
init_alloc_root(alloc, 8192, 0, MYF(0));
974+
init_alloc_root(alloc, "protocol", 8192, 0, MYF(0));
975975
alloc->min_malloc= sizeof(MYSQL_ROWS);
976976
return 0;
977977
}

libmysqld/libmysql.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,8 +1533,9 @@ mysql_stmt_init(MYSQL *mysql)
15331533
DBUG_RETURN(NULL);
15341534
}
15351535

1536-
init_alloc_root(&stmt->mem_root, 2048,2048, MYF(MY_THREAD_SPECIFIC));
1537-
init_alloc_root(&stmt->result.alloc, 4096, 4096, MYF(MY_THREAD_SPECIFIC));
1536+
init_alloc_root(&stmt->mem_root, "stmt", 2048,2048, MYF(MY_THREAD_SPECIFIC));
1537+
init_alloc_root(&stmt->result.alloc, "result", 4096, 4096,
1538+
MYF(MY_THREAD_SPECIFIC));
15381539
stmt->result.alloc.min_malloc= sizeof(MYSQL_ROWS);
15391540
mysql->stmts= list_add(mysql->stmts, &stmt->list);
15401541
stmt->list.data= stmt;
@@ -1545,7 +1546,7 @@ mysql_stmt_init(MYSQL *mysql)
15451546
strmov(stmt->sqlstate, not_error_sqlstate);
15461547
/* The rest of statement members was bzeroed inside malloc */
15471548

1548-
init_alloc_root(&stmt->extension->fields_mem_root, 2048, 0,
1549+
init_alloc_root(&stmt->extension->fields_mem_root, "extension", 2048, 0,
15491550
MYF(MY_THREAD_SPECIFIC));
15501551

15511552
DBUG_RETURN(stmt);

0 commit comments

Comments
 (0)