Loading innobase/srv/srv0srv.c +7 −5 Original line number Diff line number Diff line Loading @@ -1677,11 +1677,13 @@ srv_lock_timeout_and_monitor_thread( srv_printf_innodb_monitor(stderr); } if (srv_innodb_status) { mutex_enter(&srv_monitor_file_mutex); rewind(srv_monitor_file); srv_printf_innodb_monitor(srv_monitor_file); os_file_set_eof(srv_monitor_file); mutex_exit(&srv_monitor_file_mutex); } if (srv_print_innodb_tablespace_monitor && difftime(current_time, last_table_monitor_time) > 60) { Loading mysql-test/r/select.result +38 −0 Original line number Diff line number Diff line Loading @@ -2369,3 +2369,41 @@ EXPLAIN SELECT i FROM t1 WHERE i=1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index DROP TABLE t1; create table t1 (a integer, b integer, index(a), index(b)); create table t2 (c integer, d integer, index(c), index(d)); insert into t1 values (1,2), (2,2), (3,2), (4,2); insert into t2 values (1,3), (2,3), (3,4), (4,4); explain select * from t1 left join t2 on a=c where d in (4); table type possible_keys key key_len ref rows Extra t2 ref c,d d 5 const 2 Using where t1 ALL a NULL NULL NULL 3 Using where select * from t1 left join t2 on a=c where d in (4); a b c d 3 2 3 4 4 2 4 4 explain select * from t1 left join t2 on a=c where d = 4; table type possible_keys key key_len ref rows Extra t2 ref c,d d 5 const 2 Using where t1 ALL a NULL NULL NULL 3 Using where select * from t1 left join t2 on a=c where d = 4; a b c d 3 2 3 4 4 2 4 4 drop table t1, t2; CREATE TABLE t1 ( i int(11) NOT NULL default '0', c char(10) NOT NULL default '', PRIMARY KEY (i), UNIQUE KEY c (c) ) TYPE=MyISAM; INSERT INTO t1 VALUES (1,'a'); INSERT INTO t1 VALUES (2,'b'); INSERT INTO t1 VALUES (3,'c'); EXPLAIN SELECT i FROM t1 WHERE i=1; table type possible_keys key key_len ref rows Extra t1 const PRIMARY PRIMARY 4 const 1 Using index EXPLAIN SELECT i FROM t1 WHERE i=1; table type possible_keys key key_len ref rows Extra t1 const PRIMARY PRIMARY 4 const 1 Using index >>>>>>> DROP TABLE t1; mysql-test/t/select.test +14 −0 Original line number Diff line number Diff line Loading @@ -1898,6 +1898,20 @@ select * from t1,t2 where t1.s = t2.s; select * from t2,t3 where t2.s = t3.s; drop table t1, t2, t3; # # Bug #3759 # Both queries should produce identical plans and results. # create table t1 (a integer, b integer, index(a), index(b)); create table t2 (c integer, d integer, index(c), index(d)); insert into t1 values (1,2), (2,2), (3,2), (4,2); insert into t2 values (1,3), (2,3), (3,4), (4,4); explain select * from t1 left join t2 on a=c where d in (4); select * from t1 left join t2 on a=c where d in (4); explain select * from t1 left join t2 on a=c where d = 4; select * from t1 left join t2 on a=c where d = 4; drop table t1, t2; # # Covering index is mentioned in EXPLAIN output for const tables (bug #5333) # Loading scripts/mysql_fix_privilege_tables.sh +1 −1 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ then password=$old_style_password fi cmd="$bindir/mysql -f --user=$user --host=$host" cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" if test ! -z "$password" ; then cmd="$cmd --password=$password" fi Loading sql/item_cmpfunc.cc +1 −1 Original line number Diff line number Diff line Loading @@ -735,7 +735,7 @@ void Item_func_interval::fix_length_and_dec() maybe_null= 0; max_length= 2; used_tables_cache|= row->used_tables(); not_null_tables_cache&= row->not_null_tables(); not_null_tables_cache= row->not_null_tables(); with_sum_func= with_sum_func || row->with_sum_func; const_item_cache&= row->const_item(); } Loading Loading
innobase/srv/srv0srv.c +7 −5 Original line number Diff line number Diff line Loading @@ -1677,11 +1677,13 @@ srv_lock_timeout_and_monitor_thread( srv_printf_innodb_monitor(stderr); } if (srv_innodb_status) { mutex_enter(&srv_monitor_file_mutex); rewind(srv_monitor_file); srv_printf_innodb_monitor(srv_monitor_file); os_file_set_eof(srv_monitor_file); mutex_exit(&srv_monitor_file_mutex); } if (srv_print_innodb_tablespace_monitor && difftime(current_time, last_table_monitor_time) > 60) { Loading
mysql-test/r/select.result +38 −0 Original line number Diff line number Diff line Loading @@ -2369,3 +2369,41 @@ EXPLAIN SELECT i FROM t1 WHERE i=1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index DROP TABLE t1; create table t1 (a integer, b integer, index(a), index(b)); create table t2 (c integer, d integer, index(c), index(d)); insert into t1 values (1,2), (2,2), (3,2), (4,2); insert into t2 values (1,3), (2,3), (3,4), (4,4); explain select * from t1 left join t2 on a=c where d in (4); table type possible_keys key key_len ref rows Extra t2 ref c,d d 5 const 2 Using where t1 ALL a NULL NULL NULL 3 Using where select * from t1 left join t2 on a=c where d in (4); a b c d 3 2 3 4 4 2 4 4 explain select * from t1 left join t2 on a=c where d = 4; table type possible_keys key key_len ref rows Extra t2 ref c,d d 5 const 2 Using where t1 ALL a NULL NULL NULL 3 Using where select * from t1 left join t2 on a=c where d = 4; a b c d 3 2 3 4 4 2 4 4 drop table t1, t2; CREATE TABLE t1 ( i int(11) NOT NULL default '0', c char(10) NOT NULL default '', PRIMARY KEY (i), UNIQUE KEY c (c) ) TYPE=MyISAM; INSERT INTO t1 VALUES (1,'a'); INSERT INTO t1 VALUES (2,'b'); INSERT INTO t1 VALUES (3,'c'); EXPLAIN SELECT i FROM t1 WHERE i=1; table type possible_keys key key_len ref rows Extra t1 const PRIMARY PRIMARY 4 const 1 Using index EXPLAIN SELECT i FROM t1 WHERE i=1; table type possible_keys key key_len ref rows Extra t1 const PRIMARY PRIMARY 4 const 1 Using index >>>>>>> DROP TABLE t1;
mysql-test/t/select.test +14 −0 Original line number Diff line number Diff line Loading @@ -1898,6 +1898,20 @@ select * from t1,t2 where t1.s = t2.s; select * from t2,t3 where t2.s = t3.s; drop table t1, t2, t3; # # Bug #3759 # Both queries should produce identical plans and results. # create table t1 (a integer, b integer, index(a), index(b)); create table t2 (c integer, d integer, index(c), index(d)); insert into t1 values (1,2), (2,2), (3,2), (4,2); insert into t2 values (1,3), (2,3), (3,4), (4,4); explain select * from t1 left join t2 on a=c where d in (4); select * from t1 left join t2 on a=c where d in (4); explain select * from t1 left join t2 on a=c where d = 4; select * from t1 left join t2 on a=c where d = 4; drop table t1, t2; # # Covering index is mentioned in EXPLAIN output for const tables (bug #5333) # Loading
scripts/mysql_fix_privilege_tables.sh +1 −1 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ then password=$old_style_password fi cmd="$bindir/mysql -f --user=$user --host=$host" cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" if test ! -z "$password" ; then cmd="$cmd --password=$password" fi Loading
sql/item_cmpfunc.cc +1 −1 Original line number Diff line number Diff line Loading @@ -735,7 +735,7 @@ void Item_func_interval::fix_length_and_dec() maybe_null= 0; max_length= 2; used_tables_cache|= row->used_tables(); not_null_tables_cache&= row->not_null_tables(); not_null_tables_cache= row->not_null_tables(); with_sum_func= with_sum_func || row->with_sum_func; const_item_cache&= row->const_item(); } Loading