Bug #3843 ANALYZE TABLE inside stored procedure causes 'Packets out of order' error.
Submitted: 21 May 2004 9:53 Modified: 14 Jun 2004 17:01
Reporter: Sergey Petrunya Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0-bk OS:
Assigned to: Per-Erik Martin CPU Architecture:Any

[21 May 2004 9:53] Sergey Petrunya
Description:
Using ANALYZE TABLE inside a stored procedure causes 'Packets out of order' error message when calling the stored procedure from console client.

Additionally if one creates a .test with the same commands (see below) and runs it with mysql-test-run, the test will be reported as have passed successfully but actually the .result will show that no statements after the stored procedure call are executed.

How to repeat:
Run the following:

drop table if exists t10;
drop procedure if exists fill_t10;
create table t10 ( a int );

delimiter //
create procedure fill_t10 ()
begin
  analyze table t10;
end //
delimiter ;//

call fill_t10();

select 1+2;

drop procedure fill_t10;

And get a "Packets out of order" error.
[25 May 2004 3:30] MySQL Verification Team
I didn't get the error reported, instead:

mysql> select 1+2;
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>
mysql> drop procedure fill_t10;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    2
Current database: test

Query OK, 0 rows affected (0.47 sec)
[14 Jun 2004 17:01] Per-Erik Martin
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 bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html