Bug #18330 Partitions: crash if stored procedure and loop
Submitted: 18 Mar 2006 14:26 Modified: 20 Mar 2006 23:32
Reporter: Peter Gulutzan Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.1.8-beta-debug OS:Linux (SUSE 10.0)
Assigned to: CPU Architecture:Any

[18 Mar 2006 14:26] Peter Gulutzan
Description:
I create a partitioned table with hash partitioning.
I repeat doing so (while dropping the database),
in a loop in a stored procedure.
Crash.

How to repeat:
mysql> delimiter //
mysql> use test//
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> drop database x//
Query OK, 0 rows affected (0.02 sec)

mysql> drop procedure p//
Query OK, 0 rows affected (0.00 sec)

mysql> create procedure p () begin declare v int default 0; while v < 10 do crea                                           te database x; create table x.t (s1 int) partition by hash (s1); drop database x                                           ; set v = v + 1; end while; end//
Query OK, 0 rows affected (0.03 sec)

mysql> call p()//
ERROR 2013 (HY000): Lost connection to MySQL server during query
[20 Mar 2006 9:46] Mikael Ronström
This is most likely fixed by the same patch as is now developed for BUG #14350.
[20 Mar 2006 14:28] MySQL Verification Team
Thank you for the bug report.
[20 Mar 2006 22:28] Mikael Ronström
This bug is most likely fixed by the same patch that was applied today for
bug #17290 and bug #14350. So please re-verify it.
[20 Mar 2006 23:32] MySQL Verification Team
miguel@hegel:~/dbs/5.0> bk changes /home/miguel/dbs/mysql-5.1-new/ | head
ChangeSet@1.2192.1.2, 2006-03-20 23:55:10-05:00, pappa@c-8808e253.1238-1-64736c10.cust.bredbandsbolaget.se
  Manual merge

ChangeSet@1.2192.1.1, 2006-03-20 22:47:48-05:00, pappa@c-8808e253.1238-1-64736c10.cust.bredbandsbolaget.se
  Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.1-new
  into  c-8808e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug17754

ChangeSet@1.2186.2.2, 2006-03-20 21:46:16-05:00, pappa@c-8808e253.1238-1-64736c10.cust.bredbandsbolaget.se
  BUG#17754
  Fixed result files

miguel@hegel:~/dbs/5.0> bin/mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.1.8-beta-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> delimiter //
mysql> use test//
Database changed
mysql> drop database x//
ERROR 1008 (HY000): Can't drop database 'x'; database doesn't exist
mysql>  drop procedure p//
ERROR 1305 (42000): PROCEDURE test.p does not exist

mysql> create procedure p () begin declare v int default 0; while v < 10 do create database x; create table x.t (s1
    -> int) partition by hash (s1); drop database x                                    
    ->       ; set v = v + 1; end while; end//
Query OK, 0 rows affected (0.00 sec)

mysql> call p()//
Query OK, 0 rows affected (0.24 sec)

mysql>