From 3390eaa08582d9c0d0e12db7259ae00ede9741e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Jun 2006 12:04:03 +0300 Subject: Bug #4981: 4.x and 5.x produce non-optimal execution path, 3.23 regression test failure The member SEL_ARG::min_flag was not initialized, due to which the condition for no GEOM_FLAG in function key_or did not choose "Range checked for each record" as the correct access method. mysql-test/r/select.result: testcase for 'Range checked' access method mysql-test/t/select.test: testcase for 'Range checked' access method sql/opt_range.cc: All of the class members initialized --- mysql-test/t/select.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mysql-test/t/select.test') diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 996d5854854..3dcc16f1625 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2248,4 +2248,18 @@ insert into t2 values(1,1); select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2)); drop table t1,t2; +# +# Bug #4981: 4.x and 5.x produce non-optimal execution path, 3.23 regression test failure +# +CREATE TABLE t1(a int, b int, c int, KEY b(b), KEY c(c)); +insert into t1 values (1,0,0),(2,0,0); +CREATE TABLE t2 (a int, b varchar(2), c varchar(2), PRIMARY KEY(a)); +insert into t2 values (1,'',''), (2,'',''); +CREATE TABLE t3 (a int, b int, PRIMARY KEY (a,b), KEY a (a), KEY b (b)); +insert into t3 values (1,1),(1,2); +# must have "range checked" for t2 +explain select straight_join DISTINCT t2.a,t2.b, t1.c from t1, t3, t2 + where (t1.c=t2.a or (t1.c=t3.a and t2.a=t3.b)) and t1.b=556476786 and + t2.b like '%%' order by t2.b limit 0,1; +DROP TABLE t1,t2,t3; # End of 4.1 tests -- cgit v1.2.1