mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
Fixed bug#45445 - cannot execute procedures with thread_stack
set to 128k.
This commit is contained in:
@@ -5118,10 +5118,17 @@ bool check_stack_overrun(THD *thd, long margin,
|
||||
if ((stack_used=used_stack(thd->thread_stack,(char*) &stack_used)) >=
|
||||
(long) (my_thread_stack_size - margin))
|
||||
{
|
||||
char ebuff[MYSQL_ERRMSG_SIZE];
|
||||
my_snprintf(ebuff, sizeof(ebuff), ER(ER_STACK_OVERRUN_NEED_MORE),
|
||||
stack_used, my_thread_stack_size, margin);
|
||||
my_message(ER_STACK_OVERRUN_NEED_MORE, ebuff, MYF(ME_FATALERROR));
|
||||
/*
|
||||
Do not use stack for the message buffer to ensure correct
|
||||
behaviour in cases we have close to no stack left.
|
||||
*/
|
||||
char* ebuff= new char[MYSQL_ERRMSG_SIZE];
|
||||
if (ebuff) {
|
||||
my_snprintf(ebuff, MYSQL_ERRMSG_SIZE, ER(ER_STACK_OVERRUN_NEED_MORE),
|
||||
stack_used, my_thread_stack_size, margin);
|
||||
my_message(ER_STACK_OVERRUN_NEED_MORE, ebuff, MYF(ME_FATALERROR));
|
||||
delete [] ebuff;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#ifndef DBUG_OFF
|
||||
@@ -7210,6 +7217,9 @@ bool parse_sql(THD *thd,
|
||||
|
||||
Object_creation_ctx *backup_ctx= NULL;
|
||||
|
||||
if (check_stack_overrun(thd, 2 * STACK_MIN_SIZE, (uchar*)&backup_ctx))
|
||||
return TRUE;
|
||||
|
||||
if (creation_ctx)
|
||||
backup_ctx= creation_ctx->set_n_backup(thd);
|
||||
|
||||
|
Reference in New Issue
Block a user