Bug #23012 Lost connection when using CALL in a script
Submitted: 5 Oct 2006 13:52 Modified: 13 Dec 2006 16:29
Reporter: marc castrovinci (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.2.4 OS:Windows (XP PRO SP2)
Assigned to: Mike Lischke CPU Architecture:Any
Tags: CALL, crash, Lost connection, mysql error

[5 Oct 2006 13:52] marc castrovinci
Description:
When I run a script in the script tag using CALL and Global Variables it crashes with an error stating: 

Script line: 7	Lost connection to MySQL server during query
Script line: 9	MySQL server has gone away

I have made a very simple setup to test with and it still is an error. I don't beleive it is me. It is also happening in 1.2.3

How to repeat:
First create this simple table and two stored procs:

CREATE TABLE `tab` (
  `id` INTEGER
)
ENGINE = INNODB;

DELIMITER $$

DROP PROCEDURE IF EXISTS `test`.`a` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `a`(IN a INT)
BEGIN
  select a from dual;
  insert into tab values(a);
END $$

DELIMITER ;

DELIMITER $$

DROP PROCEDURE IF EXISTS `test`.`b` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `b`(IN b INT)
BEGIN
  select b from dual;
  insert into tab values(b);
END $$

DELIMITER ;

Put this in a script tab and execute:

USE test;

SET @a = 1;
SET @b = 2;

CALL a(@a);
CALL b(@b);
[5 Oct 2006 16:51] marc castrovinci
It has something to do with multiple call statements in the script. It works fine when there is just one script.
[6 Oct 2006 1:35] MySQL Verification Team
Thank you for the bug report.
[13 Dec 2006 16:29] Mike Lischke
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html