[MDEV-32931] SESSION_TRACK_WARNINGS: Send warnings via session tracking Created: 2023-12-02 Updated: 2024-01-15 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Protocol |
| Fix Version/s: | 11.6 |
| Type: | New Feature | Priority: | Major |
| Reporter: | Georg Richter | Assignee: | Ralf Gebhardt |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Currently it is only possible to retrieve warnings by checking the warning count and retrieve the warnings afterwards via SHOW WARNINGS after processing all result sets. This method has several flaws, since it is not always possible to retrieve all warnings, e.g. when calling a stored procedure or when executing multi (semicolon separated) statements:
A better approach would be to send warnings (if requested by client) via session tracking as part of the OK packet for each statement. If the client is interested in warnings, it will set the capability CLIENT_SESSION_TRACK and the new variable @@session_track_warnings:
If one or more warnings occur, the server sends back warnings within the OK packet:
If *@@session_track_warnings@@ was set to 0 (OFF), warnings can be still retrieved via SHOW WARNINGS. |
| Comments |
| Comment by Sergei Golubchik [ 2023-12-04 ] |
|
I don't think we should do -1, it's counterintuitive. Just "number of warnings to send" is enough, 0 naturally disables the feature, any other value — enables it. |
| Comment by Georg Richter [ 2023-12-07 ] |
|
Agreed - description updated |