MDEV-35215 ASAN errors in Item_func_vec_fromtext::val_str upon VEC_FROMTEXT with an invalid argument

This commit is contained in:
Sergei Golubchik 2024-10-20 16:47:20 +02:00
parent 96eb66e5b3
commit 1a53048299
3 changed files with 12 additions and 2 deletions

Binary file not shown.

View File

@ -64,3 +64,13 @@ select vec_fromtext(NULL);
--echo #
select vec_totext(0x77777777);
select hex(vec_fromtext('[5.01922e33]'));
--echo #
--echo # MDEV-35215 ASAN errors in Item_func_vec_fromtext::val_str upon VEC_FROMTEXT with an invalid argument
--echo #
create table t (v vector(1));
insert into t values (vec_fromtext('[0.93]'));
select vec_fromtext(v) from t;
drop table t;
select vec_fromtext(0x00000000);

View File

@ -198,7 +198,7 @@ String *Item_func_vec_fromtext::val_str(String *buf)
null_value= true;
push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE, ER(ER_TRUNCATED_WRONG_VALUE),
"vector", value->ptr());
"vector", value->c_ptr_safe());
return nullptr;
error_format:
@ -207,7 +207,7 @@ error_format:
null_value= true;
push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
ER_VECTOR_FORMAT_INVALID, ER(ER_VECTOR_FORMAT_INVALID),
position, value->ptr());
position, value->c_ptr_safe());
return nullptr;
}