Bug #115662 | Unexpected error and exit on unrecognized flags in flagset sysvar | ||
---|---|---|---|
Submitted: | 22 Jul 2024 8:32 | Modified: | 22 Jul 2024 8:35 |
Reporter: | Kaiwang CHen (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Options | Severity: | S4 (Feature request) |
Version: | 9.0.0, 8.4.0, 8.0.38 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | Contribution |
[22 Jul 2024 8:32]
Kaiwang CHen
[22 Jul 2024 8:35]
Kaiwang CHen
The enclosed patch is based on 9.0.0. It could be applied to previous releases by adapting error numbers. (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: flagset_9000.patch (application/octet-stream, text), 14.99 KiB.
[22 Jul 2024 8:35]
MySQL Verification Team
Hello Kaiwang, Thank you for the feature request! regards, Umesh
[30 Sep 2024 8:51]
Kaiwang CHen
postfix to flagset_9000 (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: flagset_9000_2.patch (application/octet-stream, text), 5.62 KiB.
[30 Sep 2024 14:05]
Georgi Kodinov
Thank you for your contribution! However your basic assumption is not entirely correct IMHO. I believe that the flagset values are nothing like the numeric ones. And even if they are, it's the wrong usability direction. If the user goes into the trouble of specifying a set value the more common assumption is that they want the server to understand it or refuse to accept it. Silent alteration of invalid values is a gotcha IMHO that decreases the usability. And to drive the parsing of the SQL mode value with a flag you specify as SQL mode value is even more confusing IMHO. SQL mode is not a replacement for a system variable! But I understand that this is a valid issue. The best way I can currently think of going about it is to convert the invalid mode error to a warning only if the --loose prefix is specified. We could probably also have a flag when the sysvar is defined in the code, but that would put the control in the wrong hands IMHO.