Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3d9cddab
Commit
3d9cddab
authored
Oct 21, 2010
by
Dmitry Shulga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug#45445 - cannot execute procedures with thread_stack
set to 128k.
parent
5ea471bd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
8 deletions
+27
-8
sql/sp.cc
sql/sp.cc
+6
-0
sql/sp_head.cc
sql/sp_head.cc
+7
-4
sql/sql_parse.cc
sql/sql_parse.cc
+14
-4
No files found.
sql/sp.cc
View file @
3d9cddab
...
...
@@ -779,6 +779,9 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
int
ret
=
0
;
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
,
(
uchar
*
)
&
ret
))
return
TRUE
;
thd
->
lex
=
&
newlex
;
newlex
.
current_select
=
NULL
;
...
...
@@ -1505,6 +1508,9 @@ sp_find_routine(THD *thd, int type, sp_name *name, sp_cache **cp,
(
int
)
name
->
m_name
.
length
,
name
->
m_name
.
str
,
type
,
cache_only
));
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
,
(
uchar
*
)
&
depth
))
return
NULL
;
if
((
sp
=
sp_cache_lookup
(
cp
,
name
)))
{
ulong
level
;
...
...
sql/sp_head.cc
View file @
3d9cddab
...
...
@@ -1233,11 +1233,8 @@ sp_head::execute(THD *thd)
The same with db_load_routine() required circa 7k bytes and
14k bytes accordingly. Hence, here we book the stack with some
reasonable margin.
Reverting back to 8 * STACK_MIN_SIZE until further fix.
8 * STACK_MIN_SIZE is required on some exotic platforms.
*/
if
(
check_stack_overrun
(
thd
,
8
*
STACK_MIN_SIZE
,
(
uchar
*
)
&
old_packet
))
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
,
(
uchar
*
)
&
old_packet
))
DBUG_RETURN
(
TRUE
);
/* init per-instruction memroot */
...
...
@@ -2902,6 +2899,9 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
It's merged with the saved parent's value at the exit of this func.
*/
bool
parent_modified_non_trans_table
=
thd
->
transaction
.
stmt
.
modified_non_trans_table
;
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
,
(
uchar
*
)
&
parent_modified_non_trans_table
))
DBUG_RETURN
(
TRUE
);
thd
->
transaction
.
stmt
.
modified_non_trans_table
=
FALSE
;
DBUG_ASSERT
(
!
thd
->
derived_tables
);
DBUG_ASSERT
(
thd
->
change_list
.
is_empty
());
...
...
@@ -3057,6 +3057,9 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
DBUG_ENTER
(
"sp_instr_stmt::execute"
);
DBUG_PRINT
(
"info"
,
(
"command: %d"
,
m_lex_keeper
.
sql_command
()));
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
,
(
uchar
*
)
&
res
))
DBUG_RETURN
(
TRUE
);
query
=
thd
->
query
();
query_length
=
thd
->
query_length
();
#if defined(ENABLED_PROFILING)
...
...
sql/sql_parse.cc
View file @
3d9cddab
...
...
@@ -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
),
/*
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment