Loading .bzrignore +2 −0 Original line number Diff line number Diff line Loading @@ -368,3 +368,5 @@ libmysqld/hash_filo.cc libmysqld/sql_unions.cc libmysqld/stacktrace.c sql/share/mysql .gdbinit .vimrc BitKeeper/etc/logging_ok +1 −0 Original line number Diff line number Diff line Loading @@ -20,3 +20,4 @@ tim@threads.polyesthetic.msg tim@work.mysql.com tonu@hundin.mysql.fi tonu@x3.internalnet tim@white.box mysql-test/mysql-test-run.sh +1 −1 Original line number Diff line number Diff line Loading @@ -251,7 +251,7 @@ fi [ -z "$COLUMNS" ] && COLUMNS=80 E=`$EXPR $COLUMNS - 8` #DASH72=`expr substr '------------------------------------------------------------------------' 1 $E` #DASH72=`$EXPR substr '------------------------------------------------------------------------' 1 $E` DASH72=`$ECHO '------------------------------------------------------------------------'|$CUT -c 1-$E` # on source dist, we pick up freshly build executables Loading mysql-test/r/order_by.result +56 −0 Original line number Diff line number Diff line Loading @@ -111,3 +111,59 @@ DateOfAction TransactionID member_id nickname voornaam 1 2 table type possible_keys key key_len ref rows Extra t1 index NULL a 20 NULL 10 Using index a b c 1 NULL NULL 1 NULL b 1 1 NULL 1 1 b 1 1 b 2 0 a 2 0 b 2 1 a 2 1 b 2 1 c table type possible_keys key key_len ref rows Extra t1 index NULL a 20 NULL 10 Using index a b c 2 1 c 2 1 b 2 1 a 2 0 b 2 0 a 1 1 b 1 1 b 1 1 NULL 1 NULL b 1 NULL NULL table type possible_keys key key_len ref rows Extra t1 range a a 20 NULL 2 where used; Using index a b c 1 1 b 1 1 b table type possible_keys key key_len ref rows Extra t1 range a a 4 NULL 5 where used; Using index a b c 1 1 b 1 1 b 1 1 NULL table type possible_keys key key_len ref rows Extra t1 range a a 9 NULL 7 where used; Using index a b c 2 1 c 2 1 b 2 1 a 2 0 b 2 0 a 1 1 b 1 1 b 1 1 NULL table type possible_keys key key_len ref rows Extra t1 range a a 4 NULL 4 where used; Using index a b c 1 1 b 1 1 b 1 1 NULL 1 NULL b 1 NULL NULL mysql-test/t/order_by.test +22 −0 Original line number Diff line number Diff line Loading @@ -205,3 +205,25 @@ select member_id, nickname, voornaam FROM members ORDER by lastchange_datum DESC LIMIT 2; drop table members; create table t1 (a int not null, b int, c varchar(10), key (a, b, c)); insert into t1 values (1, NULL, NULL), (1, NULL, 'b'), (1, 1, NULL), (1, 1, 'b'), (1, 1, 'b'), (2, 0, 'a'), (2, 0, 'b'), (2, 1, 'a'), (2, 1, 'b'), (2, 1, 'c'); explain select * from t1 order by a, b, c; select * from t1 order by a, b, c; explain select * from t1 order by a desc, b desc, c desc; select * from t1 order by a desc, b desc, c desc; # test multiple ranges, NO_MAX_RANGE and EQ_RANGE explain select * from t1 where (a = 1 and b is null and c = 'b') or (a > 2) order by a desc; select * from t1 where (a = 1 and b = 1 and c = 'b') or (a > 2) order by a desc; # test NEAR_MAX, NO_MIN_RANGE explain select * from t1 where a < 2 and b <= 1 order by a desc, b desc; select * from t1 where a < 2 and b <= 1 order by a desc, b desc; # test HA_READ_AFTER_KEY (at the end of the file), NEAR_MIN explain select * from t1 where a between 1 and 3 and b <= 1 order by a desc, b desc; select * from t1 where a between 1 and 3 and b <= 1 order by a desc, b desc; # test HA_READ_AFTER_KEY (in the middle of the file) explain select * from t1 where a between 0 and 1 order by a desc, b desc; select * from t1 where a between 0 and 1 order by a desc, b desc; drop table t1; /* vim:set ft=sql sw=2 noet: */ Loading
.bzrignore +2 −0 Original line number Diff line number Diff line Loading @@ -368,3 +368,5 @@ libmysqld/hash_filo.cc libmysqld/sql_unions.cc libmysqld/stacktrace.c sql/share/mysql .gdbinit .vimrc
BitKeeper/etc/logging_ok +1 −0 Original line number Diff line number Diff line Loading @@ -20,3 +20,4 @@ tim@threads.polyesthetic.msg tim@work.mysql.com tonu@hundin.mysql.fi tonu@x3.internalnet tim@white.box
mysql-test/mysql-test-run.sh +1 −1 Original line number Diff line number Diff line Loading @@ -251,7 +251,7 @@ fi [ -z "$COLUMNS" ] && COLUMNS=80 E=`$EXPR $COLUMNS - 8` #DASH72=`expr substr '------------------------------------------------------------------------' 1 $E` #DASH72=`$EXPR substr '------------------------------------------------------------------------' 1 $E` DASH72=`$ECHO '------------------------------------------------------------------------'|$CUT -c 1-$E` # on source dist, we pick up freshly build executables Loading
mysql-test/r/order_by.result +56 −0 Original line number Diff line number Diff line Loading @@ -111,3 +111,59 @@ DateOfAction TransactionID member_id nickname voornaam 1 2 table type possible_keys key key_len ref rows Extra t1 index NULL a 20 NULL 10 Using index a b c 1 NULL NULL 1 NULL b 1 1 NULL 1 1 b 1 1 b 2 0 a 2 0 b 2 1 a 2 1 b 2 1 c table type possible_keys key key_len ref rows Extra t1 index NULL a 20 NULL 10 Using index a b c 2 1 c 2 1 b 2 1 a 2 0 b 2 0 a 1 1 b 1 1 b 1 1 NULL 1 NULL b 1 NULL NULL table type possible_keys key key_len ref rows Extra t1 range a a 20 NULL 2 where used; Using index a b c 1 1 b 1 1 b table type possible_keys key key_len ref rows Extra t1 range a a 4 NULL 5 where used; Using index a b c 1 1 b 1 1 b 1 1 NULL table type possible_keys key key_len ref rows Extra t1 range a a 9 NULL 7 where used; Using index a b c 2 1 c 2 1 b 2 1 a 2 0 b 2 0 a 1 1 b 1 1 b 1 1 NULL table type possible_keys key key_len ref rows Extra t1 range a a 4 NULL 4 where used; Using index a b c 1 1 b 1 1 b 1 1 NULL 1 NULL b 1 NULL NULL
mysql-test/t/order_by.test +22 −0 Original line number Diff line number Diff line Loading @@ -205,3 +205,25 @@ select member_id, nickname, voornaam FROM members ORDER by lastchange_datum DESC LIMIT 2; drop table members; create table t1 (a int not null, b int, c varchar(10), key (a, b, c)); insert into t1 values (1, NULL, NULL), (1, NULL, 'b'), (1, 1, NULL), (1, 1, 'b'), (1, 1, 'b'), (2, 0, 'a'), (2, 0, 'b'), (2, 1, 'a'), (2, 1, 'b'), (2, 1, 'c'); explain select * from t1 order by a, b, c; select * from t1 order by a, b, c; explain select * from t1 order by a desc, b desc, c desc; select * from t1 order by a desc, b desc, c desc; # test multiple ranges, NO_MAX_RANGE and EQ_RANGE explain select * from t1 where (a = 1 and b is null and c = 'b') or (a > 2) order by a desc; select * from t1 where (a = 1 and b = 1 and c = 'b') or (a > 2) order by a desc; # test NEAR_MAX, NO_MIN_RANGE explain select * from t1 where a < 2 and b <= 1 order by a desc, b desc; select * from t1 where a < 2 and b <= 1 order by a desc, b desc; # test HA_READ_AFTER_KEY (at the end of the file), NEAR_MIN explain select * from t1 where a between 1 and 3 and b <= 1 order by a desc, b desc; select * from t1 where a between 1 and 3 and b <= 1 order by a desc, b desc; # test HA_READ_AFTER_KEY (in the middle of the file) explain select * from t1 where a between 0 and 1 order by a desc, b desc; select * from t1 where a between 0 and 1 order by a desc, b desc; drop table t1; /* vim:set ft=sql sw=2 noet: */