1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Merge 5.3->5.5.

In particular:
Merged the patch for bug mdev-4418 from 5.3 into 5.5.
Fixed a bug in the patch that should be backported to 5.3.
This commit is contained in:
Igor Babaev
2013-08-18 19:58:51 -07:00
26 changed files with 810 additions and 199 deletions

View File

@@ -570,12 +570,12 @@ INSERT INTO t1 VALUES
EXPLAIN
SELECT s.oxid FROM t1 v, t1 s
WHERE s.oxrootid = 'd8c4177d09f8b11f5.52725521' AND
WHERE
v.oxrootid ='d8c4177d09f8b11f5.52725521' AND
s.oxleft > v.oxleft AND s.oxleft < v.oxright;
SELECT s.oxid FROM t1 v, t1 s
WHERE s.oxrootid = 'd8c4177d09f8b11f5.52725521' AND
WHERE
v.oxrootid ='d8c4177d09f8b11f5.52725521' AND
s.oxleft > v.oxleft AND s.oxleft < v.oxright;
@@ -1481,6 +1481,40 @@ SELECT * FROM t1 IGNORE INDEX(PRIMARY) WHERE F1 BETWEEN 'A ' AND
DROP TABLE t1;
--echo #
--echo # mdev-4894: Poor performance with unnecessary
--echo # (bug#70021) 'Range checked for each record'
--echo #
create table t1( key1 int not null, INDEX i1(key1) );
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8);
insert into t1 select key1+8 from t1;
insert into t1 select key1+16 from t1;
insert into t1 select key1+32 from t1;
insert into t1 select key1+64 from t1;
insert into t1 select key1+128 from t1;
insert into t1 select key1+256 from t1;
insert into t1 select key1+512 from t1;
alter table t1 add key2 int not null, add index i2(key2);
update t1 set key2=key1;
analyze table t1;
create table t2 (a int);
insert into t2 values (1),(2),(3),(4),(5),(6),(7),(8);
insert into t2 select a+16 from t2;
insert into t2 select a+32 from t2;
insert into t2 select a+64 from t2;
explain
select count(*) from t2 left join t1 on (t1.key1 < 3 or t1.key1 > 1020) and t1.key2 < 1000;
select count(*) from t2 left join t1 on (t1.key1 < 3 or t1.key1 > 1020) and t1.key2 < 1000;
explain
select count(*) from t2 left join t1 on (t1.key1 < 3 or t1.key1 > 1020) and t1.key2 < t2.a;
select count(*) from t2 left join t1 on (t1.key1 < 3 or t1.key1 > 1020) and t1.key2 < t2.a;
drop table t1,t2;
--echo End of 5.1 tests
--echo #

View File

@@ -4500,7 +4500,7 @@ SELECT * FROM t1 INNER JOIN t2 ON ( c = a )
DROP TABLE t1,t2;
--echo #
--echo # Bug mdev-4413: another manifestations of bug mdev-2474
--echo # Bug mdev-4413: another manifestations of bug mdev-4274
--echo # (valgrind complains)
--echo #
@@ -4516,5 +4516,52 @@ SELECT * FROM t1, t2
DROP TABLE t1, t2;
--echo #
--echo # Bug mdev-4355: equalities from the result of simplification of OR
--echo # are not propagated to lower AND levels
--echo #
CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,101),(2,102),(3,103),(4,104),(5,11);
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE (1 != 1 OR a = 5) AND (b != 1 OR a = 1);
SELECT * FROM t1 WHERE (1 != 1 OR a = 5) AND (b != 1 OR a = 1);
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (1 != 1 OR a = 5);
SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (1 != 1 OR a = 5);
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (a = 5 OR 1 != 1);
SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (a = 5 OR 1 != 1);
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE (b = 1 OR a = 1) AND (b = 5 AND a = 5 OR 1 != 1);
SELECT * FROM t1 WHERE (b = 1 OR a = 1) AND (b = 5 AND a = 5 OR 1 != 1);
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE (b = 1 OR a = 5) AND (b = 5 AND a = 5 OR 1 != 1);
SELECT * FROM t1 WHERE (b = 1 OR a = 5) AND (b = 5 AND a = 5 OR 1 != 1);
DROP TABLE t1;
--echo #
--echo # Bug mdev-4418: impossible multiple equality in OR formula
--echo # after row substitution
--echo #
CREATE TABLE t1 (a int, b varchar(1)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (0,'j'), (8,'v');
CREATE TABLE t2 (c varchar(1), d varchar(1)) ENGINE=MyISAM;
INSERT INTO t2 VALUES ('k','k');
EXPLAIN EXTENDED
SELECT * FROM t1, t2 WHERE c=b AND (1=2 OR ((b='h' OR a=136) AND d=b));
SELECT * FROM t1, t2 WHERE c=b AND (1=2 OR ((b='h' OR a=136) AND d=b));
DROP TABLE t1,t2;
--echo End of 5.3 tests