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

Duplicate warnings ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED upon on ALTER TABLE

    XMLWordPrintable

    Details

      Description

      CREATE TABLE t1 (a TIMESTAMP(6), b TIMESTAMP AS (a) VIRTUAL);
      ALTER TABLE t1 ADD INDEX(b);
      

      10.4 542d769e

      MariaDB [test]> show warnings;
      +---------+------+--------------------------------------------------------------------------------------+
      | Level   | Code | Message                                                                              |
      +---------+------+--------------------------------------------------------------------------------------+
      | Warning | 1901 | Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `b` |
      | Warning | 1105 | Expression depends on the @@sql_mode value TIME_ROUND_FRACTIONAL                     |
      | Warning | 1901 | Function or expression '`a`' cannot be used in the GENERATED ALWAYS AS clause of `b` |
      | Warning | 1105 | Expression depends on the @@sql_mode value TIME_ROUND_FRACTIONAL                     |
      +---------+------+--------------------------------------------------------------------------------------+
      4 rows in set (0.000 sec)
      

      The warning is probably expected, but the duplication isn't.
      Only applies to 10.4. 10.3 doesn't have this SQL mode, hence no warning, in 10.5 it is an error (and is not duplicated in SHOW WARNINGS).

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration