Bug #26877 CHECK TABLE not allowed in SPs
Submitted: 6 Mar 2007 15:36 Modified: 8 Mar 2007 10:08
Reporter: Max Mether Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:5.1.17-BK, 5.1.14 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[6 Mar 2007 15:36] Max Mether
Description:
Hello folks, 

A lot of statements have been allowed to the allowed list in 5.1, but for some reason CHECK TABLE is not amongst them. 

OPTIMIZE/ANLYZE/REPAIR TABLE which are very similar statements are allowed, so it seems to be a bug. Also AFAIK OPTIMIZE TABLE implicitly checks the tables which makes it even more weird. 

How to repeat:
CREATE PROCEDURE CHECKTABLE()
CHECK TABLE City;

=> 

ERROR 1314 (0A000): CHECK is not allowed in stored procedures
[6 Mar 2007 16:27] Valeriy Kravchuk
Thank you for a bug report. Verified just as described with latest 5.1.17-BK on Linux:

openxs@suse:~/dbs/5.1> bin/mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.17-beta Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
...
| t1             |
...
+----------------+
33 rows in set (0.00 sec)

mysql> create procedure pc1() check table t1;
ERROR 1314 (0A000): CHECK is not allowed in stored procedures
mysql> create procedure pc1() optimize table t1;
Query OK, 0 rows affected (0.03 sec)
[7 Mar 2007 23:18] Konstantin Osipov
A duplicate of Bug#26570