Description:
I tested this on FreeBSD 5.4, with today's BK code.
I am attaching a file to this bug report that contains the exact longprocedure.sql that I
used.
I run it like:
$ mysql test < longprocedure.sql > longprocedure.txt
ERROR 1064 (42000) at line 4109: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use near 'select co'
at line 1460
Line 4109 is:
call test.longprocedure(@value); select @value;
A tail of the longprocedure.txt shows why:
$ tail -15 longprocedure.txt
select count(*) into param1 from mysql.user;
select count(*) into param1 from mysql.user;
select co
EXTERNAL_NAME: NULL
EXTERNAL_LANGUAGE: NULL
PARAMETER_STYLE: SQL
IS_DETERMINISTIC: YES
SQL_DATA_ACCESS: CONTAINS SQL
SQL_PATH: NULL
SECURITY_TYPE: DEFINER
CREATED: 2005-06-28 17:10:13
LAST_ALTERED: 2005-06-28 17:10:13
SQL_MODE:
ROUTINE_COMMENT:
DEFINER: root@localhost
So, clearly the 'body' field is truncated. Hmmm, it's defined as a BLOB in mysql.proc.
mysql> select length(body) from mysql.proc where specific_name = 'longprocedure';
+--------------+
| length(body) |
+--------------+
| 65535 |
+--------------+
In earlier versions, the server would crash when trying to do some operations, like SHOW
CREATE PROCEDURE longprocedure. But now I just get a syntax error. It also gives a
syntax error when I try to drop it:
mysql> drop procedure longprocedure;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'select co' at
line 1460
I can delete it from mysql.proc, though.
How to repeat:
See Description and the attached file, longprocedure.sql.
Suggested fix:
I ran "alter table proc modify body longblob not null", and was then able to perform all
the operations. This is a simple fix; I don't see any reason it won't work, but there may
be some hidden problems with it.
Description: I tested this on FreeBSD 5.4, with today's BK code. I am attaching a file to this bug report that contains the exact longprocedure.sql that I used. I run it like: $ mysql test < longprocedure.sql > longprocedure.txt ERROR 1064 (42000) at line 4109: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select co' at line 1460 Line 4109 is: call test.longprocedure(@value); select @value; A tail of the longprocedure.txt shows why: $ tail -15 longprocedure.txt select count(*) into param1 from mysql.user; select count(*) into param1 from mysql.user; select co EXTERNAL_NAME: NULL EXTERNAL_LANGUAGE: NULL PARAMETER_STYLE: SQL IS_DETERMINISTIC: YES SQL_DATA_ACCESS: CONTAINS SQL SQL_PATH: NULL SECURITY_TYPE: DEFINER CREATED: 2005-06-28 17:10:13 LAST_ALTERED: 2005-06-28 17:10:13 SQL_MODE: ROUTINE_COMMENT: DEFINER: root@localhost So, clearly the 'body' field is truncated. Hmmm, it's defined as a BLOB in mysql.proc. mysql> select length(body) from mysql.proc where specific_name = 'longprocedure'; +--------------+ | length(body) | +--------------+ | 65535 | +--------------+ In earlier versions, the server would crash when trying to do some operations, like SHOW CREATE PROCEDURE longprocedure. But now I just get a syntax error. It also gives a syntax error when I try to drop it: mysql> drop procedure longprocedure; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select co' at line 1460 I can delete it from mysql.proc, though. How to repeat: See Description and the attached file, longprocedure.sql. Suggested fix: I ran "alter table proc modify body longblob not null", and was then able to perform all the operations. This is a simple fix; I don't see any reason it won't work, but there may be some hidden problems with it.