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

Persistent virtual column cannot cope with auto_increment column

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.1.6
    • N/A
    • Virtual Columns
    • None
    • Linux OpenSUSE 13.2

    Description

      If a persistent computed column uses an auto_increment column in its defining expression, upon inserting a new row into the table the value of the auto_increment column is taken to be zero and not the value it gets automatically assigned. The same problem does not happen with a virtual computed column.

      Example:

      create table test (a int key auto_increment, b int as(a) persistent);
      insert test set a=null;
      select * from test;
      +---+------+
      | a | b    |
      +---+------+
      | 1 |    0 |
      +---+------+

      One would, however, expect that b is 1, just like a. As it stands, persistent computed columns cannot meaningfully use auto_increment columns.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mr212 Martin Rieger
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.