mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-10034 Embedded server crashes on CREATE TABLE in PS protocol
don't use MY_THREAD_SPECIFIC on the client side in embedded: 1. server memory accounting does not track client side memory 2. in not embedded builds, this still *might* be useful for plugins (handlersocket, connect, etc)
This commit is contained in:
@ -1510,9 +1510,8 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef EMBEDDED_LIBRARY
|
#ifdef EMBEDDED_LIBRARY
|
||||||
#define STMT_INIT_PREALLOC(S) 0
|
#undef MY_THREAD_SPECIFIC
|
||||||
#else
|
#define MY_THREAD_SPECIFIC 0
|
||||||
#define STMT_INIT_PREALLOC(S) S
|
|
||||||
#endif /*EMBEDDED_LIBRARY*/
|
#endif /*EMBEDDED_LIBRARY*/
|
||||||
|
|
||||||
MYSQL_STMT * STDCALL
|
MYSQL_STMT * STDCALL
|
||||||
@ -1533,10 +1532,8 @@ mysql_stmt_init(MYSQL *mysql)
|
|||||||
DBUG_RETURN(NULL);
|
DBUG_RETURN(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
init_alloc_root(&stmt->mem_root, 2048, STMT_INIT_PREALLOC(2048),
|
init_alloc_root(&stmt->mem_root, 2048,2048, MYF(MY_THREAD_SPECIFIC));
|
||||||
MYF(MY_THREAD_SPECIFIC));
|
init_alloc_root(&stmt->result.alloc, 4096, 4096, 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);
|
stmt->result.alloc.min_malloc= sizeof(MYSQL_ROWS);
|
||||||
mysql->stmts= list_add(mysql->stmts, &stmt->list);
|
mysql->stmts= list_add(mysql->stmts, &stmt->list);
|
||||||
stmt->list.data= stmt;
|
stmt->list.data= stmt;
|
||||||
@ -1553,8 +1550,6 @@ mysql_stmt_init(MYSQL *mysql)
|
|||||||
DBUG_RETURN(stmt);
|
DBUG_RETURN(stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef STMT_INIT_PREALLOC
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Prepare server side statement with query.
|
Prepare server side statement with query.
|
||||||
|
Reference in New Issue
Block a user