Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3.20, 10.4.12
-
None
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.
MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm';
|
+-----------------+---------+
|
| Variable_name | Value |
|
+-----------------+---------+
|
| alter_algorithm | DEFAULT |
|
+-----------------+---------+
|
|
MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'alter_algorithm';
|
+-----------------+---------+
|
| Variable_name | Value |
|
+-----------------+---------+
|
| alter_algorithm | DEFAULT |
|
+-----------------+---------+
|
|
MariaDB [(none)]> SET GLOBAL alter_algorithm=COPY;
|
|
MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm';
|
+-----------------+-------+
|
| Variable_name | Value |
|
+-----------------+-------+
|
| alter_algorithm | COPY |
|
+-----------------+-------+
|
|
MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'alter_algorithm';
|
+-----------------+---------+
|
| Variable_name | Value |
|
+-----------------+---------+
|
| alter_algorithm | DEFAULT |
|
+-----------------+---------+
|
|
MariaDB [(none)]> SET SESSION alter_algorithm=DEFAULT;
|
|
MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm';
|
+-----------------+-------+
|
| Variable_name | Value |
|
+-----------------+-------+
|
| alter_algorithm | COPY |
|
+-----------------+-------+
|
|
MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'alter_algorithm';
|
+-----------------+-------+
|
| Variable_name | Value |
|
+-----------------+-------+
|
| alter_algorithm | COPY |
|
+-----------------+-------+
|
|
MariaDB [test]> SET SESSION alter_algorithm='DEFAULT';
|
Query OK, 0 rows affected (0.000 sec)
|
|
MariaDB [test]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm';
|
+-----------------+-------+
|
| Variable_name | Value |
|
+-----------------+-------+
|
| alter_algorithm | COPY |
|
+-----------------+-------+
|
1 row in set (0.002 sec)
|
|
MariaDB [test]> SHOW SESSION VARIABLES LIKE 'alter_algorithm';
|
+-----------------+---------+
|
| Variable_name | Value |
|
+-----------------+---------+
|
| alter_algorithm | DEFAULT |
|
+-----------------+---------+
|
1 row in set (0.002 sec)
|
|
Attachments
Issue Links
- relates to
-
MDEV-13134 Introduce ALTER TABLE attributes ALGORITHM=NOCOPY and ALGORITHM=INSTANT
-
- Closed
-
-
MDEV-16288 ALTER TABLE…ALGORITHM=DEFAULT does not override alter_algorithm
-
- Closed
-
-
MDEV-21213 mysql_upgrade / mariadb-upgrade error
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue relates to |
Link |
This issue relates to |
Link |
This issue relates to |
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 ... {noformat} MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm'; +-----------------+---------+ | Variable_name | Value | +-----------------+---------+ | alter_algorithm | DEFAULT | +-----------------+---------+ MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'alter_algorithm'; +-----------------+---------+ | Variable_name | Value | +-----------------+---------+ | alter_algorithm | DEFAULT | +-----------------+---------+ MariaDB [(none)]> SET GLOBAL alter_algorithm=COPY; MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | alter_algorithm | COPY | +-----------------+-------+ MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'alter_algorithm'; +-----------------+---------+ | Variable_name | Value | +-----------------+---------+ | alter_algorithm | DEFAULT | +-----------------+---------+ MariaDB [(none)]> SET SESSION alter_algorithm=DEFAULT; MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | alter_algorithm | COPY | +-----------------+-------+ MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'alter_algorithm'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | alter_algorithm | COPY | +-----------------+-------+ {noformat} |
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. {noformat} MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm'; +-----------------+---------+ | Variable_name | Value | +-----------------+---------+ | alter_algorithm | DEFAULT | +-----------------+---------+ MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'alter_algorithm'; +-----------------+---------+ | Variable_name | Value | +-----------------+---------+ | alter_algorithm | DEFAULT | +-----------------+---------+ MariaDB [(none)]> SET GLOBAL alter_algorithm=COPY; MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | alter_algorithm | COPY | +-----------------+-------+ MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'alter_algorithm'; +-----------------+---------+ | Variable_name | Value | +-----------------+---------+ | alter_algorithm | DEFAULT | +-----------------+---------+ MariaDB [(none)]> SET SESSION alter_algorithm=DEFAULT; MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | alter_algorithm | COPY | +-----------------+-------+ MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'alter_algorithm'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | alter_algorithm | COPY | +-----------------+-------+ {noformat} |
Summary | Setting alter_algorithm to DEFAULT sets it to global value instead | Setting alter_algorithm or system_versioning_asof to DEFAULT sets it to global value instead |
Component/s | Documentation [ 10903 ] | |
Component/s | Storage Engine - InnoDB [ 10129 ] |
Assignee | Geoff Montee [ geoffmontee ] |
Fix Version/s | N/A [ 14700 ] |
Summary | Setting alter_algorithm or system_versioning_asof to DEFAULT sets it to global value instead | Document difference between DEFAULT and 'DEFAULT' when setting alter_algorithm or system_versioning_asof |
Epic Link | MENT-51 [ 75581 ] |
Link | This issue is part of MENT-51 [ MENT-51 ] |
Epic Link | MENT-51 [ 75581 ] |
Workflow | MariaDB v3 [ 104472 ] | MariaDB v4 [ 141815 ] |
Assignee | Geoff Montee [ geoffmontee ] | Joe Cotellese [ JIRAUSER54006 ] |
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. {noformat} MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm'; +-----------------+---------+ | Variable_name | Value | +-----------------+---------+ | alter_algorithm | DEFAULT | +-----------------+---------+ MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'alter_algorithm'; +-----------------+---------+ | Variable_name | Value | +-----------------+---------+ | alter_algorithm | DEFAULT | +-----------------+---------+ MariaDB [(none)]> SET GLOBAL alter_algorithm=COPY; MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | alter_algorithm | COPY | +-----------------+-------+ MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'alter_algorithm'; +-----------------+---------+ | Variable_name | Value | +-----------------+---------+ | alter_algorithm | DEFAULT | +-----------------+---------+ MariaDB [(none)]> SET SESSION alter_algorithm=DEFAULT; MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | alter_algorithm | COPY | +-----------------+-------+ MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'alter_algorithm'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | alter_algorithm | COPY | +-----------------+-------+ {noformat} |
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. {noformat} MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm'; +-----------------+---------+ | Variable_name | Value | +-----------------+---------+ | alter_algorithm | DEFAULT | +-----------------+---------+ MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'alter_algorithm'; +-----------------+---------+ | Variable_name | Value | +-----------------+---------+ | alter_algorithm | DEFAULT | +-----------------+---------+ MariaDB [(none)]> SET GLOBAL alter_algorithm=COPY; MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | alter_algorithm | COPY | +-----------------+-------+ MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'alter_algorithm'; +-----------------+---------+ | Variable_name | Value | +-----------------+---------+ | alter_algorithm | DEFAULT | +-----------------+---------+ MariaDB [(none)]> SET SESSION alter_algorithm=DEFAULT; MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | alter_algorithm | COPY | +-----------------+-------+ MariaDB [(none)]> SHOW SESSION VARIABLES LIKE 'alter_algorithm'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | alter_algorithm | COPY | +-----------------+-------+ MariaDB [test]> SET SESSION alter_algorithm='DEFAULT'; Query OK, 0 rows affected (0.000 sec) MariaDB [test]> SHOW GLOBAL VARIABLES LIKE 'alter_algorithm'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | alter_algorithm | COPY | +-----------------+-------+ 1 row in set (0.002 sec) MariaDB [test]> SHOW SESSION VARIABLES LIKE 'alter_algorithm'; +-----------------+---------+ | Variable_name | Value | +-----------------+---------+ | alter_algorithm | DEFAULT | +-----------------+---------+ 1 row in set (0.002 sec) {noformat} |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Link | This issue is part of MENT-51 [ MENT-51 ] |
I observed something similar in
MDEV-16288.