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

Wrong error upon creating Aria table with long index on BLOB

Details

    Description

      CREATE TABLE t1 (a TEXT, UNIQUE(a)) ENGINE=Aria;
      

      10.4 3b47587f

      mysqltest: At line 1: query 'CREATE TABLE t1 (a TEXT, UNIQUE(a)) ENGINE=Aria' failed: 1904: Key/Index cannot be defined on a virtual generated column
      

      Attachments

        Issue Links

          Activity

            sachin.setiya.007 Sachin Setiya (Inactive) added a comment - http://lists.askmonty.org/pipermail/commits/2019-June/013832.html

            The suggested bug fix is wrong:

            • It would change errors to "Aria Storage engine does not support long unique keys" that should not be changed.

            Please ensure that the patch doesn't change this:

            MariaDB [test]> create or replace table t1 (a varchar(251), b int generated always as (length(a)), key (b)) engine=aria;
            ERROR 1904 (HY000): Key/Index cannot be defined on a virtual generated column

            Adding an error handler is usually not the correct way to fix the issue. The correct way would be that when MariaDB decides to use a virtual hash column for unique handling, it should check if the storage engine supports indexes on virtual columns and give an error if this is not the case.

            monty Michael Widenius added a comment - The suggested bug fix is wrong: It would change errors to "Aria Storage engine does not support long unique keys" that should not be changed. Please ensure that the patch doesn't change this: MariaDB [test] > create or replace table t1 (a varchar(251), b int generated always as (length(a)), key (b)) engine=aria; ERROR 1904 (HY000): Key/Index cannot be defined on a virtual generated column Adding an error handler is usually not the correct way to fix the issue. The correct way would be that when MariaDB decides to use a virtual hash column for unique handling, it should check if the storage engine supports indexes on virtual columns and give an error if this is not the case.
            sachin.setiya.007 Sachin Setiya (Inactive) added a comment - Hi monty , This commit addresses all the issues http://lists.askmonty.org/pipermail/commits/2019-August/013924.html

            ok to push

            serg Sergei Golubchik added a comment - ok to push

            People

              sachin.setiya.007 Sachin Setiya (Inactive)
              elenst Elena Stepanova
              Votes:
              1 Vote for this issue
              Watchers:
              5 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.