[MDEV-22493] @@warning_count gets reset before execution of SELECT Created: 2020-05-07 Updated: 2023-04-27 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Variables |
| Affects Version/s: | 5.5, 10.1, 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.4, 10.5 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Elena Stepanova | Assignee: | Oleksandr Byelkin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | upstream | ||
| Description |
|
Note: It may well be expected behavior. However, as recent experience has shown, it is counter-intuitive, so if it works so by design, it should be explicitly documented, probably here.
The intuitive expectation here is that when the SELECT is executed, the value of @warning_count is still 1, and SELECT will return true without even executing the right part of OR. However, it doesn't happen, at the moment of execution the value of @@warning_count is already 0. Apparently, it gets reset before SELECT starts. Also reproducible on active versions of MySQL, but equally unclear from MySQL documentation whether it's expected behavior. |
| Comments |
| Comment by Sergei Golubchik [ 2020-05-07 ] |
|
if I recall correctly, @@warning_count is reset at the beginning of every statement that uses tables. If that's the case then the behavior is correct. |