From 71fdef4d10b5eda9bec9743fc457cb8629e93344 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Oct 2005 06:29:17 +0400 Subject: BUG#9622, stage 2, work together with fix for BUG#12232: added "nulls_ignored" index statistics collection method for MyISAM tables. (notification trigger: this is about BUG#9622). include/my_base.h: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method: Added SEARCH_RETURN_B_POS flag for ha_key_cmp() include/my_handler.h: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method: added ha_find_null() include/myisam.h: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method. myisam/mi_check.c: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method, added mi_collect_stats_*(), updated update_key_parts() to deal with all 3 methods. myisam/myisamchk.c: BUG#9622: Added nulls_ignored index statistics collection method for MyISAM myisam/myisamdef.h: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method. myisam/sort.c: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method. mysql-test/r/myisam.result: Testcase for BUG9622 mysql-test/t/myisam.test: Testcase for BUG9622 mysys/my_handler.c: BUG#9622: ha_key_cmp() now supports new SEARCH_RETURN_B_POS flag, added ha_find_null() sql/ha_myisam.cc: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method. sql/mysqld.cc: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method. --- sql/mysqld.cc | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a6a91ac32ee..4a0394247e3 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5212,7 +5212,8 @@ The minimum value for this variable is 4096.", GET_ULONG, REQUIRED_ARG, 8192*1024, 4, ~0L, 0, 1, 0}, {"myisam_stats_method", OPT_MYISAM_STATS_METHOD, "Specifies how MyISAM index statistics collection code should threat NULLs. " - "Possible values of name are \"nulls_unequal\" (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), " + "\"nulls_equal\" (emulate 4.0 behavior), and \"nulls_ignored\".", (gptr*) &myisam_stats_method_str, (gptr*) &myisam_stats_method_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"net_buffer_length", OPT_NET_BUFFER_LENGTH, @@ -6405,16 +6406,26 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } case OPT_MYISAM_STATS_METHOD: { - myisam_stats_method_str= argument; int method; + ulong method_conv; + myisam_stats_method_str= argument; if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0) { fprintf(stderr, "Invalid value of myisam_stats_method: %s.\n", argument); exit(1); } - global_system_variables.myisam_stats_method= - test(method-1)? MI_STATS_METHOD_NULLS_EQUAL : - MI_STATS_METHOD_NULLS_NOT_EQUAL; + switch (method-1) { + case 0: + method_conv= MI_STATS_METHOD_NULLS_EQUAL; + break; + case 1: + method_conv= MI_STATS_METHOD_NULLS_NOT_EQUAL; + break; + case 2: + method_conv= MI_STATS_METHOD_IGNORE_NULLS; + break; + } + global_system_variables.myisam_stats_method= method_conv; break; } case OPT_SQL_MODE: -- cgit v1.2.1