Skip to content

Commit cfbf065

Browse files
committed
MDEV-35176 ASAN errors in Field_vector::store with optimizer_trace enabled
1 parent 425aa95 commit cfbf065

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

mysql-test/main/vector2.result

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,8 @@ select hex(v) from t;
229229
hex(v)
230230
0000000000000000
231231
drop table t;
232+
#
233+
# MDEV-35176 ASAN errors in Field_vector::store with optimizer_trace enabled
234+
#
235+
create table t (pk int primary key, v vector(2) not null, key(v(6)));
236+
ERROR HY000: 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

mysql-test/main/vector2.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,9 @@ create table t (v vector(2) not null);
174174
insert ignore into t values (1);
175175
select hex(v) from t;
176176
drop table t;
177+
178+
--echo #
179+
--echo # MDEV-35176 ASAN errors in Field_vector::store with optimizer_trace enabled
180+
--echo #
181+
--error ER_WRONG_SUB_KEY
182+
create table t (pk int primary key, v vector(2) not null, key(v(6)));

sql/sql_type_vector.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class Type_handler_vector: public Type_handler_varchar
2626
const Type_handler *type_handler_for_comparison() const override;
2727
virtual Item *create_typecast_item(THD *thd, Item *item,
2828
const Type_cast_attributes &attr) const override;
29+
bool type_can_have_key_part() const override { return false; }
2930
bool subquery_type_allows_materialization(const Item *, const Item *, bool)
3031
const override
3132
{

0 commit comments

Comments
 (0)