Bug #3730 calling stored procedure with insert causes crash
Submitted: 12 May 2004 19:43 Modified: 15 May 2004 2:41
Reporter: Luis Bernardo Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.0-alpha-nt OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[12 May 2004 19:43] Luis Bernardo
Description:
I am not sure whether this is a bug or wrong syntax... I couldn't find an explanation although there are similar bugs. When I call the stored procedure described below the server crashes.

How to repeat:
mysql> \s
--------------
mysql5  Ver 14.3 Distrib 5.0.0-alpha, for Win95/Win98 (i32)

Connection id:          7
SSL:                    Not in use
Using delimiter:        ;
Server version:         5.0.0-alpha-nt
Protocol version:       10
Connection:             localhost via TCP/IP
Client characterset:    latin1_swedish_ci
Server characterset:    latin1_swedish_ci
TCP port:               3308
--------------
mysql> use mydb;
Database changed
mysql> desc users;
+-----------+-------------+------+-----+---------+-------+
| Field     | Type        | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| email     | varchar(50) |      | PRI |         |       |
| password  | varchar(10) |      |     |         |       |
| firstName | varchar(20) |      |     |         |       |
| lastName  | varchar(20) |      |     |         |       |
+-----------+-------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
mysql> delimiter //
mysql> create procedure adduser (email varchar(50), pwd varchar(10), fname varchar(20), lname varchar(20))
    -> begin
    -> insert into mydb.users(email, password, firstName, lastName) values(email, pwd, fname, lname);
    -> end
    -> //
Query OK, 0 rows affected (0.04 sec)

mysql> delimiter ;
mysql> call adduser('bernardo@example.com', 'bernardo', 'Luis', 'Bernardo');
ERROR 2013 (HY000): Lost connection to MySQL server during query
[15 May 2004 2:41] MySQL Verification Team
Thank you for the bug report. I tested this issue with a server
5.0.1 and the crash reported was already fixed and will added
in the next release.

mysql> call adduser('bernardo@example.com', 'bernardo', 'Luis', 'Bernardo')|
Query OK, 1 row affected (0.03 sec)

mysql> select * from users|
+----------------------+----------+-----------+----------+
| email                | password | firstName | lastName |
+----------------------+----------+-----------+----------+
| bernardo@example.com | bernardo | Luis      | Bernardo |
+----------------------+----------+-----------+----------+
1 row in set (0.02 sec)

mysql> select version()|
+-----------------+
| version()       |
+-----------------+
| 5.0.1-alpha-max |
+-----------------+
1 row in set (0.00 sec)