Bug #10618 Lost connection to MySQL Server if used 'EXECUTE stmt_name'.
Submitted: 13 May 2005 10:53 Modified: 20 May 2005 16:00
Reporter: Disha Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.5-beta pre-release OS:Windows (Windows Server 2003)
Assigned to: Assigned Account CPU Architecture:Any

[13 May 2005 10:53] Disha
Description:
Create a procedure and use the syntax 
	PREPARE stmt_name FROM preparable_stmt;
	EXECUTE stmt_name [USING @var_name [, @var_name] ...];
After executing the procedure, if any query is executed then the connection losts.

How to repeat:
1. delimiter //
2. create database test//
3. use test
4. drop table if exists t1//
5. create table t1 (f1 int)//
6. insert into t1 values (10)//

7. Drop procedure if exists sp1//
8. CREATE PROCEDURE sp1()
    BEGIN
	SET @QueryString = 'SELECT * FROM t1';
	SELECT @QueryString;
	PREPARE FinalQuery FROM @QueryString;
	EXECUTE FinalQuery;
    END//
9. CALL sp1 ()//
10. show tables//
11. Execution of step (10) fails with an error message as,
	ERROR 2013 (HY000): Lost connection to MySQL server during query

Expected Result: MySQL Server connection should not losts.

Actual Result  : MySQL Server connection losts with an error message as,
	ERROR 2013 (HY000): Lost connection to MySQL server during query
[13 May 2005 11:27] MySQL Verification Team
The Windows server shows the error:
mysql>  show tables//
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>  show tables//

The Linux server an addtional info:

mysql> show tables//
Packets out of order (Found: 11, expected 1)
ERROR 2013 (HY000): Lost connection to MySQL server during query
[20 May 2005 16:00] Per-Erik Martin
This is a duplicate of BUG#7115.