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

SHOW CREATE TABLE produces unusable statement for vector fields with constant default value

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • N/A
    • 11.7.1
    • Vector search
    • None

    Description

      I don't suppose it will be particularly important for real use of vectors, as it's unlikely that their default values will be set as constants (too long), but it can be problematic for users getting familiar with MariaDB's implementation of vectors.

      7fce19bd215ac0671855044520092aa4210049d1

      MariaDB [db]> create table t (v vector(1) default 0x30303030);
      Query OK, 0 rows affected (1.524 sec)
       
      MariaDB [db]> show create table t;
      +-------+-------------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                            |
      +-------+-------------------------------------------------------------------------------------------------------------------------+
      | t     | CREATE TABLE `t` (
        `v` vector(1) DEFAULT '0000'
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
      +-------+-------------------------------------------------------------------------------------------------------------------------+
      1 row in set (0.001 sec)
      

      MariaDB [db]> drop table t;
      Query OK, 0 rows affected (0.054 sec)
       
      MariaDB [db]> CREATE TABLE `t` (
          ->   `v` vector(1) DEFAULT '0000'
          -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
          -> ;
      ERROR 1067 (42000): Invalid default value for 'v'
      

      Consequently, an attempt to load a dump produced by mariadb-dump (regardless of hex-blob, as it doesn't affect CREATE) fails the same way.

      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.