Bug #70052 Procedure gets created on a Non existing Table
Submitted: 15 Aug 2013 15:04 Modified: 16 Aug 2013 23:45
Reporter: pranav amin Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:5.5 OS:Linux ( x86_64 x86_64 GNU/Linux)
Assigned to: CPU Architecture:Any

[15 Aug 2013 15:04] pranav amin
Mysql successfully creates a PROCEDURE even though the PROCEDURE refers to a NON EXISTING TABLE. Shouldn't it complain that the TABLE DOES NOT EXISTS?
I get the exception ONLY WHEN I RUN THE CALL PROCEDURE. This is a risk, since TYPO will RESULT IN MAJOR PROBLEMS.

mysql> create procedure pppp () begin select * from thistabledoesnotexists; end;//
create procedure pppp () begin select * from thistabledoesnotexists; end; /*ERROR DOESN’T HAPPEN HERE, !!!*/

Query OK, 0 rows affected (0.00 sec)

mysql> call pppp()
    -> //
call pppp()

ERROR 1146 (42S02): Table 'test_schema.thistabledoesnotexists' doesn't exist /*ERROR HAPPENS HERE*/

How to repeat:
Just create a procedure with any non existing table or even if you have an undeclared variable it will still CREATE THE PROCEDURE. This doesn't make sense.
[15 Aug 2013 20:46] Shane Bester
A missing table is a runtime error not something that should be caught during parsing.  I think this is not a bug at all.
[16 Aug 2013 23:45] Miguel Solorzano
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php