Commit d9e00770 authored by Nikita Malyavin's avatar Nikita Malyavin

MDEV-22608 ASAN use-after-poison in TABLE::check_period_overlaps

The bug was fixed by MDEV-22599 bugfix, which changed `Field::cmp` call
to `Field::cmp_prefix` in `TABLE::check_period_overlaps`.

The trick is that `Field_bit::cmp` apparently calls `Field_bit::cmp_key`,
which condiders an argument an actual pointer to data, which isn't correct
for `Field_bit`, since it stores data by `bit_ptr`. which is in the
beginning of the record, and using `ptr` is incorrect (we use it through
`ptr_in_record` call)
parent afca9768
...@@ -337,4 +337,11 @@ insert into t values (1,'1988-08-25','2024-03-06'); ...@@ -337,4 +337,11 @@ insert into t values (1,'1988-08-25','2024-03-06');
create or replace table t1 (a int) engine=myisam; create or replace table t1 (a int) engine=myisam;
insert into t1 values (1),(2); insert into t1 values (1),(2);
update t join t1 set s = '2020-01-01'; update t join t1 set s = '2020-01-01';
# MDEV-22608 ASAN use-after-poison in TABLE::check_period_overlaps
create or replace table t1 (s date, e date, b bit, period for p(s,e),
unique(b, p without overlaps)) engine=myisam;
insert into t1 values ('2024-12-21','2034-06-29',0),
('2024-12-21','2034-06-29',1);
update t1 set b = 1;
ERROR 23000: Duplicate entry '\x01-2034-06-29-2024-12-21' for key 'b'
drop table t, t1; drop table t, t1;
...@@ -324,4 +324,15 @@ insert into t1 values (1),(2); ...@@ -324,4 +324,15 @@ insert into t1 values (1),(2);
update t join t1 set s = '2020-01-01'; update t join t1 set s = '2020-01-01';
--echo # MDEV-22608 ASAN use-after-poison in TABLE::check_period_overlaps
create or replace table t1 (s date, e date, b bit, period for p(s,e),
unique(b, p without overlaps)) engine=myisam;
insert into t1 values ('2024-12-21','2034-06-29',0),
('2024-12-21','2034-06-29',1);
--error ER_DUP_ENTRY
update t1 set b = 1;
drop table t, t1; drop table t, t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment