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

Adding a regular index on a vector column leads to invalid table structure

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 11.7(EOL)
    • 11.7.2
    • Vector search
    • None

    Description

      create table t (v vector(800), key(v));
      show create table t;
      --exec $MYSQL_DUMP test --tables t | $MYSQL test
      drop table t;
      

      11.7 bc32705f46fa93d9700a20c8d439e48e5c352272

      create table t (v vector(800), key(v));
      Warnings:
      Note	1071	Specified key was too long; max key length is 1000 bytes
      show create table t;
      Table	Create Table
      t	CREATE TABLE `t` (
        `v` vector(800) DEFAULT NULL,
        KEY `v` (`v`(1000))
      ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
      bug.tlc                                  [ fail ]
              Test ended at 2025-01-07 14:59:14
       
      CURRENT_TEST: bug.tlc
      --------------
      CREATE TABLE `t` (
        `v` vector(800) DEFAULT NULL,
        KEY `v` (`v`(1000))
      ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
      --------------
       
      ERROR 1089 (HY000) at line 26: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys
      

      So, originally the table is created (with a warning), the index is converted into a prefix, but when the resulting table structure is used explicitly, it is rejected with an error.

      Attachments

        Issue Links

          Activity

            There are no comments yet on this issue.

            People

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