summaryrefslogtreecommitdiff
path: root/mysql-test/r/select.result
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2005-09-16 01:19:43 +0400
committerunknown <evgen@moonbone.local>2005-09-16 01:19:43 +0400
commit28028b5f07b0247b6b70ba96179acd96f9fb2f09 (patch)
treea9e1d436a1bedcafce2bfe785ab45cc8b9317b45 /mysql-test/r/select.result
parent3462573fa8e2c21b22013a4f4f7c1f4e8efb3618 (diff)
downloadmariadb-git-28028b5f07b0247b6b70ba96179acd96f9fb2f09.tar.gz
Fix bug #12291 Table wasn't reinited for index scan after sequential scan
Optimizer did choose "Range checked for each record" for one of the tables. For first few loops over that table it choose sequential access, on later stage it choose to use index. Because table was previously initialized for sequential access, it skips intitialization for index access, and when server tries to retrieve data error occurs. QUICK_RANGE_SELECT::init() changes so if file already initialized for sequential access, it calls ha_rnd_end() and initializes file for index access. sql/opt_range.cc: Fix bug #12291 Table wasn't reinited for index scan after sequential scan mysql-test/t/select.test: Test case for bug #12291 Table wasn't reinited for index scan after sequential scan mysql-test/r/select.result: Test case for bug #12291 Table wasn't reinited for index scan after sequential scan
Diffstat (limited to 'mysql-test/r/select.result')
-rw-r--r--mysql-test/r/select.result17
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index d7de9b6509b..e3af75a4573 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2943,3 +2943,20 @@ select * from t1 join t2 join t4 using (c);
c a b
1 1 1
drop table t1, t2, t3, t4;
+create table t1(x int, y int);
+create table t2(x int, y int);
+create table t3(x int, primary key(x));
+insert into t1 values (1, 1), (2, 1), (3, 1), (4, 3), (5, 6), (6, 6);
+insert into t2 values (1, 1), (2, 1), (3, 3), (4, 6), (5, 6);
+insert into t3 values (1), (2), (3), (4), (5);
+select t1.x, t3.x from t1, t2, t3 where t1.x = t2.x and t3.x >= t1.y and t3.x <= t2.y;
+x x
+1 1
+2 1
+3 1
+3 2
+3 3
+4 3
+4 4
+4 5
+drop table t1,t2,t3;