[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql
Subject:    MySQL 5.1 Function Creation
From:       "Jesse" <jc () msdlg ! com>
Date:       2008-09-27 19:04:43
Message-ID: 000301c920d3$e7098980$6901a8c0 () ANCHORMAN
[Download RAW message or body]

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/mysql?unsub=mysql-marcsub@progressive-comp.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic