diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-06-27 20:35:26 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-06-27 20:35:26 +0200 |
commit | 658992699b204da04382142e77af042c8a33a334 (patch) | |
tree | 464bc87eae9ffb0fd1a7ba6fa11148b50a295d6b /libmysql/libmysql.c | |
parent | fe7e334f3e238368e18fc2ccb98b3357ecb1e03e (diff) | |
parent | a6087e7dc1ef3561d8189c8db15e9591d0f9b520 (diff) | |
download | mariadb-git-658992699b204da04382142e77af042c8a33a334.tar.gz |
Merge tag 'mariadb-10.0.20' into 10.1
Diffstat (limited to 'libmysql/libmysql.c')
-rw-r--r-- | libmysql/libmysql.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index caf0309710e..8af5a284b9a 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1507,6 +1507,12 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) memory */ +#ifdef EMBEDDED_LIBRARY +#define STMT_INIT_PREALLOC(S) 0 +#else +#define STMT_INIT_PREALLOC(S) S +#endif /*EMBEDDED_LIBRARY*/ + MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql) { @@ -1525,8 +1531,10 @@ 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, 2048, STMT_INIT_PREALLOC(2048), + MYF(MY_THREAD_SPECIFIC)); + init_alloc_root(&stmt->result.alloc, 4096, STMT_INIT_PREALLOC(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; @@ -1543,6 +1551,8 @@ mysql_stmt_init(MYSQL *mysql) DBUG_RETURN(stmt); } +#undef STMT_INIT_PREALLOC + /* Prepare server side statement with query. |