mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Fixed LP bug #752353.
In some cases the field max_part_no of the SEL_ARG structure was not initialized. That triggered a Valgrind complain.
This commit is contained in:
parent
b315c62bf1
commit
79439d9a74
4 changed files with 40 additions and 0 deletions
|
|
@ -1367,4 +1367,14 @@ f1 f2 f3 f4
|
||||||
9 0 2 6
|
9 0 2 6
|
||||||
SET SESSION optimizer_switch=DEFAULT;
|
SET SESSION optimizer_switch=DEFAULT;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (f1 int) ;
|
||||||
|
INSERT INTO t1 VALUES (0), (0);
|
||||||
|
CREATE TABLE t2 (f1 int, f2 int, f3 int, f4 int, INDEX idx (f3,f2)) ;
|
||||||
|
INSERT INTO t2 VALUES (5,6,0,0), (0,4,0,0);
|
||||||
|
CREATE TABLE t3 (f1 int, f2 int, INDEX idx1 (f2,f1) , INDEX idx2 (f1)) ;
|
||||||
|
INSERT INTO t3 VALUES (6,0),( 4,0);
|
||||||
|
SELECT * FROM t1,t2,t3
|
||||||
|
WHERE (t2.f3 = 1 OR t3.f1=t2.f1) AND t3.f1 <> t2.f2 AND t3.f2 = t2.f4;
|
||||||
|
f1 f1 f2 f3 f4 f1 f2
|
||||||
|
DROP TABLE t1,t2,t3;
|
||||||
set session optimizer_switch='index_merge_sort_intersection=default';
|
set session optimizer_switch='index_merge_sort_intersection=default';
|
||||||
|
|
|
||||||
|
|
@ -1368,5 +1368,15 @@ f1 f2 f3 f4
|
||||||
9 0 2 6
|
9 0 2 6
|
||||||
SET SESSION optimizer_switch=DEFAULT;
|
SET SESSION optimizer_switch=DEFAULT;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (f1 int) ;
|
||||||
|
INSERT INTO t1 VALUES (0), (0);
|
||||||
|
CREATE TABLE t2 (f1 int, f2 int, f3 int, f4 int, INDEX idx (f3,f2)) ;
|
||||||
|
INSERT INTO t2 VALUES (5,6,0,0), (0,4,0,0);
|
||||||
|
CREATE TABLE t3 (f1 int, f2 int, INDEX idx1 (f2,f1) , INDEX idx2 (f1)) ;
|
||||||
|
INSERT INTO t3 VALUES (6,0),( 4,0);
|
||||||
|
SELECT * FROM t1,t2,t3
|
||||||
|
WHERE (t2.f3 = 1 OR t3.f1=t2.f1) AND t3.f1 <> t2.f2 AND t3.f2 = t2.f4;
|
||||||
|
f1 f1 f2 f3 f4 f1 f2
|
||||||
|
DROP TABLE t1,t2,t3;
|
||||||
set session optimizer_switch='index_merge_sort_intersection=default';
|
set session optimizer_switch='index_merge_sort_intersection=default';
|
||||||
SET SESSION STORAGE_ENGINE=DEFAULT;
|
SET SESSION STORAGE_ENGINE=DEFAULT;
|
||||||
|
|
|
||||||
|
|
@ -1010,5 +1010,24 @@ SET SESSION optimizer_switch=DEFAULT;
|
||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #752353: valgrind complain on a jump depending
|
||||||
|
# on an uninitialised value
|
||||||
|
#
|
||||||
|
|
||||||
|
CREATE TABLE t1 (f1 int) ;
|
||||||
|
INSERT INTO t1 VALUES (0), (0);
|
||||||
|
|
||||||
|
CREATE TABLE t2 (f1 int, f2 int, f3 int, f4 int, INDEX idx (f3,f2)) ;
|
||||||
|
INSERT INTO t2 VALUES (5,6,0,0), (0,4,0,0);
|
||||||
|
|
||||||
|
CREATE TABLE t3 (f1 int, f2 int, INDEX idx1 (f2,f1) , INDEX idx2 (f1)) ;
|
||||||
|
INSERT INTO t3 VALUES (6,0),( 4,0);
|
||||||
|
|
||||||
|
SELECT * FROM t1,t2,t3
|
||||||
|
WHERE (t2.f3 = 1 OR t3.f1=t2.f1) AND t3.f1 <> t2.f2 AND t3.f2 = t2.f4;
|
||||||
|
|
||||||
|
DROP TABLE t1,t2,t3;
|
||||||
|
|
||||||
#the following command must be the last one in the file
|
#the following command must be the last one in the file
|
||||||
set session optimizer_switch='index_merge_sort_intersection=default';
|
set session optimizer_switch='index_merge_sort_intersection=default';
|
||||||
|
|
|
||||||
|
|
@ -7338,6 +7338,7 @@ get_mm_parts(RANGE_OPT_PARAM *param, COND *cond_func, Field *field,
|
||||||
DBUG_RETURN(0); // OOM
|
DBUG_RETURN(0); // OOM
|
||||||
}
|
}
|
||||||
sel_arg->part=(uchar) key_part->part;
|
sel_arg->part=(uchar) key_part->part;
|
||||||
|
sel_arg->max_part_no= sel_arg->part+1;
|
||||||
tree->keys[key_part->key]=sel_add(tree->keys[key_part->key],sel_arg);
|
tree->keys[key_part->key]=sel_add(tree->keys[key_part->key],sel_arg);
|
||||||
tree->keys_map.set_bit(key_part->key);
|
tree->keys_map.set_bit(key_part->key);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue