Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6, 12.2
-
None
-
Can result in unexpected behaviour
Description
As part of the testing done in MDEV-37833, I verified boolean option consistency. In the patches being tested, a new set of option boolean options was added (FALSE/TRUE):
- static const char *bools="NO,OFF,0,YES,ON,1"; |
+ static const char *bools="NO,OFF,FALSE,0,YES,ON,TRUE,1"; |
Temp link to full patch: https://github.com/MariaDB/server/commit/824f6ebc9a22c1afd06420998eadbefeac12269c
I noticed that text based option values are not consistently recognized. For example, 1 and YES will always work even if no [single] quotes are used:
INSTALL SONAME 'ha_connect'; |
CREATE TABLE t1 ENGINE=connect MAPPED=YES AS SELECT 1; |
SHOW CREATE TABLE t1; |
DROP TABLE t1; |
Will always work, as will "YES" and 'YES' (and CREATE TABLE will maintain the used format, even if no quotes are used, except for translating double quotes to single ones).
However, the same is not valid for TRUE, FALSE, ON or OFF:
INSTALL SONAME 'ha_connect'; |
CREATE TABLE t1 ENGINE=connect MAPPED=ON AS SELECT 1; |
SHOW CREATE TABLE t1; |
DROP TABLE t1; |
Will fail:
|
CS 12.2.0 fd15fd2765b53d0c070dd01d86fb231024b8f284 (Debug, Clang 21.1.3-20250923) Build 10/11/2025 |
12.2.0-dbg>CREATE TABLE t1 ENGINE=connect MAPPED=ON AS SELECT 1;
|
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ON AS SELECT 1' at line 1
|
As will TRUE (note; this is using bb-12.2-serg, which supports TRUE already):
|
MDEV-37833 CS 12.2.0 fc5dd463df41ebc4c9aa53605323ef3be563d899 (Debug, Clang 21.1.3-20250923) Build 01/11/2025 |
12.2.0-dbg>CREATE TABLE t1 ENGINE=connect MAPPED=TRUE AS SELECT 1;
|
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'TRUE AS SELECT 1' at line 1
|
The same lines with 'ON' (any version) or 'TRUE' (in the feature tree) work fine.
In summary; what was done (likely long ago) for YES/NO should be done for ON/OFF (for all versions) and for TRUE/FALSE (12.3+) also.
Attachments
Issue Links
- relates to
-
MDEV-37833 testing of "partition attributes" changes
-
- In Progress
-