[MDEV-21855] Document difference between DEFAULT and 'DEFAULT' when setting alter_algorithm or system_versioning_asof Created: 2020-03-02 Updated: 2023-12-15 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Documentation, Storage Engine - InnoDB |
| Affects Version/s: | 10.3.20, 10.4.12 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Hartmut Holzgraefe | Assignee: | Joe Cotellese |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
When setting the session value of alter_algorithm to DEFAULT, it will not be set to the literal value DEFAULT, but will instead fetch whatever the current global value of the variable is. So unless the global value of the variable is also DEFAULT it is not possible to set the session value back to DEFAULT which is its default value. This can lead to rather confusing error messages on ALTER TABLE ... Same is true for system_versioning_asof where DEFAULT is also a valid literal value.
|
| Comments |
| Comment by Marko Mäkelä [ 2020-03-02 ] | ||||||||||||||||||||||||||
|
I observed something similar in | ||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2020-03-08 ] | ||||||||||||||||||||||||||
|
You can still set it to DEFAULT if you quote the value.
I don't see what else can be done about it, @@session.var= DEFAULT resetting the value to the global one is the common and documented behavior. Having DEFAULT among valid values is admittedly not a very good design as it causes ambiguity, but since it is already in the GA trees, it is not easy to get rid of, either. If the problem is indeed important, maybe we should add a synonym to it, and start deprecating DEFAULT as enum values? | ||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-03-09 ] | ||||||||||||||||||||||||||
|
elenst, I agree that we probably have to introduce a new ENUM value as an alias to the unfortunately named DEFAULT. What could be an easy-to-remember but yet distinctive replacement of the name DEFAULT? The name LEGACY might work for alter_algorithm. For system_versioning_asof, I have no idea. | ||||||||||||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2020-03-09 ] | ||||||||||||||||||||||||||
|
"You can still set it to DEFAULT if you quote the value. " That's weird ... I remember having tried yet, and it didn't work back when I filed this, but I can't reproduce it now, 'DEFAULT' and "DEFAULT" now working fine in 10.3 and 10.4. Not sure what I did wrong there last week. This also makes fixing So we can probably reduce this ones priority, maybe even turn it into a documentation issue only ... | ||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-03-16 ] | ||||||||||||||||||||||||||
|
We already had this test case in versioning.sysvars since December 2017:
We could claim that this is intentional and should simply be documented. I will add a test case for alter_algorithm, which we forgot to add in | ||||||||||||||||||||||||||
| Comment by Geoff Montee (Inactive) [ 2021-04-23 ] | ||||||||||||||||||||||||||
|
This is currently documented for alter_algorithm: https://mariadb.com/docs/reference/mdb/system-variables/alter_algorithm/#disambiguating-default-values We need similar documentation for system_versioning_asof. |