Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
N/A
-
None
Description
ALTER TABLE is able to modify a vector column to a shorter length (which is good). However it does so without the usual warnings/errors produced in a similar situation for other data types.
create table t (v vector(2)); |
insert into t values (0x3131313132323232); |
select * from t; |
alter table t modify v vector(1); |
select * from t; |
|
# Cleanup
|
drop table t; |
7aab5e35d714fc3b6de68f5158072d5ecdf62faa |
create table t (v vector(2)); |
insert into t values (0x3131313132323232); |
select * from t; |
v
|
11112222
|
alter table t modify v vector(1); |
select * from t; |
v
|
1111
|
In the same situation, modification binary(8) => binary(4) produces WARN_DATA_TRUNCATED (error or warning, depending on the strict mode / ignore clause).
create table t (v binary(8)); |
insert into t values (0x3131313132323232); |
select * from t; |
v
|
11112222
|
alter table t modify v binary(4); |
bug.t [ fail ]
|
Test ended at 2024-10-31 23:41:15 |
|
CURRENT_TEST: bug.t
|
mysqltest: At line 4: query 'alter table t modify v binary(4)' failed: WARN_DATA_TRUNCATED (1265): Data truncated for column 'v' at row 1 |
set sql_mode=''; |
alter table t modify v binary(4); |
Warnings:
|
Warning 1265 Data truncated for column 'v' at row 1 |
select * from t; |
v
|
1111
|
Attachments
Issue Links
- is caused by
-
MDEV-34939 vector search in 11.7
- Closed