1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix for bug #12280 "Triggers: crash if flush tables".

We should not allow FLUSH statement to be executed inside both triggers
and stored functions.


mysql-test/r/sp-error.result:
  Updated test after replacing error, which is thrown when one uses FLUSH
  statement inside of stored function, with more specific.
  Also now we issue more general error when we barking about USE command
  in stored routines.
mysql-test/r/trigger.result:
  Added test for bug #12280 "Triggers: crash if flush tables"
mysql-test/t/sp-error.test:
  Updated test after replacing error, which is thrown when one uses FLUSH
  statement inside of stored function, with more specific.
  Also now we issue more general error when we barking about USE command
  in stored routines.
mysql-test/t/trigger.test:
  Added test for bug #12280 "Triggers: crash if flush tables"
sql/share/errmsg.txt:
  Removed ER_SP_NO_USE error. Now we use more general ER_SP_BADSTATEMENT in this
  case. Instead added error message for barking about statements which should not
  be allowed inside of stored functions or triggers.
  It is safe to do this since it is highly unprobable that someone will upgrade
  first to the new 5.0 release and then downgrade back to the old one.
sql/sql_parse.cc:
  reload_acl_and_cache():
    FLUSH TABLES and FLUSH PRIVILEGES should not be allowed if we are inside
    of stored function or trigger.
sql/sql_yacc.yy:
  We should not allow FLUSH statement inside both triggers and stored
  functions. Replaced error which is thrown in this case with more
  specific.
  Also now we issue more general ER_SP_BADSTATEMENT error when one tries
  to use USE command inside of stored routine.
This commit is contained in:
unknown
2005-08-10 10:31:32 +04:00
parent 2b41471429
commit f6fff55eb0
7 changed files with 57 additions and 9 deletions

View File

@ -334,7 +334,7 @@ begin
end|
# USE is not allowed
--error 1336
--error ER_SP_BADSTATEMENT
create procedure u()
use sptmp|
@ -885,7 +885,7 @@ create procedure bug10537()
--disable_warnings
drop function if exists bug8409|
--enable_warnings
--error ER_SP_BADSTATEMENT
--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
create function bug8409()
returns int
begin