• unknown's avatar
    Fix for Bug#12953 "Stored procedures: crash if OPTIMIZE TABLE in function" · b8920588
    unknown authored
    OPTIMIZE TABLE statement is forbidden from usage in stored procedures/functions.
    
    NOTE: OPTIMIZE TABLE statement can be useful in stored procedures. The idea is
    that the user/administrator can create a stored procedure for admin
    tasks (optimizing, backing up, etc). This procedure can be scheduled to run
    automatically (by mean of internal cron (WL#1034)). So, once we can make this
    statement work, it is worth doing it.
    
    
    mysql-test/r/sp-error.result:
      Results for the test case for Bug#12953 added.
    mysql-test/t/sp-error.test:
      Test case for Bug#12953 "Stored procedures: crash if OPTIMIZE TABLE in function" added.
    sql/sql_yacc.yy:
      Forbid "OPTIMIZE TABLE" statement from use in stored procedures/functions.
    b8920588
sql_yacc.yy 228 KB