[MDEV-11834] Hide specific warnings from SHOW WARNINGS Created: 2017-01-18 Updated: 2018-08-14 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Server |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Jean-François Gagné | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 3 |
| Labels: | None | ||
| Description |
|
Hi, in [1], I presented a use-case where one could want to "ignore" specific SQL warnings. The use-case is as follow: doing an "INSERT IGNORE" which could result in "Duplicate entries" that are not important. [1]: http://jfg-mysql.blogspot.com/2017/01/do-not-ignore-warnings-in-mysql-mariadb.html In this use-case, not looking at warnings is bad as another warning could be produced. Filtering the output of SHOW WARNINGS is not satisfactory as it needs a round-trip to the server and extra work in the application. The best way to achieve this would be to not report (hide) warnings for code 1062. Having a generic way to do this is the object of this feature request. The specific way this is implemented does not matter to me. I would be ok with an optimizer hint and/or with a session variable (and probably a corresponding global variable). In both cases, the hint and variable could specify a comma separated list of warnings numbers that should be hidden. I have a preference for the optimizer hint as this does not need a round-trip to the server but I will leave the details to the implementer. Hidden warnings should not be reported by SHOW WARNINGS, by the “warning_count” system variable, and by SHOW COUNT(*) WARNINGS. Moreover, after executing a statement, the number of warnings reported should be zero is all warnings produced are hidden. If we hide warnings, we might also want a way to show them. Maybe a SHOW ALL WARNINGS, a “all_warning_count” system variable, and a SHOW COUNT(*) ALL WARNINGS could also be implemented. For SHOW ALL WARNINGS, if the number of warnings produced is higher than max_error_count, we probably want to drop the warnings that are hidden. Many thanks, JFG |
| Comments |
| Comment by Jean-François Gagné [ 2017-01-18 ] |
|
Upstream Bug#84557: http://bugs.mysql.com/bug.php?id=84557 |
| Comment by Sergei Golubchik [ 2017-07-07 ] |
|
Assorted thoughts:
|