Paul McCullagh <paul.mccullagh@xxxxxxxxxxxxx> writes:
Thanks for clearing this up.
The problem is certainly as you say: it depends on the speed of a
background thread.
From this point of view the test does not make all that much sense
for PBXT which returns inconsistent row count estimates.
I think I will adjust the test to work in all cases with PBXT.
We are getting close to ready with MariaDB 5.1.46, so I would like
to fix this
issue.
How about this patch, which seems to fix the issue? If you're ok
with it, I
will push it into the 5.1-release branch.
- Kristian.
-----------------------------------------------------------------------
=== modified file 'mysql-test/suite/pbxt/r/select_safe.result'
--- mysql-test/suite/pbxt/r/select_safe.result 2009-08-17 15:57:58
+0000
+++ mysql-test/suite/pbxt/r/select_safe.result 2010-05-14 18:19:40
+0000
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1,t2;
SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, SQL_MAX_JOIN_SIZE=9;
create table t1 (a int auto_increment primary key, b char(20));
insert into t1 values(1,"test");
@@ -13,10 +13,12 @@ a b
1 test
2 test2
update t1 set b="a" where a=1;
-analyze table t1;
+create table t2 like t1;
+insert into t2 select * from t1;
+analyze table t2;
Table Op Msg_type Msg_text
-test.t1 analyze status OK
-select 1 from t1,t1 as t2,t1 as t3;
+test.t2 analyze status OK
+select 1 from t2 as t1,t2,t2 as t3;
1
1
1
@@ -77,7 +79,7 @@ id select_type table type possible_keys
1 SIMPLE t1 ALL b NULL NULL NULL 21
1 SIMPLE t2 ref b b 21 test.t1.b 1 Using where
SET MAX_SEEKS_FOR_KEY=DEFAULT;
-drop table t1;
+drop table t1, t2;
create table t1 (a int);
insert into t1 values (1),(2),(3),(4),(5);
insert into t1 select * from t1;
=== modified file 'mysql-test/suite/pbxt/t/select_safe.test'
--- mysql-test/suite/pbxt/t/select_safe.test 2009-04-02 10:03:14 +0000
+++ mysql-test/suite/pbxt/t/select_safe.test 2010-05-14 18:19:33 +0000
@@ -3,7 +3,7 @@
#
--disable_warnings
-drop table if exists t1;
+drop table if exists t1,t2;
--enable_warnings
SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, SQL_MAX_JOIN_SIZE=9;
@@ -15,8 +15,13 @@ delete from t1 where a=1;
insert into t1 values(1,"test"),(2,"test2");
SELECT SQL_BUFFER_RESULT * from t1 order by a; # PBXT required for
consistent result
update t1 set b="a" where a=1;
-analyze table t1; # PBXT: required to get the correct COUNT(*)
-select 1 from t1,t1 as t2,t1 as t3;
+
+# Test MAX_JOIN_SIZE in a fresh table, as insert/delete combination
+# makes PBXT statistics non-deterministic
+create table t2 like t1;
+insert into t2 select * from t1;
+analyze table t2; # PBXT: required to get the correct COUNT(*)
+select 1 from t2 as t1,t2,t2 as t3;
# The following should give errors:
--error 1175
@@ -64,7 +69,7 @@ set MAX_SEEKS_FOR_KEY=1;
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
SET MAX_SEEKS_FOR_KEY=DEFAULT;
-drop table t1;
+drop table t1, t2;
# BUG#8726
create table t1 (a int);