Loading myisam/mi_check.c +1 −1 Original line number Diff line number Diff line Loading @@ -3994,7 +3994,7 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, ... The 'unique' array is collected in one sequential scan through the entire index. This is done in two places: in chk_index() and in sort_key_write(). Statistics collection may consider NULLs as either equal or inequal (see Statistics collection may consider NULLs as either equal or unequal (see SEARCH_NULL_ARE_NOT_EQUAL, MI_STATS_METHOD_*). Output is an array: Loading myisam/myisamchk.c +3 −3 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ static const char *field_pack[]= "no zeros", "blob", "constant", "table-lockup", "always zero","varchar","unique-hash","?","?"}; static const char *myisam_stats_method_str="nulls_inequal"; static const char *myisam_stats_method_str="nulls_unequal"; static void get_options(int *argc,char * * *argv); static void print_version(void); Loading Loading @@ -339,7 +339,7 @@ static struct my_option my_long_options[] = REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"stats_method", OPT_STATS_METHOD, "Specifies how index statistics collection code should threat NULLs. " "Possible values of name are \"nulls_inequal\" (default behavior for 4.1/5.0), and \"nulls_equal\" (emulate 4.0 behavior).", "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), and \"nulls_equal\" (emulate 4.0 behavior).", (gptr*) &myisam_stats_method_str, (gptr*) &myisam_stats_method_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} Loading Loading @@ -471,7 +471,7 @@ static void usage(void) #include <help_end.h> const char *myisam_stats_method_names[] = {"nulls_inequal", "nulls_equal", const char *myisam_stats_method_names[] = {"nulls_unequal", "nulls_equal", NullS}; TYPELIB myisam_stats_method_typelib= { array_elements(myisam_stats_method_names) - 1, "", Loading mysql-test/r/func_in.result +9 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,15 @@ select * from t1 where a in (NULL, 'aa'); a aa drop table t1; create table t1 (id int, key(id)); insert into t1 values (1),(2),(3); select count(*) from t1 where id not in (1); count(*) 2 select count(*) from t1 where id not in (1,2); count(*) 1 drop table t1; CREATE TABLE t1 (a int PRIMARY KEY); INSERT INTO t1 VALUES (44), (45), (46); SELECT * FROM t1 WHERE a IN (45); Loading mysql-test/r/myisam.result +2 −2 Original line number Diff line number Diff line Loading @@ -610,7 +610,7 @@ test.t2 984116287 drop table t1, t2; show variables like 'myisam_stats_method'; Variable_name Value myisam_stats_method nulls_inequal myisam_stats_method nulls_unequal create table t1 (a int, key(a)); insert into t1 values (0),(1),(2),(3),(4); insert into t1 select NULL from t1; Loading Loading @@ -651,7 +651,7 @@ t1 1 a 1 a A 5 NULL NULL YES BTREE set myisam_stats_method=DEFAULT; show variables like 'myisam_stats_method'; Variable_name Value myisam_stats_method nulls_inequal myisam_stats_method nulls_unequal insert into t1 values (11); delete from t1 where a=11; analyze table t1; Loading mysql-test/t/func_in.test +7 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,13 @@ insert into t1 values ('aa'), ('bb'); select * from t1 where a in (NULL, 'aa'); drop table t1; # BUG#13419 create table t1 (id int, key(id)); insert into t1 values (1),(2),(3); select count(*) from t1 where id not in (1); select count(*) from t1 where id not in (1,2); drop table t1; # End of 4.1 tests # Loading Loading
myisam/mi_check.c +1 −1 Original line number Diff line number Diff line Loading @@ -3994,7 +3994,7 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, ... The 'unique' array is collected in one sequential scan through the entire index. This is done in two places: in chk_index() and in sort_key_write(). Statistics collection may consider NULLs as either equal or inequal (see Statistics collection may consider NULLs as either equal or unequal (see SEARCH_NULL_ARE_NOT_EQUAL, MI_STATS_METHOD_*). Output is an array: Loading
myisam/myisamchk.c +3 −3 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ static const char *field_pack[]= "no zeros", "blob", "constant", "table-lockup", "always zero","varchar","unique-hash","?","?"}; static const char *myisam_stats_method_str="nulls_inequal"; static const char *myisam_stats_method_str="nulls_unequal"; static void get_options(int *argc,char * * *argv); static void print_version(void); Loading Loading @@ -339,7 +339,7 @@ static struct my_option my_long_options[] = REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"stats_method", OPT_STATS_METHOD, "Specifies how index statistics collection code should threat NULLs. " "Possible values of name are \"nulls_inequal\" (default behavior for 4.1/5.0), and \"nulls_equal\" (emulate 4.0 behavior).", "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), and \"nulls_equal\" (emulate 4.0 behavior).", (gptr*) &myisam_stats_method_str, (gptr*) &myisam_stats_method_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} Loading Loading @@ -471,7 +471,7 @@ static void usage(void) #include <help_end.h> const char *myisam_stats_method_names[] = {"nulls_inequal", "nulls_equal", const char *myisam_stats_method_names[] = {"nulls_unequal", "nulls_equal", NullS}; TYPELIB myisam_stats_method_typelib= { array_elements(myisam_stats_method_names) - 1, "", Loading
mysql-test/r/func_in.result +9 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,15 @@ select * from t1 where a in (NULL, 'aa'); a aa drop table t1; create table t1 (id int, key(id)); insert into t1 values (1),(2),(3); select count(*) from t1 where id not in (1); count(*) 2 select count(*) from t1 where id not in (1,2); count(*) 1 drop table t1; CREATE TABLE t1 (a int PRIMARY KEY); INSERT INTO t1 VALUES (44), (45), (46); SELECT * FROM t1 WHERE a IN (45); Loading
mysql-test/r/myisam.result +2 −2 Original line number Diff line number Diff line Loading @@ -610,7 +610,7 @@ test.t2 984116287 drop table t1, t2; show variables like 'myisam_stats_method'; Variable_name Value myisam_stats_method nulls_inequal myisam_stats_method nulls_unequal create table t1 (a int, key(a)); insert into t1 values (0),(1),(2),(3),(4); insert into t1 select NULL from t1; Loading Loading @@ -651,7 +651,7 @@ t1 1 a 1 a A 5 NULL NULL YES BTREE set myisam_stats_method=DEFAULT; show variables like 'myisam_stats_method'; Variable_name Value myisam_stats_method nulls_inequal myisam_stats_method nulls_unequal insert into t1 values (11); delete from t1 where a=11; analyze table t1; Loading
mysql-test/t/func_in.test +7 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,13 @@ insert into t1 values ('aa'), ('bb'); select * from t1 where a in (NULL, 'aa'); drop table t1; # BUG#13419 create table t1 (id int, key(id)); insert into t1 values (1),(2),(3); select count(*) from t1 where id not in (1); select count(*) from t1 where id not in (1,2); drop table t1; # End of 4.1 tests # Loading