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

Change in behavior upon creation of unlimited non-unique indexes

    XMLWordPrintable

Details

    Description

      Before MDEV-371, an attempt to add an unlimited (non-unique) index on a blob column caused an error, regardless the strictness of SQL_MODE:

      create table t1 (f text);
      alter table t1 add index ind1 (f);
      

      10.3 dcdeb394

      mysqltest: At line 2: query 'alter table t1 add index ind1 (f)' failed: 1170: BLOB/TEXT column 'f' used in key specification without a key length
      

      Now instead it causes a warning, also regardless the strictness of SQL_MODE, and an index is created with automatically specified length:

      10.4 c0ba036b

      alter table t1 add index ind1 (f);
      Warnings:
      Note	1071	Specified key was too long; max key length is 1000 bytes
      show create table t1;
      Table	Create Table
      t1	CREATE TABLE `t1` (
        `f` text DEFAULT NULL,
        KEY `ind1` (`f`(1000))
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1
      

      If the change is intentional, it needs to be documented somewhere.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              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.