mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge moonbone.local:/work/tmp_merge-5.0-mysql
into moonbone.local:/work/tmp_merge-5.1-opt-mysql BUILD/check-cpu: Auto merged include/config-netware.h: Auto merged mysql-test/r/func_time.result: Auto merged mysql-test/r/group_by.result: Auto merged mysql-test/r/join_outer.result: Auto merged mysql-test/r/ndb_condition_pushdown.result: Auto merged mysql-test/r/range.result: Auto merged mysql-test/r/select.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/type_datetime.result: Auto merged mysql-test/r/user_var.result: Auto merged mysql-test/r/view.result: Auto merged mysql-test/t/func_time.test: Auto merged mysql-test/t/range.test: Auto merged mysql-test/t/select.test: Auto merged mysql-test/t/type_datetime.test: Auto merged mysql-test/t/view.test: Auto merged sql/ha_innodb.cc: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_subselect.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/opt_range.h: Auto merged sql/set_var.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_update.cc: Auto merged storage/innobase/btr/btr0btr.c: Auto merged storage/innobase/buf/buf0buf.c: Auto merged storage/innobase/dict/dict0dict.c: Auto merged storage/innobase/fil/fil0fil.c: Auto merged storage/innobase/fsp/fsp0fsp.c: Auto merged storage/innobase/include/buf0buf.ic: Auto merged storage/innobase/log/log0log.c: Auto merged storage/innobase/log/log0recv.c: Auto merged storage/innobase/os/os0file.c: Auto merged storage/innobase/row/row0sel.c: Auto merged storage/innobase/srv/srv0start.c: Auto merged storage/innobase/ut/ut0dbg.c: Auto merged tests/mysql_client_test.c: Auto merged client/mysqltest.c: Manual merge mysql-test/r/innodb_mysql.result: Manual merge mysql-test/t/innodb_mysql.test: Manual merge mysql-test/t/join_outer.test: Manual merge sql/item_cmpfunc.cc: Manual merge sql/mysql_priv.h: Manual merge sql/opt_range.cc: Manual merge sql/sql_base.cc: Manual merge storage/innobase/include/btr0cur.ic: Manual merge storage/innobase/row/row0mysql.c: Manual merge
This commit is contained in:
@ -838,3 +838,61 @@ select a, hex(filler) from t1 where a not between 'b' and 'b';
|
||||
a hex(filler)
|
||||
a 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
drop table t1,t2,t3;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t2 (a int, key(a));
|
||||
insert into t2 select 2*(A.a + 10*(B.a + 10*C.a)) from t1 A, t1 B, t1 C;
|
||||
set @a="select * from t2 force index (a) where a NOT IN(0";
|
||||
select count(*) from (select @a:=concat(@a, ',', a) from t2 ) Z;
|
||||
count(*)
|
||||
1000
|
||||
set @a=concat(@a, ')');
|
||||
insert into t2 values (11),(13),(15);
|
||||
set @b= concat("explain ", @a);
|
||||
prepare stmt1 from @b;
|
||||
execute stmt1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 index a a 5 NULL 1003 Using where; Using index
|
||||
prepare stmt1 from @a;
|
||||
execute stmt1;
|
||||
a
|
||||
11
|
||||
13
|
||||
15
|
||||
drop table t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
id int NOT NULL DEFAULT '0',
|
||||
b int NOT NULL DEFAULT '0',
|
||||
c int NOT NULL DEFAULT '0',
|
||||
INDEX idx1(b,c), INDEX idx2(c));
|
||||
INSERT INTO t1(id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
|
||||
INSERT INTO t1(b,c) VALUES (3,4), (3,4);
|
||||
SELECT * FROM t1 WHERE b<=3 AND 3<=c;
|
||||
id b c
|
||||
0 3 4
|
||||
0 3 4
|
||||
SELECT * FROM t1 WHERE 3 BETWEEN b AND c;
|
||||
id b c
|
||||
0 3 4
|
||||
0 3 4
|
||||
EXPLAIN SELECT * FROM t1 WHERE b<=3 AND 3<=c;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range idx1,idx2 idx2 4 NULL 3 Using where
|
||||
EXPLAIN SELECT * FROM t1 WHERE 3 BETWEEN b AND c;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range idx1,idx2 idx2 4 NULL 3 Using where
|
||||
SELECT * FROM t1 WHERE 0 < b OR 0 > c;
|
||||
id b c
|
||||
0 3 4
|
||||
0 3 4
|
||||
SELECT * FROM t1 WHERE 0 NOT BETWEEN b AND c;
|
||||
id b c
|
||||
0 3 4
|
||||
0 3 4
|
||||
EXPLAIN SELECT * FROM t1 WHERE 0 < b OR 0 > c;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge idx1,idx2 idx1,idx2 4,4 NULL 4 Using sort_union(idx1,idx2); Using where
|
||||
EXPLAIN SELECT * FROM t1 WHERE 0 NOT BETWEEN b AND c;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge idx1,idx2 idx1,idx2 4,4 NULL 4 Using sort_union(idx1,idx2); Using where
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user