This is weird. I'm quite puzzled, and I'm hoping someone's encountered this before and has a solution.
I'm moving a database, and trying to load procedures/functions from an OS command line (in a script - we have tons). Here's the syntax I'm using:
/usr/local/mysql/bin/mysql --user=<myuser> --password=<mypw> --host=<host> --port=<port> --database=<db> < sp_myproc.sql
(run in the directory where the file resides)
I created this example file for this post, but shockingly, IT loads. I've also added some dumb statements to try and identify if it's content in ours that's preventing the load):
DELIMITER $$
DROP PROCEDURE IF EXISTS `sp_myproc`;
$$
CREATE PROCEDURE `sp_myproc`
(
IN p_comment VARCHAR(50)
)
READS SQL DATA
BEGIN
/*
May contain C-style comments
*/
# May also contain has comments
SET p_comment = 'processed';
IF 1=2 THEN
SET p_comment = 'whoa...';
END IF;
SELECT p_comment;
END;
$$
NONE of the procedures in production ever load. mysql displays no errors (or even comments or warnings when --verbose or --show_warnings are specified). All procedures have been created with Workbench.
Is there a size limit for loading procedures? Could this be character-set related?
Any ideas what could be causing procedures not to load?
PS. FWIW I'm running OSX Lion and mysql 5.5.19 locally with a 5.5.8 target database in Amazon RDS, but since my test works fine, I don't think this is the issue.