Bug #16342 | SP Continue handler swith where no data | ||
---|---|---|---|
Submitted: | 10 Jan 2006 15:11 | Modified: | 12 Jan 2006 8:19 |
Reporter: | Valentin Komissarov | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.0.18 | OS: | Windows (win32) |
Assigned to: | CPU Architecture: | Any |
[10 Jan 2006 15:11]
Valentin Komissarov
[12 Jan 2006 8:19]
Valeriy Kravchuk
Thank you for a prbolem report. Bug #15231 was fixed, but the fix is not included into 5.0.18. Wait for the next release, 5.0.19, to check it. As for why NOT FOUND handler is called - it obvious requirement. SELECT INTO should return one and only one row. Let me quote the SQL 2003 Standard: "1) Let Q be the result of <query specification> S. 2) Case: a) If the cardinality of Q is greater than 1 (one), then an exception condition is raised: cardinality violation. It is implementation-dependent whether or not SQL-data values are assigned to the targets identified by the <select target list>. b) If Q is empty, then no SQL-data values are assigned to any targets identified by the <select target list>, and a completion condition is raised: no data. c) Otherwise, values in the row of Q are assigned to their corresponding targets." We have case b) here. It works the same way in Oracle, for example. So, it is not a bug, but intended and documented behaviour.