| Bug #9073 | Able to declare two handlers for same condition in same scope | ||
|---|---|---|---|
| Submitted: | 9 Mar 2005 15:26 | Modified: | 8 Apr 2005 18:23 |
| Reporter: | Disha | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server | Severity: | S3 (Non-critical) |
| Version: | 5.0.3-alpha-nt | OS: | Windows (Windows Server 2003) |
| Assigned to: | Per-Erik Martin | CPU Architecture: | Any |
[8 Apr 2005 18:17]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/23812

Description: We are able to declare two handlers within the same scope, for the same condition . How to repeat: Repro Steps : 1. Connect to the MySQL server as 'root' 2. drop procedure if exists h1// drop table if exists t1// 3. Create table t1(w char UNIQUE, x char)// INSERT INTO t1 VALUES ('a', 'b')// 4. CREATE PROCEDURE h1 () BEGIN DECLARE x1, x2, x3, x4, x5 INT DEFAULT 0; DECLARE CONDNAME1 CONDITION FOR SQLSTATE '42000'; DECLARE CONDNAME2 CONDITION FOR SQLSTATE '42000'; DECLARE CONTINUE HANDLER FOR CONDNAME1 SET x1 = 1; DECLARE CONTINUE HANDLER FOR CONDNAME1 SET x2 = 1; DECLARE EXIT HANDLER FOR CONDNAME1 SET x3 = 1; DECLARE CONTINUE HANDLER FOR CONDNAME2 SET x4 = 1; DECLARE EXIT HANDLER FOR CONDNAME2 SET x5 = 1; END;// 5. call h1()// Expected Results : User should not be allowed to create such a procedure. Exception should occur during procedure creation Actual Results : No error. Procedure can be created and executed successfully.