[MDEV-9505] Invalid write of size 8 in SEL_ARG::store_min_key, find_used_partitions Created: 2016-02-01  Updated: 2016-02-01  Resolved: 2016-02-01

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.0.23
Fix Version/s: 10.0.24

Type: Bug Priority: Major
Reporter: Sergei Petrunia Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: None


 Description   

Bug found by monty:

--source include/have_partition.inc
 
create table t1 (a int, b char(10), c varchar(5), d int)
partition by range columns(a,b,c)
subpartition by key (c,d)
subpartitions 3
( partition p0 values less than (1,'abc','abc'),
  partition p1 values less than (2,'abc','abc'),
  partition p2 values less than (3,'abc','abc'),
  partition p3 values less than (4,'abc','abc'));
 
insert into t1 values (1,'a','b',1),(2,'a','b',2),(3,'a','b',3);
select * from t1 where (a = 1 AND b < 'd' AND (c = 'b' OR (c = 'c' AND d = 1)) OR
                       (a = 1 AND b >= 'a' AND (c = 'c' OR (c = 'd' AND d = 2))));
drop table t1;

Causes a memory overrun in SEL_ARG::store_min_key, find_used_partitions.
The overrun is detected and reported by valgrind.



 Comments   
Comment by Sergei Petrunia [ 2016-02-01 ]

This seems to have been introduced in commit 9b9e36ed4926edd896aa274e15286f64cfec4313, which fixes MDEV-8779.

Generated at Thu Feb 08 07:35:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.