Bug #4043 MySQL Crash when I make a SELECT in the Stored Procedure
Submitted: 7 Jun 2004 18:56 Modified: 8 Jun 2004 11:53
Reporter: [ name withheld ] Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:55.0.0-alpha-max-debug OS:Windows (Windows)
Assigned to: CPU Architecture:Any

[7 Jun 2004 18:56] [ name withheld ]
Description:
When I make a SELECT on any variable or parameter the MySQL crash.

This what I do.
mysql> create procedure spPrueba(id int)
    -> begin
    -> select id;
    -> end//
Query OK, 0 rows affected (0.00 sec)
mysql> call spprueba('1')//
ERROR 2013 (HY000): Lost connection to MySQL server during query

or

mysql> create procedure spPrueba()
    -> begin
    -> declare id int;
    -> set id=5;
    -> select id;
    -> end//
Query OK, 0 rows affected (0.00 sec)
mysql> call spPrueba()//
ERROR 2013 (HY000): Lost connection to MySQL server during query

And a Windows appear, in the Title says "DBUG", and in the message says "Test Signal", and on the same windows one button of "OK".

When I click the OK button, other window appear, it says in the title: "mysqld.exe - Aplication Error", and in the message says "The instruction al "0x0071f6e0" referenced al "0x00000000". The memory not be "read".

Click on OK to terminate the program
Click on CANCEL to debug the program".

When I click "OK", MySQL crash, but when I click "CANCEL" appears another windows, saying that "mysqld.exe has generated errors and will be closed by Windows. You will need to restart the program." and when I click "OK", the same, MySQL crash.

In the console I tried:
mysql> set @d=1;
Query OK, 0 rows affected (0.00 sec)

mysql> select @d;
+------+
| @d   |
+------+
| 1    |
+------+
1 row in set (0.00 sec)

And this is Ok, but if I tried in the Stored Procedure, MySQL crash.

How to repeat:
mysql> create procedure spPrueba(id int)
    -> begin
    -> select id;
    -> end//
Query OK, 0 rows affected (0.00 sec)
mysql> call spprueba('1')//
ERROR 2013 (HY000): Lost connection to MySQL server during query

or

mysql> create procedure spPrueba()
    -> begin
    -> declare id int;
    -> set id=5;
    -> select id;
    -> end//
Query OK, 0 rows affected (0.00 sec)
mysql> call spPrueba()//
ERROR 2013 (HY000): Lost connection to MySQL server during query
[7 Jun 2004 22:38] [ name withheld ]
Hi, I'm the same jijiji
Well I'm trying differents forms to make this select whitout this erros, and I concluded this
mysql> CREATE PROCEDURE prueba( OUT status INT)
    -> begin
    -> select 1 into status;
    -> end//
Query OK, 0 rows affected (0.00 sec)

mysql> call prueba(@x)//
Query OK, 0 rows affected (0.00 sec)

mysql> select @x//
+------+
| @x   |
+------+
| 1    |
+------+
1 row in set (0.00 sec)

I have read the MySQL Manual, and says that we need to use the Select .. Into, for return a value... its simple no???
[8 Jun 2004 11:53] Alexander Keremidarski
None of crashes fails for under linux with 5.0 from bk tree 
ChangeSet@1.1689, 2004-05-28 19:43:06+02:00, pem@mysql.comhem.se