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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
063896a6
Commit
063896a6
authored
May 31, 2005
by
pem@mysql.comhem.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Post-review fixes of BUG#9937: Crash on call to stored procedure.
parent
e496b243
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
13 deletions
+30
-13
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+1
-1
sql/item_func.cc
sql/item_func.cc
+8
-2
sql/item_subselect.cc
sql/item_subselect.cc
+1
-1
sql/mysql_priv.h
sql/mysql_priv.h
+2
-2
sql/mysqld.cc
sql/mysqld.cc
+8
-4
sql/sp_head.cc
sql/sp_head.cc
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+8
-1
sql/table.cc
sql/table.cc
+1
-1
No files found.
sql/item_cmpfunc.cc
View file @
063896a6
...
...
@@ -2321,7 +2321,7 @@ Item_cond::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
*/
and_tables_cache
=
~
(
table_map
)
0
;
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
))
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
,
buff
))
return
TRUE
;
// Fatal error flag is set!
/*
The following optimization reduces the depth of an AND-OR tree.
...
...
sql/item_func.cc
View file @
063896a6
...
...
@@ -293,11 +293,14 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
DBUG_ASSERT
(
fixed
==
0
);
Item
**
arg
,
**
arg_end
;
#ifndef EMBEDDED_LIBRARY // Avoid compiler warning
char
buff
[
STACK_BUFF_ALLOC
];
// Max argument in function
#endif
used_tables_cache
=
not_null_tables_cache
=
0
;
const_item_cache
=
1
;
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
+
STACK_BUFF_ALLOC
))
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
,
buff
))
return
TRUE
;
// Fatal error if flag is set!
if
(
arg_count
)
{
// Print purify happy
...
...
@@ -2564,9 +2567,12 @@ bool
udf_handler
::
fix_fields
(
THD
*
thd
,
TABLE_LIST
*
tables
,
Item_result_field
*
func
,
uint
arg_count
,
Item
**
arguments
)
{
#ifndef EMBEDDED_LIBRARY // Avoid compiler warning
char
buff
[
STACK_BUFF_ALLOC
];
// Max argument in function
#endif
DBUG_ENTER
(
"Item_udf_func::fix_fields"
);
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
+
STACK_BUFF_ALLOC
))
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
,
buff
))
DBUG_RETURN
(
TRUE
);
// Fatal error flag is set!
udf_func
*
tmp_udf
=
find_udf
(
u_d
->
name
.
str
,(
uint
)
u_d
->
name
.
length
,
1
);
...
...
sql/item_subselect.cc
View file @
063896a6
...
...
@@ -138,7 +138,7 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref)
DBUG_ASSERT
(
fixed
==
0
);
engine
->
set_thd
((
thd
=
thd_param
));
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
))
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
,
(
gptr
)
&
res
))
return
TRUE
;
res
=
engine
->
prepare
();
...
...
sql/mysql_priv.h
View file @
063896a6
...
...
@@ -1429,11 +1429,11 @@ inline int hexchar_to_int(char c)
#ifndef EMBEDDED_LIBRARY
extern
"C"
void
unireg_abort
(
int
exit_code
);
void
kill_delayed_threads
(
void
);
bool
check_stack_overrun
(
THD
*
thd
,
long
margin
);
bool
check_stack_overrun
(
THD
*
thd
,
long
margin
,
char
*
dummy
);
#else
#define unireg_abort(exit_code) DBUG_RETURN(exit_code)
inline
void
kill_delayed_threads
(
void
)
{}
#define check_stack_overrun(A, B) 0
#define check_stack_overrun(A, B
, C
) 0
#endif
#endif
/* MYSQL_CLIENT */
sql/mysqld.cc
View file @
063896a6
...
...
@@ -2091,8 +2091,10 @@ static void start_signal_handler(void)
if
(
!
(
opt_specialflag
&
SPECIAL_NO_PRIOR
))
my_pthread_attr_setprio
(
&
thr_attr
,
INTERRUPT_PRIOR
);
#if defined(__ia64__) || defined(__ia64)
/* Peculiar things with ia64 platforms - it seems we only have half the
stack size in reality, so we have to double it here */
/*
Peculiar things with ia64 platforms - it seems we only have half the
stack size in reality, so we have to double it here
*/
pthread_attr_setstacksize
(
&
thr_attr
,
thread_stack
*
2
);
#else
pthread_attr_setstacksize
(
&
thr_attr
,
thread_stack
);
...
...
@@ -3018,8 +3020,10 @@ int main(int argc, char **argv)
if
(
!
(
opt_specialflag
&
SPECIAL_NO_PRIOR
))
my_pthread_setprio
(
pthread_self
(),
CONNECT_PRIOR
);
#if defined(__ia64__) || defined(__ia64)
/* Peculiar things with ia64 platforms - it seems we only have half the
stack size in reality, so we have to double it here */
/*
Peculiar things with ia64 platforms - it seems we only have half the
stack size in reality, so we have to double it here
*/
pthread_attr_setstacksize
(
&
connection_attrib
,
thread_stack
*
2
);
#else
pthread_attr_setstacksize
(
&
connection_attrib
,
thread_stack
);
...
...
sql/sp_head.cc
View file @
063896a6
...
...
@@ -565,7 +565,7 @@ sp_head::execute(THD *thd)
String
old_packet
;
/* Use some extra margin for possible SP recursion and functions */
if
(
check_stack_overrun
(
thd
,
4
*
STACK_MIN_SIZE
))
if
(
check_stack_overrun
(
thd
,
4
*
STACK_MIN_SIZE
,
olddb
))
{
DBUG_RETURN
(
-
1
);
}
...
...
sql/sql_parse.cc
View file @
063896a6
...
...
@@ -4986,7 +4986,14 @@ long max_stack_used;
#endif
#ifndef EMBEDDED_LIBRARY
bool
check_stack_overrun
(
THD
*
thd
,
long
margin
)
/*
Note: The 'buf' parameter is necessary, even if it is unused here.
- fix_fields functions has a "dummy" buffer large enough for the
corresponding exec. (Thus we only have to check in fix_fields.)
- Passing to check_stack_overrun() prevents the compiler from removing it.
*/
bool
check_stack_overrun
(
THD
*
thd
,
long
margin
,
char
*
buf
__attribute__
((
unused
)))
{
long
stack_used
;
if
((
stack_used
=
used_stack
(
thd
->
thread_stack
,(
char
*
)
&
stack_used
))
>=
...
...
sql/table.cc
View file @
063896a6
...
...
@@ -1815,7 +1815,7 @@ bool st_table_list::setup_ancestor(THD *thd, Item **conds,
bool
res
=
FALSE
;
DBUG_ENTER
(
"st_table_list::setup_ancestor"
);
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
))
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
,
(
char
*
)
&
res
))
return
TRUE
;
for
(
tbl
=
ancestor
;
tbl
;
tbl
=
tbl
->
next_local
)
...
...
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