summaryrefslogtreecommitdiff
path: root/mysql-test/r/range.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/range.result')
-rw-r--r--mysql-test/r/range.result117
1 files changed, 117 insertions, 0 deletions
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 13ae77c13e3..8a416de66ee 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -1767,6 +1767,123 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk;
pk i4 pk i4
DROP TABLE t1;
+#
+# BUG#13519696 - 62940: SELECT RESULTS VARY WITH VERSION AND
+# WITH/WITHOUT INDEX RANGE SCAN
+#
+create table t1 (id int unsigned not null auto_increment primary key);
+insert into t1 values (null);
+insert into t1 select null from t1;
+insert into t1 select null from t1;
+insert into t1 select null from t1;
+insert into t1 select null from t1;
+insert into t1 select null from t1;
+insert into t1 select null from t1;
+insert into t1 select null from t1;
+insert into t1 select null from t1;
+create table t2 (
+id int unsigned not null auto_increment,
+val decimal(5,3) not null,
+primary key (id,val),
+unique key (val,id),
+unique key (id));
+insert into t2 select null,id*0.0009 from t1;
+select count(val) from t2 ignore index (val) where val > 0.1155;
+count(val)
+128
+select count(val) from t2 force index (val) where val > 0.1155;
+count(val)
+128
+drop table t2, t1;
+#
+# BUG#13453382 - REGRESSION SINCE 5.1.39, RANGE OPTIMIZER WRONG
+# RESULTS WITH DECIMAL CONVERSION
+#
+create table t1 (a int,b int,c int,primary key (a,c));
+insert into t1 values (1,1,2),(1,1,3),(1,1,4);
+select convert(3, signed integer) > 2.9;
+convert(3, signed integer) > 2.9
+1
+select * from t1 force index (primary) where a=1 and c>= 2.9;
+a b c
+1 1 3
+1 1 4
+select * from t1 ignore index (primary) where a=1 and c>= 2.9;
+a b c
+1 1 3
+1 1 4
+select * from t1 force index (primary) where a=1 and c> 2.9;
+a b c
+1 1 3
+1 1 4
+select * from t1 ignore index (primary) where a=1 and c> 2.9;
+a b c
+1 1 3
+1 1 4
+drop table t1;
+#
+# BUG#13463488 - 63437: CHAR & BETWEEN WITH INDEX RETURNS WRONG
+# RESULT AFTER MYSQL 5.1.
+#
+CREATE TABLE t1(
+F1 CHAR(5) NOT NULL,
+F2 CHAR(5) NOT NULL,
+F3 CHAR(5) NOT NULL,
+PRIMARY KEY(F1),
+INDEX IDX_F2(F2)
+);
+INSERT INTO t1 VALUES
+('A','A','A'),('AA','AA','AA'),('AAA','AAA','AAA'),
+('AAAA','AAAA','AAAA'),('AAAAA','AAAAA','AAAAA');
+SELECT * FROM t1 WHERE F1 = 'A ';
+F1 F2 F3
+A A A
+SELECT * FROM t1 IGNORE INDEX(PRIMARY) WHERE F1 = 'A ';
+F1 F2 F3
+A A A
+SELECT * FROM t1 WHERE F1 >= 'A ';
+F1 F2 F3
+A A A
+AA AA AA
+AAA AAA AAA
+AAAA AAAA AAAA
+AAAAA AAAAA AAAAA
+SELECT * FROM t1 WHERE F1 > 'A ';
+F1 F2 F3
+AA AA AA
+AAA AAA AAA
+AAAA AAAA AAAA
+AAAAA AAAAA AAAAA
+SELECT * FROM t1 WHERE F1 BETWEEN 'A ' AND 'AAAAA';
+F1 F2 F3
+A A A
+AA AA AA
+AAA AAA AAA
+AAAA AAAA AAAA
+AAAAA AAAAA AAAAA
+SELECT * FROM t1 WHERE F2 BETWEEN 'A ' AND 'AAAAA';
+F1 F2 F3
+A A A
+AA AA AA
+AAA AAA AAA
+AAAA AAAA AAAA
+AAAAA AAAAA AAAAA
+SELECT * FROM t1 WHERE F3 BETWEEN 'A ' AND 'AAAAA';
+F1 F2 F3
+A A A
+AA AA AA
+AAA AAA AAA
+AAAA AAAA AAAA
+AAAAA AAAAA AAAAA
+SELECT * FROM t1 IGNORE INDEX(PRIMARY) WHERE F1 BETWEEN 'A ' AND
+'AAAAA';
+F1 F2 F3
+A A A
+AA AA AA
+AAA AAA AAA
+AAAA AAAA AAAA
+AAAAA AAAAA AAAAA
+DROP TABLE t1;
End of 5.1 tests
#
# LP Bug #533117: Wrong use_count in SEL_ARG trees