I have a MySQL stored procedure that runs fine and does its job quite well. Yesterday, I edited it in MySQL Workbench and introduced a spelling mistake on purpose. For example: -
Valid statement: insert into dept (dept_id, dept_name) values (1,'Development');
Statement with intentional typo: insert into dept (dept_id, dept_names /*Note plural*/) values (1,'Development');
My dept table does not contain a column called dept_names (plural) - correct column is dept_name (singular). Upon compiling the procedure, I was expecting MySQL Workbench to show an error message indicating non-existent column, but no such error occurred. The error message was shown when I executed the procedure. Coming from Oracle background, this is somewhat unusual for me. Oracle performs all schema checking (i.e. bad column names) when we Save stored procedures.
Now comes the question: What can I do to make MySQL Workbench (or even mysql server command line prompt) show any and all error messages when I save stored procedures and not wait until I run/execute/call them?
Thanks!
Additional Info 1: Just wanted to add that the "bad" INSERT statement above is wrapped within a IF statement. This caused stored procedure to continue executing without errors for many months until one fine day it entered the IF statement. Error message Unknown column 'dept_names' in 'field list' was received immediately after entering IF statement upon executing the "bad" INSERT.
Additional Info 2: Of course, runtime errors can wait until I actually run/execute the stored procedure. My "bad column" example above is not a runtime error so I would like to see the error when saving/compiling the stored procedure.
