Description:
If DROP PROCEDURE IF EXISTS statement is run as a part of a compound statement, the
command executes successfully only if the procedure does not exist.
How to repeat:
Test Setup
1. Start a fresh client connection to a mysql server.
2. Create database say 'Test'
3. Use 'Test'
4. Create table t1( f1 char );
Repro Steps
Run the following SQL queries:
1. Delimiter //;
2. Drop procedure if exists sp1;
Create procedure sp1() select * from T1//
3. Drop procedure if exists sp1;
Create procedure sp1() select * from T1//
Expected Result
The 3rd SQL query should run successfully without any problems.
Actual Results:
mysql> Delimiter //;
mysql> Drop procedure if exists sp1;
-> Create procedure sp1() select * from T1//
Query OK, 0 rows affected, 1 warning (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
mysql> Drop procedure if exists sp1;
-> Create procedure sp1() select * from T1//
Query OK, 0 rows affected (0.00 sec)
After running the 3rd query the mysql client stops responding.
Description: If DROP PROCEDURE IF EXISTS statement is run as a part of a compound statement, the command executes successfully only if the procedure does not exist. How to repeat: Test Setup 1. Start a fresh client connection to a mysql server. 2. Create database say 'Test' 3. Use 'Test' 4. Create table t1( f1 char ); Repro Steps Run the following SQL queries: 1. Delimiter //; 2. Drop procedure if exists sp1; Create procedure sp1() select * from T1// 3. Drop procedure if exists sp1; Create procedure sp1() select * from T1// Expected Result The 3rd SQL query should run successfully without any problems. Actual Results: mysql> Delimiter //; mysql> Drop procedure if exists sp1; -> Create procedure sp1() select * from T1// Query OK, 0 rows affected, 1 warning (0.00 sec) Query OK, 0 rows affected (0.00 sec) mysql> Drop procedure if exists sp1; -> Create procedure sp1() select * from T1// Query OK, 0 rows affected (0.00 sec) After running the 3rd query the mysql client stops responding.