Commit e3a82d77 authored by unknown's avatar unknown

fixed copying of color in SEL_ARG::clone (fixed bug #2968)


mysql-test/r/select_found.result:
  added new tests for bugs with range optimization (bugs #2448 and #2698)
mysql-test/t/select_found.test:
  added new tests for bugs with range optimization (bugs #2448 and #2698)
parent f9a02ec1
...@@ -188,3 +188,21 @@ select FOUND_ROWS(); ...@@ -188,3 +188,21 @@ select FOUND_ROWS();
FOUND_ROWS() FOUND_ROWS()
0 0
drop table t1; drop table t1;
CREATE TABLE t1 ( a int not null, b int not null, KEY ab(a,b) );
INSERT INTO t1 VALUES ( 47, 1 );
INSERT INTO t1 VALUES ( 70, 1 );
SELECT * FROM t1
WHERE
(
( b =1 AND a BETWEEN 14 AND 21 ) OR
( b =2 AND a BETWEEN 16 AND 18 ) OR
( b =3 AND a BETWEEN 15 AND 19 )
);
a b
DROP TABLE t1;
CREATE TABLE t1 ( a integer, u varchar(15), r integer, key uao_idx( r, a, u));
DELETE FROM t1
WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) )
OR ( r = 1 AND a IN ( 3 ) AND ( u = 'w/U' OR u LIKE 'w/U/%' ) )
OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) );
drop table t1;
...@@ -99,3 +99,31 @@ select FOUND_ROWS(); ...@@ -99,3 +99,31 @@ select FOUND_ROWS();
select SQL_CALC_FOUND_ROWS * from t1 where id > 6 limit 0, 1; select SQL_CALC_FOUND_ROWS * from t1 where id > 6 limit 0, 1;
select FOUND_ROWS(); select FOUND_ROWS();
drop table t1; drop table t1;
#
# Other bugs with range optimization
#
# bug #2448
CREATE TABLE t1 ( a int not null, b int not null, KEY ab(a,b) );
INSERT INTO t1 VALUES ( 47, 1 );
INSERT INTO t1 VALUES ( 70, 1 );
SELECT * FROM t1
WHERE
(
( b =1 AND a BETWEEN 14 AND 21 ) OR
( b =2 AND a BETWEEN 16 AND 18 ) OR
( b =3 AND a BETWEEN 15 AND 19 )
);
DROP TABLE t1;
# bug #2698
CREATE TABLE t1 ( a integer, u varchar(15), r integer, key uao_idx( r, a, u));
DELETE FROM t1
WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) )
OR ( r = 1 AND a IN ( 3 ) AND ( u = 'w/U' OR u LIKE 'w/U/%' ) )
OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) );
drop table t1;
...@@ -488,6 +488,7 @@ SEL_ARG *SEL_ARG::clone(SEL_ARG *new_parent,SEL_ARG **next_arg) ...@@ -488,6 +488,7 @@ SEL_ARG *SEL_ARG::clone(SEL_ARG *new_parent,SEL_ARG **next_arg)
return 0; // OOM return 0; // OOM
} }
increment_use_count(1); increment_use_count(1);
tmp->color= color;
return tmp; return tmp;
} }
......
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