Fixed BUG#434: Stored procedure which drops itself causes crash.
Simply disallow it, just as we disallow creation of routines from within other SPs.
This commit is contained in:
parent
714c3c0942
commit
7e6bade23b
@ -372,4 +372,5 @@
|
|||||||
#define ER_WARN_VIEW_MERGE 1353
|
#define ER_WARN_VIEW_MERGE 1353
|
||||||
#define ER_WARN_VIEW_WITHOUT_KEY 1354
|
#define ER_WARN_VIEW_WITHOUT_KEY 1354
|
||||||
#define ER_VIEW_INVALID 1355
|
#define ER_VIEW_INVALID 1355
|
||||||
#define ER_ERROR_MESSAGES 356
|
#define ER_SP_NO_DROP_SP 1356
|
||||||
|
#define ER_ERROR_MESSAGES 357
|
||||||
|
@ -413,4 +413,8 @@ call bug2653_2(2, @b)|
|
|||||||
ERROR 42S22: Unknown column 'aa' in 'order clause'
|
ERROR 42S22: Unknown column 'aa' in 'order clause'
|
||||||
drop procedure bug2653_1|
|
drop procedure bug2653_1|
|
||||||
drop procedure bug2653_2|
|
drop procedure bug2653_2|
|
||||||
|
create procedure bug4344() drop procedure bug4344|
|
||||||
|
ERROR HY000: Can't drop a PROCEDURE from within another stored routine
|
||||||
|
create procedure bug4344() drop function bug4344|
|
||||||
|
ERROR HY000: Can't drop a FUNCTION from within another stored routine
|
||||||
drop table t1|
|
drop table t1|
|
||||||
|
@ -576,6 +576,15 @@ call bug2653_2(2, @b)|
|
|||||||
drop procedure bug2653_1|
|
drop procedure bug2653_1|
|
||||||
drop procedure bug2653_2|
|
drop procedure bug2653_2|
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#4344
|
||||||
|
#
|
||||||
|
--error 1356
|
||||||
|
create procedure bug4344() drop procedure bug4344|
|
||||||
|
--error 1356
|
||||||
|
create procedure bug4344() drop function bug4344|
|
||||||
|
|
||||||
|
|
||||||
drop table t1|
|
drop table t1|
|
||||||
|
|
||||||
delimiter ;|
|
delimiter ;|
|
||||||
|
@ -368,3 +368,4 @@ character-set=latin2
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -362,3 +362,4 @@ character-set=latin1
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -370,3 +370,4 @@ character-set=latin1
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -359,3 +359,4 @@ character-set=latin1
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -364,3 +364,4 @@ character-set=latin7
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -359,3 +359,4 @@ character-set=latin1
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -371,3 +371,4 @@ character-set=latin1
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -359,3 +359,4 @@ character-set=greek
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -361,3 +361,4 @@ character-set=latin2
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -359,3 +359,4 @@ character-set=latin1
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -361,3 +361,4 @@ character-set=ujis
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -359,3 +359,4 @@ character-set=euckr
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -361,3 +361,4 @@ character-set=latin1
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -361,3 +361,4 @@ character-set=latin1
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -363,3 +363,4 @@ character-set=latin2
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -360,3 +360,4 @@ character-set=latin1
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -363,3 +363,4 @@ character-set=latin2
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -361,3 +361,4 @@ character-set=koi8r
|
|||||||
"Алгоритм слияния view не может быть использован сейчас (алгоритм будет неопеределенным)"
|
"Алгоритм слияния view не может быть использован сейчас (алгоритм будет неопеределенным)"
|
||||||
"Обновляемый view не содержит ключа использованной в нем таблиц(ы)"
|
"Обновляемый view не содержит ключа использованной в нем таблиц(ы)"
|
||||||
"View '%-.64s.%-.64s' ссылается на несуществующие таблицы или слолбцы"
|
"View '%-.64s.%-.64s' ссылается на несуществующие таблицы или слолбцы"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -365,3 +365,4 @@ character-set=cp1250
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -367,3 +367,4 @@ character-set=latin2
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -361,3 +361,4 @@ character-set=latin1
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -359,3 +359,4 @@ character-set=latin1
|
|||||||
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
"View merge algorithm can't be used here for now (assumed undefined algorithm)"
|
||||||
"View being update does not have complete key of underlying table in it"
|
"View being update does not have complete key of underlying table in it"
|
||||||
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
"View '%-.64s.%-.64s' references invalid table(s) or column(s)"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -364,3 +364,4 @@ character-set=koi8u
|
|||||||
"Алгоритм зливання view не може бути використаний зараз (алгоритм буде невизначений)"
|
"Алгоритм зливання view не може бути використаний зараз (алгоритм буде невизначений)"
|
||||||
"View, що оновлюеться, не м╕стить повного ключа таблиц╕(ь), що викор╕стана в ньюому"
|
"View, що оновлюеться, не м╕стить повного ключа таблиц╕(ь), що викор╕стана в ньюому"
|
||||||
"View '%-.64s.%-.64s' посила╓тся на не╕снуюч╕ таблиц╕ або стовбц╕"
|
"View '%-.64s.%-.64s' посила╓тся на не╕снуюч╕ таблиц╕ або стовбц╕"
|
||||||
|
"Can't drop a %s from within another stored routine"
|
||||||
|
@ -5187,6 +5187,11 @@ drop:
|
|||||||
| DROP FUNCTION_SYM if_exists sp_name opt_restrict
|
| DROP FUNCTION_SYM if_exists sp_name opt_restrict
|
||||||
{
|
{
|
||||||
LEX *lex=Lex;
|
LEX *lex=Lex;
|
||||||
|
if (lex->sphead)
|
||||||
|
{
|
||||||
|
net_printf(YYTHD, ER_SP_NO_DROP_SP, "FUNCTION");
|
||||||
|
YYABORT;
|
||||||
|
}
|
||||||
lex->sql_command = SQLCOM_DROP_FUNCTION;
|
lex->sql_command = SQLCOM_DROP_FUNCTION;
|
||||||
lex->drop_if_exists= $3;
|
lex->drop_if_exists= $3;
|
||||||
lex->spname= $4;
|
lex->spname= $4;
|
||||||
@ -5194,6 +5199,11 @@ drop:
|
|||||||
| DROP PROCEDURE if_exists sp_name opt_restrict
|
| DROP PROCEDURE if_exists sp_name opt_restrict
|
||||||
{
|
{
|
||||||
LEX *lex=Lex;
|
LEX *lex=Lex;
|
||||||
|
if (lex->sphead)
|
||||||
|
{
|
||||||
|
net_printf(YYTHD, ER_SP_NO_DROP_SP, "PROCEDURE");
|
||||||
|
YYABORT;
|
||||||
|
}
|
||||||
lex->sql_command = SQLCOM_DROP_PROCEDURE;
|
lex->sql_command = SQLCOM_DROP_PROCEDURE;
|
||||||
lex->drop_if_exists= $3;
|
lex->drop_if_exists= $3;
|
||||||
lex->spname= $4;
|
lex->spname= $4;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user