stored procedures - MySQL: failed to create function {functionName} -


It works on MySQL 5.0.41, but at 5.1.31 it just says "Failed to create function". I type it into the console:

  delimiter. & Lt; Press enter & gt; Set DEFINER = `` `Local Host 'function` `Ucades'' (RRRARAARAR (128)) Returns varchar (128) Chartset UTF 8 Launch DCR (1); DECLARE's VARCHAR (128); DECLARE I INT DEFAULT 1; DECLARE bool INT DEFAULT 1; DECLARE punct CHAR (17) DEFAULT '() [] {},.-_! @ :: / '; SET s = LCASE (str); When I & lt; LENGTH (ARR) start from the beginning = substring (S, I, 1); If substitution (c, wing) & gt; 0 then set boole = 1; ELSEIF bool = 1 Then if IF C & gt; = 'A' and C & lt; = 'Z' then op S = CONCAT (LEFT (S, I-1), UCASE (C), SUBSTRING (S, I + 1)); Set boole = 0; End; ELSEIF c & gt; = '0' and c & lt; = '9' then set bool = 0; end if; End; end if; Set I = I + 1; End; In the end; Returns s; End & Lt; Press enter & gt;  

I have tried to minimize it:

  delimiter. & Lt; Press enter & gt; DEFINER = `Route` @ Localhost` function` UKWARDS (SRR VENCARA (128)) Returns varchar (128) CHARSET utf8 start DECLARE VARCHAR (128); Returns s; End & Lt; Press enter & gt;  

I have used it without any definiteness, just using:

  delimiter | & Lt; Press enter & gt; Create Work `UKWARD '(SRE VARARAR (128)) Returns varchar (128) CHARSET utf8 DECLARE VARCHAR (128); Returns s; End & Lt; Press enter & gt;  

Have you recently upgraded from MySQL 5.0 to 5.1? If so, you need to run the mysql_upgrade script to update system tables. In this situation, the mysql.proc table schema has changed, which can explain your problem:

More about upgrading to 5.1:


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -