| Bug #23032 | Handlers declared in a SP do not handle warnings generated in sub-SP | ||
|---|---|---|---|
| Submitted: | 6 Oct 2006 1:00 | Modified: | 11 Dec 2008 18:07 |
| Reporter: | Harrison Fisk | ||
| Status: | Verified | ||
| Category: | Server: SP | Severity: | S3 (Non-critical) |
| Version: | 5.0.24a | OS: | Mac OS X (Mac OS X.4) |
| Assigned to: | Davi Arnaut | Target Version: | |
| Triage: | Triaged: D3 (Medium) / R3 (Medium) / E3 (Medium) | ||
[6 Oct 2006 1:00]
Harrison Fisk
[7 Apr 2008 19:30]
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/commits/45010 ChangeSet@1.2622, 2008-04-07 14:29:44-03:00, davi@mysql.com +22 -0 Bug#23032: Handlers declared in a SP do not handle warnings generated in sub-SP The problem is that warnings generated by a statement executed inside a stored procedure should only invoke handlers in the calling context. Also, the diagnostics and condition areas must be cleaned before the execution of stored procedure statements. The solution is to prepare the enviorement before the execution of procedure statements by clearing the diagnostics area (and thus condition area). Also handlers now are only called for handling warnings generated in the calling context of the executed statement.
[15 Apr 2008 19:25]
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/commits/45444 ChangeSet@1.2643, 2008-04-15 14:25:01-03:00, davi@mysql.com +19 -0 Bug#23032: Handlers declared in a SP do not handle warnings generated in sub-SP The problem is that warnings generated by a statement executed inside a stored procedure should only invoke handlers in the calling context. Also, the diagnostics and condition areas must be cleaned before the execution of stored procedure statements. The solution is to prepare the enviorement before the execution of procedure statements by clearing the diagnostics area (and thus condition area). Also handlers now are only called for handling warnings generated in the calling context of the executed statement.
[18 Apr 2008 6:04]
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/commits/45587 ChangeSet@1.2618, 2008-04-18 01:03:47-03:00, davi@mysql.com +18 -0 Bug#23032: Handlers declared in a SP do not handle warnings generated in sub-SP The problem is that warnings generated by a statement executed inside a stored procedure should only invoke handlers in the calling context, unless the warning is generated by the last statement of the stored procedure. The solution is to prepare the environment before the execution of procedure statements and tightly control if warning were generated during the execution of the statement. Also handlers now are only called for handling warnings generated in the calling context of the executed statement, unless it's the last statement of the stored procedure. Now statements executed inside stored procedure fallow the same rules as non-sp statements with respect to effects on the message list (refer to SHOW WARNINGS manual entry for more details). Bug#36185: Incorrect precedence for warning and exception handlers The problem is that MySQL calls the handler for the first signaled condition during the execution of a stored procedure statement, meaning that if a warning is signaled first, it will search for a handler at that point and if a handler is found it won't look further for other handlers even if new warning/exception conditions occur. The solution is to look for handler only at the end of the execution of a statement. At the end, it looks first for error and not found conditions. If the execution completed successfully (no errors) but warnings were generated, it searches for a single handler in a first generated first served schema.
[18 Apr 2008 15:20]
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/commits/45606 ChangeSet@1.2618, 2008-04-18 08:39:09-03:00, davi@mysql.com +18 -0 Bug#23032: Handlers declared in a SP do not handle warnings generated in sub-SP The problem is that warnings generated by a statement executed inside a stored procedure should only invoke handlers in the calling context, unless the warning is generated by the last statement of the stored procedure. The solution is to prepare the environment before the execution of procedure statements and tightly control if warning were generated during the execution of the statement. Also handlers now are only called for handling warnings generated in the calling context of the executed statement, unless it's the last statement of the stored procedure. Now statements executed inside stored procedure fallow the same rules as non-sp statements with respect to effects on the message list (refer to SHOW WARNINGS manual entry for more details). Bug#36185: Incorrect precedence for warning and exception handlers The problem is that MySQL calls the handler for the first signaled condition during the execution of a stored procedure statement, meaning that if a warning is signaled first, it will search for a handler at that point and if a handler is found it won't look further for other handlers even if new warning/exception conditions occur. The solution is to look for handler only at the end of the execution of a statement. At the end, it looks first for error and not found conditions. If the execution completed successfully (no errors) but warnings were generated, it searches for a single handler in a first generated first served schema.
[24 Apr 2008 0:53]
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/commits/45925 ChangeSet@1.2628, 2008-04-23 19:52:42-03:00, davi@mysql.com +22 -0 Bug#23032: Handlers declared in a SP do not handle warnings generated in sub-SP The problem is that warnings generated by a statement executed inside a stored procedure should only invoke handlers in the calling context, unless the warning is generated by the last statement of the stored procedure. The solution is to prepare the environment before the execution of procedure statements and tightly control if warning were generated during the execution of the statement. Also handlers now are only called for handling warnings generated in the calling context of the executed statement, unless it's the last statement of the stored procedure. This is a incompatible change, now statements executed inside stored procedure fallow the same rules as non-sp statements with respect to effects on the message list (refer to SHOW WARNINGS manual entry for more details). Bug#36185: Incorrect precedence for warning and exception handlers The problem is that MySQL calls the handler for the first signaled condition during the execution of a stored procedure statement, meaning that if a warning is signaled first, it will search for a handler at that point and if a handler is found it won't look further for other handlers even if new warning/exception conditions occur. The solution is to look for handler only at the end of the execution of a statement. At the end, it looks first for error and not found conditions. If the execution completed successfully (no errors) but warnings were generated, it searches for a single handler in a first generated first served schema.
[27 Apr 2008 9:16]
Sveta Smirnova
Bug #36348 was marked as duplicate of this one.
