Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 329685 - dev-db/mysql-5.1.46: The famous 'long-comment-in-procedure' bug is back
Summary: dev-db/mysql-5.1.46: The famous 'long-comment-in-procedure' bug is back
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
: 349811 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-07-24 10:48 UTC by J.Taimr
Modified: 2013-10-08 02:40 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description J.Taimr 2010-07-24 10:48:31 UTC
mysql creation of a procedure fails, if the COMMENT field in the procedure is longer than 64 chars. This bug is known for log time: http://bugs.mysql.com/bug.php?id=34197 , apparently it was solved beforem but now is present again in dev-db/mysql-5.1.46

Reproducible: Always

Steps to Reproduce:
1.try the next procedure (taken from ulogd-2.0.0_beta3):
DROP PROCEDURE IF EXISTS DELETE_CUSTOM_ONE;
delimiter $$
-- XXX be careful with SQL injections !!
CREATE PROCEDURE DELETE_CUSTOM_ONE(
                IN tname varchar(64),
                IN tjoin varchar(64),
                IN _id bigint
                )
SQL SECURITY INVOKER
COMMENT 'Delete packet in a custom table (specified at runtime) using a prepared query'
BEGIN
        SET @l_sql = CONCAT('DELETE FROM ',@tname,' WHERE ',@tname,'.',@tfield,' = ',_id);
        PREPARE delete_stmt FROM @l_sql;
        EXECUTE delete_stmt;
        DEALLOCATE PREPARE delete_stmt;
END
$$
delimiter ;
It fails with the message:
ERROR 1607 (HY000) at line 9: Cannot create stored routine `DELETE_CUSTOM_ONE`. Check warnings
2. then try the modified procedure with the line:
COMMENT 'Delete packet in a custom table using a prepared query'
instead the long COMMENT line above.
Voila - it works...
3.

Actual Results:  
If ROUTINE_COMMENT is longer than 64 chars, it fails.


Expected Results:  
Even ROUTINE_COMMENTs >64 chars should be allowed. The procedure above should NOT fail, being correct otherwise.

The ROUTINE_COMMENT field in INFORMATION_SCHEMA.ROUTINES should be rather longtext than varchar(64), as recommended in http://bugs.mysql.com/bug.php?id=34197. This type of problems is rather difficult to diagnose and it seems to me, there is no reason for 64 char/line limitation
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-08-09 05:00:40 UTC
Please retest with 5.1.49-r1.
Comment 2 Jeremy Huddleston Sequoia 2010-12-26 18:13:05 UTC
Fails with mysql-5.1.51 and similar statement from ulogd-2.0.0_beta4
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2010-12-27 17:54:58 UTC
*** Bug 349811 has been marked as a duplicate of this bug. ***
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2010-12-27 17:55:24 UTC
As per bug #349811.
Comment 5 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-10-07 03:06:36 UTC
Can you please test if this still fails with mysql-5.1.59?
Comment 6 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2012-09-10 15:45:52 UTC
I just confirmed this still applies to mysql-5.1.62-r1.
Comment 7 Brian Evans (RETIRED) gentoo-dev 2012-09-10 20:36:18 UTC
This may be fixed in the 5.5 series builds.

MariaDB 5.5.25-r1 accepted the command.
Good chance that MySQL 5.5 should too.
Comment 8 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2012-11-16 01:58:54 UTC
(In reply to comment #7)
> This may be fixed in the 5.5 series builds.
> 
> MariaDB 5.5.25-r1 accepted the command.
> Good chance that MySQL 5.5 should too.

I just hit this bug on mysql-5.5.28 and confirmed it doesn't affect mariadb-5.5.28.
Comment 9 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2013-03-18 00:09:04 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > This may be fixed in the 5.5 series builds.
> > 
> > MariaDB 5.5.25-r1 accepted the command.
> > Good chance that MySQL 5.5 should too.
> 
> I just hit this bug on mysql-5.5.28 and confirmed it doesn't affect
> mariadb-5.5.28.

I confirmed again this issue doesn't affect mariadb-5.5.30. With mysql-5.5.30 I got a corrupted mysql.proc table - I'm still trying to confirm if this is a local issue.
Comment 10 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2013-10-08 02:40:58 UTC
(In reply to Jorge Manuel B. S. Vicetto from comment #9)
> (In reply to comment #8)
> > (In reply to comment #7)
> > > This may be fixed in the 5.5 series builds.
> > > 
> > > MariaDB 5.5.25-r1 accepted the command.
> > > Good chance that MySQL 5.5 should too.
> > 
> > I just hit this bug on mysql-5.5.28 and confirmed it doesn't affect
> > mariadb-5.5.28.
> 
> I confirmed again this issue doesn't affect mariadb-5.5.30. With
> mysql-5.5.30 I got a corrupted mysql.proc table - I'm still trying to
> confirm if this is a local issue.

I've got the mysql.proc error again, this time with both mysql-5.5.32 and mariadb-5.5.32. After running mysql_upgrade, it stopped giving the error and worked for both versions.
Thus, I'm closing this bug as fixed.