diff options
author | vva@eagle.mysql.r18.ru <> | 2004-02-13 02:28:56 +0400 |
---|---|---|
committer | vva@eagle.mysql.r18.ru <> | 2004-02-13 02:28:56 +0400 |
commit | dc3f0a21dbe90784ab1b7d367992f1b84717f381 (patch) | |
tree | 4a545d61c8ce757cac7c86a7e470a7b252cdb917 /mysql-test | |
parent | 0588ac7736b73fca5531fd0cc1949840ce724870 (diff) | |
parent | da662e9d8411b4ba0aa17a234918810ed0292628 (diff) | |
download | mariadb-git-dc3f0a21dbe90784ab1b7d367992f1b84717f381.tar.gz |
Merge vvagin@bk-internal.mysql.com:/home/bk/mysql-4.0
into eagle.mysql.r18.ru:/home/vva/work/BUG_2898/mysql-4.0
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/select_found.result | 18 | ||||
-rw-r--r-- | mysql-test/t/select_found.test | 28 |
2 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result index 419ffb73d59..367bdd798b4 100644 --- a/mysql-test/r/select_found.result +++ b/mysql-test/r/select_found.result @@ -188,3 +188,21 @@ select FOUND_ROWS(); FOUND_ROWS() 0 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; diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test index f5ee4d5c010..e584fca206f 100644 --- a/mysql-test/t/select_found.test +++ b/mysql-test/t/select_found.test @@ -99,3 +99,31 @@ select FOUND_ROWS(); select SQL_CALC_FOUND_ROWS * from t1 where id > 6 limit 0, 1; select FOUND_ROWS(); 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; + |