2 messages in com.mysql.lists.bugsRe: Crash Mysql 5.0 - Stored Procedure
FromSent OnAttachments
Szymon Okraska01 Feb 2004 22:06 
Sinisa Milivojevic02 Feb 2004 10:07 
Subject:Re: Crash Mysql 5.0 - Stored Procedure
From:Sinisa Milivojevic (sin@mysql.com)
Date:02/02/2004 10:07:05 AM
List:com.mysql.lists.bugs

Szymon Okraska writes:

Hi

Sorry for my english :(

Example of stored procedure:

Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 5.0.0-alpha-standard

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

mysql> DELIMITER | mysql> DROP PROCEDURE IF EXISTS crash| Query OK, 0 rows affected (0.00 sec)

mysql> CREATE PROCEDURE crash() -> BEGIN -> DROP TABLE IF EXISTS test.c1; -> CREATE TABLE test.c1 (id INT DEFAULT '0' NOT NULL); -> INSERT INTO test.c1 select 12; -> END| Query OK, 0 rows affected (0.00 sec)

mysql> DELIMITER ; mysql> call crash(); Query OK, 0 rows affected (0.01 sec)

mysql> call crash(); ERROR 2013 (HY000): Lost connection to MySQL server during query mysql>

It's happend on debian linux and windows xp;

Any sugestion ? If I use select in insert it crash server.

Hi!

Thank you for your fine report.

It truly crashes MySQL 5.0.

This is such a nice report, that I have fixed it quite fast.

Patch is already proposed that shuold fix a problem.

This is a proposed, and not yet final, patch: ===== sql/sp_head.cc 1.64 vs edited ===== *** /tmp/sp_head.cc-1.64-4485 Mon Jan 26 16:17:32 2004 --- edited/sql/sp_head.cc Mon Feb 2 19:50:42 2004 *************** *** 853,868 **** TABLE_LIST *tabs;

// We have closed all tables, get rid of pointers to them for (tabs=(TABLE_LIST *)sl->table_list.first ; tabs ; tabs= tabs->next) { tabs->table= NULL; - } - if (lex->sql_command == SQLCOM_CREATE_TABLE || - lex->sql_command == SQLCOM_INSERT_SELECT) - { // Restore sl->table_list.first - sl->table_list.first= sl->table_list_first_copy; } for (ORDER *order= (ORDER *)sl->order_list.first ; order ; --- 853,868 ---- TABLE_LIST *tabs;

// We have closed all tables, get rid of pointers to them + if (lex->sql_command == SQLCOM_CREATE_TABLE || + lex->sql_command == SQLCOM_INSERT_SELECT) + { // Restore sl->table_list.first + sl->table_list.first= sl->table_list_first_copy; + } for (tabs=(TABLE_LIST *)sl->table_list.first ; tabs ; tabs= tabs->next) { tabs->table= NULL; } for (ORDER *order= (ORDER *)sl->order_list.first ; order ;

--

Sincerely,

Want to swim with the dolphins? (April 14-16, 2004) http://www.mysql.com/uc2004/