summaryrefslogtreecommitdiff
path: root/mysql-test/r/select_safe.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/select_safe.result')
-rw-r--r--mysql-test/r/select_safe.result23
1 files changed, 19 insertions, 4 deletions
diff --git a/mysql-test/r/select_safe.result b/mysql-test/r/select_safe.result
index 3303f19d9c7..830390ebe3c 100644
--- a/mysql-test/r/select_safe.result
+++ b/mysql-test/r/select_safe.result
@@ -1,6 +1,6 @@
drop table if exists t1;
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));
+create table t1 (a int auto_increment primary key, b char(20), key(b));
insert into t1 values(1,"test");
SELECT SQL_BUFFER_RESULT * from t1;
a b
@@ -13,7 +13,7 @@ a b
1 test
2 test2
update t1 set b="a" where a=1;
-select 1 from t1,t1 as t2,t1 as t3,t1 as t4;
+select 1 from t1,t1 as t2,t1 as t3;
1
1
1
@@ -22,11 +22,9 @@ select 1 from t1,t1 as t2,t1 as t3,t1 as t4;
update t1 set b="a";
You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
update t1 set b="a" where b="test";
-You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
delete from t1;
You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
delete from t1 where b="test";
-You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
delete from t1 where a+0=1;
You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
select 1 from t1,t1 as t2,t1 as t3,t1 as t4,t1 as t5;
@@ -59,5 +57,22 @@ a b
2 test2
4 a
5 a
+SELECT @@MAX_SEEKS_FOR_KEY;
+@@max_seeks_for_key
+4294967295
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
+explain select * from t1,t1 as t2 where t1.b=t2.b;
+table type possible_keys key key_len ref rows Extra
+t1 ALL b NULL NULL NULL 21
+t2 ALL b NULL NULL NULL 16 Using where
+set MAX_SEEKS_FOR_KEY=1;
+explain select * from t1,t1 as t2 where t1.b=t2.b;
+table type possible_keys key key_len ref rows Extra
+t1 ALL b NULL NULL NULL 21
+t2 ref b b 21 t1.b 6 Using where
+SET MAX_SEEKS_FOR_KEY=DEFAULT;
drop table t1;
SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, SQL_MAX_JOIN_SIZE=DEFAULT;