summaryrefslogtreecommitdiff
path: root/mysql-test/r/range.result
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-05-21 06:11:44 -0700
committerunknown <igor@rurik.mysql.com>2005-05-21 06:11:44 -0700
commit8f7bca3abda5c725355db28e9acb72194db3536e (patch)
treeff555414df2db287bd731f28083d7011394f8b49 /mysql-test/r/range.result
parentc273526d85d26be7c31f28da0174f67b08aef9c8 (diff)
downloadmariadb-git-8f7bca3abda5c725355db28e9acb72194db3536e.tar.gz
range.result, range.test:
Added test cases for optimization request #10561. opt_range.cc, sql_select.cc: Fixed bug #10561: an optimization request to allow range analysis for NOT IN and NOT BETWEEN. sql/sql_select.cc: Fixed bug #10561: an optimization request to allow range analysis for NOT IN and NOT BETWEEN. sql/opt_range.cc: Fixed bug #10561: an optimization request to allow range analysis for NOT IN and NOT BETWEEN. mysql-test/t/range.test: Added test cases for optimization request #10561. mysql-test/r/range.result: Added test cases for optimization request #10561.
Diffstat (limited to 'mysql-test/r/range.result')
-rw-r--r--mysql-test/r/range.result76
1 files changed, 76 insertions, 0 deletions
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 095690fde00..c7d27a8e60d 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -584,3 +584,79 @@ SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 2' OR ARG1 != ' 1');
count(*)
4
drop table t1;
+CREATE TABLE t1 (
+id int(11) NOT NULL auto_increment,
+status varchar(20),
+PRIMARY KEY (id),
+KEY (status)
+);
+INSERT INTO t1 VALUES
+(1,'B'), (2,'B'), (3,'B'), (4,'B'), (5,'B'), (6,'B'),
+(7,'B'), (8,'B'), (9,'B'), (10,'B'), (11,'B'), (12,'B'),
+(13,'B'), (14,'B'), (15,'B'), (16,'B'), (17,'B'), (18,'B'),
+(19,'B'), (20,'B'), (21,'B'), (22,'B'), (23,'B'), (24,'B'),
+(25,'A'), (26,'A'), (27,'A'), (28,'A'), (29,'A'), (30,'A'),
+(31,'A'), (32,'A'), (33,'A'), (34,'A'), (35,'A'), (36,'A'),
+(37,'A'), (38,'A'), (39,'A'), (40,'A'), (41,'A'), (42,'A'),
+(43,'A'), (44,'A'), (45,'A'), (46,'A'), (47,'A'), (48,'A'),
+(49,'A'), (50,'A'), (51,'A'), (52,'A'), (53,'C'), (54,'C'),
+(55,'C'), (56,'C'), (57,'C'), (58,'C'), (59,'C'), (60,'C');
+EXPLAIN SELECT * FROM t1 WHERE status <> 'A' AND status <> 'B';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range status status 23 NULL 11 Using where
+EXPLAIN SELECT * FROM t1 WHERE status NOT IN ('A','B');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range status status 23 NULL 11 Using where
+SELECT * FROM t1 WHERE status <> 'A' AND status <> 'B';
+id status
+53 C
+54 C
+55 C
+56 C
+57 C
+58 C
+59 C
+60 C
+SELECT * FROM t1 WHERE status NOT IN ('A','B');
+id status
+53 C
+54 C
+55 C
+56 C
+57 C
+58 C
+59 C
+60 C
+EXPLAIN SELECT status FROM t1 WHERE status <> 'A' AND status <> 'B';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range status status 23 NULL 11 Using where; Using index
+EXPLAIN SELECT status FROM t1 WHERE status NOT IN ('A','B');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range status status 23 NULL 11 Using where; Using index
+EXPLAIN SELECT * FROM t1 WHERE status NOT BETWEEN 'A' AND 'B';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range status status 23 NULL 10 Using where
+EXPLAIN SELECT * FROM t1 WHERE status < 'A' OR status > 'B';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range status status 23 NULL 10 Using where
+SELECT * FROM t1 WHERE status NOT BETWEEN 'A' AND 'B';
+id status
+53 C
+54 C
+55 C
+56 C
+57 C
+58 C
+59 C
+60 C
+SELECT * FROM t1 WHERE status < 'A' OR status > 'B';
+id status
+53 C
+54 C
+55 C
+56 C
+57 C
+58 C
+59 C
+60 C
+DROP TABLE t1;