Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-21855

Setting alter_algorithm or system_versioning_asof to DEFAULT sets it to global value instead

    XMLWordPrintable

    Details

      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  |
      +-----------------+-------+
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              GeoffMontee Geoff Montee
              Reporter:
              hholzgra Hartmut Holzgraefe
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated: