Make sure your log_bin_trust_function_creator is on. On Sun, Sep 28, 2008 at 3:04 AM, Jesse <[EMAIL PROTECTED]> wrote:
> I'm trying to use existing functions from a restored database from 5.0xx to > 5.1, and get an error about the mysql.proc table is missing or corrupt. The > mysql.proc table appears to be there, and does not appear to be corrupt. I > did a grant select on mysql.proc to user, and that did not make any > difference, as it has in the past. So, I decided that I'd delete the > function from the database, and try to add it back in, and when I do, I get > an error, Failed to CREATE FUNCTION. > > The code that I'm trying to execute is as follows: > > CREATE DEFINER = 'root'@'localhost' FUNCTION `Age`(dob DATE) > RETURNS int(11) > DETERMINISTIC > CONTAINS SQL > SQL SECURITY DEFINER > COMMENT '' > BEGIN > DECLARE today DATE; > SELECT CampStartDate INTO today FROM config; > RETURN DATE_FORMAT(FROM_DAYS(TO_DAYS(today) - TO_DAYS(dob)), '%Y') + 0; > END; > > Any ideas what's going on? > > Jesse > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > > -- I'm a MySQL DBA in china. More about me just visit here: http://yueliangdao0608.cublog.cn