summaryrefslogtreecommitdiff
path: root/mysql-test/r/sp-error.result
diff options
context:
space:
mode:
authorunknown <anozdrin@mysql.com>2005-09-06 21:43:06 +0400
committerunknown <anozdrin@mysql.com>2005-09-06 21:43:06 +0400
commitb89205880f6ce80ccba6e5c43be7af77828b2342 (patch)
treedf64725c04d5d1a1bb409b6ae11e013c340a1d48 /mysql-test/r/sp-error.result
parent9e7a1bb2b019a1a8048bc9ef8cdf00fcc255d812 (diff)
downloadmariadb-git-b89205880f6ce80ccba6e5c43be7af77828b2342.tar.gz
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. 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.
Diffstat (limited to 'mysql-test/r/sp-error.result')
-rw-r--r--mysql-test/r/sp-error.result7
1 files changed, 7 insertions, 0 deletions
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index 61e931e146c..1a061529fb0 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -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