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

Virtual columns do not support autoincrement columns

    XMLWordPrintable

Details

    Description

      MariaDB 10.5.17:
      adding a auto-increment coulmn to a virtual (computed column) results in error 1901:

      ALTER TABLE `rdShopOrder` ADD `Bestellnummer` CHAR(18) AS (CONCAT_WS("-",YEAR(Datum),LPAD(OrganisationID,4,"0"),LPAD(ID,8,"0")) ) VIRTUAL
      Error (1901): Function or expression 'AUTO_INCREMENT' cannot be used in the GENERATED ALWAYS AS clause of `ID`
      

      according to the documentation this is true for stored columns, as I can imagine, but virtual columns should support this behaviour.

      Attachments

        Activity

          People

            serg Sergei Golubchik
            mokraemer Marc
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.