Description:
Hi,
MySQL v9 seems to support the vector data type but I cannot see it in release notes, "1.4 What Is New in MySQL 9.0" or data types documentation.
[1] https://dev.mysql.com/doc/relnotes/mysql/9.0/en/news-9-0-0.html
[2] https://dev.mysql.com/doc/refman/9.0/en/mysql-nutshell.html
[3] https://dev.mysql.com/doc/refman/9.0/en/data-types.html
How to repeat:
mysql [localhost:9000] {msandbox} (test) > select @@version,@@version_comment,@@build_id;
+-----------+------------------------------+------------------------------------------+
| @@version | @@version_comment | @@build_id |
+-----------+------------------------------+------------------------------------------+
| 9.0.0 | MySQL Community Server - GPL | 23f0a34960048d578127bcae8f0a86cdc2828575 |
+-----------+------------------------------+------------------------------------------+
1 row in set (0.00 sec)
mysql [localhost:9000] {msandbox} ((none)) > create database test;
Query OK, 1 row affected (0.00 sec)
mysql [localhost:9000] {msandbox} ((none)) > use test;
Database changed
mysql [localhost:9000] {msandbox} (test) > CREATE TABLE `t1` (
-> `pk` int NOT NULL,
-> `v` vector(2048) DEFAULT NULL,
-> PRIMARY KEY (`pk`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
Query OK, 0 rows affected (0.04 sec)
mysql [localhost:9000] {msandbox} (test) > show create table test.t1\G
*************************** 1. row ***************************
Table: t1
Create Table: CREATE TABLE `t1` (
`pk` int NOT NULL,
`v` vector(2048) DEFAULT NULL,
PRIMARY KEY (`pk`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
1 row in set (0.00 sec)
mysql [localhost:9000] {msandbox} (test) > use information_schema;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql [localhost:9000] {msandbox} (information_SCHEMA) > SELECT a.name AS `Table`, b.TABLE_ID,b.NAME,b.POS,b.MTYPE,b.PRTYPE,b.LEN from innodb_tables a, innodb_columns b where a.name = 'test/t1' and a.table_id=b.table_id order by b.table_id,b.pos;
+---------+----------+------+-----+-------+---------+-----+
| Table | TABLE_ID | NAME | POS | MTYPE | PRTYPE | LEN |
+---------+----------+------+-----+-------+---------+-----+
| test/t1 | 1068 | pk | 0 | 6 | 1283 | 4 |
| test/t1 | 1068 | v | 1 | 5 | 4130034 | 12 |
+---------+----------+------+-----+-------+---------+-----+
2 rows in set (0.01 sec)
mysql [localhost:9000] {msandbox} (information_schema) > select * from information_schema.columns where TABLE_SCHEMA='test'\G
*************************** 1. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: t1
COLUMN_NAME: pk
ORDINAL_POSITION: 1
COLUMN_DEFAULT: NULL
IS_NULLABLE: NO
DATA_TYPE: int
CHARACTER_MAXIMUM_LENGTH: NULL
CHARACTER_OCTET_LENGTH: NULL
NUMERIC_PRECISION: 10
NUMERIC_SCALE: 0
DATETIME_PRECISION: NULL
CHARACTER_SET_NAME: NULL
COLLATION_NAME: NULL
COLUMN_TYPE: int
COLUMN_KEY: PRI
EXTRA:
PRIVILEGES: select,insert,update,references
COLUMN_COMMENT:
GENERATION_EXPRESSION:
SRS_ID: NULL
*************************** 2. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: t1
COLUMN_NAME: v
ORDINAL_POSITION: 2
COLUMN_DEFAULT: NULL
IS_NULLABLE: YES
DATA_TYPE: vector
CHARACTER_MAXIMUM_LENGTH: 8192
CHARACTER_OCTET_LENGTH: 8192
NUMERIC_PRECISION: NULL
NUMERIC_SCALE: NULL
DATETIME_PRECISION: NULL
CHARACTER_SET_NAME: NULL
COLLATION_NAME: NULL
COLUMN_TYPE: vector(2048)
COLUMN_KEY:
EXTRA:
PRIVILEGES: select,insert,update,references
COLUMN_COMMENT:
GENERATION_EXPRESSION:
SRS_ID: NULL
2 rows in set (0.01 sec)
Suggested fix:
Add documentation on new data type, usage and any associated functions.
Thanks!
Marc