mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fix for Bug#12953 "Stored procedures: crash if OPTIMIZE TABLE in function"
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.
This commit is contained in:
@@ -758,3 +758,10 @@ execute stmt;
|
||||
ERROR 42000: FUNCTION test.bug11834_1 does not exist
|
||||
deallocate prepare stmt;
|
||||
drop function bug11834_2;
|
||||
DROP FUNCTION IF EXISTS bug12953|
|
||||
CREATE FUNCTION bug12953() RETURNS INT
|
||||
BEGIN
|
||||
OPTIMIZE TABLE t1;
|
||||
RETURN 1;
|
||||
END|
|
||||
ERROR 0A000: OPTIMIZE TABLE is not allowed in stored procedures
|
||||
|
||||
Reference in New Issue
Block a user