• unknown's avatar
    Fix for bug #12280 "Triggers: crash if flush tables". · 8ae80c39
    unknown authored
    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.
    8ae80c39
errmsg.txt 320 KB