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