summaryrefslogtreecommitdiff
path: root/myisam/myisamchk.c
diff options
context:
space:
mode:
authorunknown <jani@ua141d10.elisa.omakaista.fi>2005-10-27 23:43:20 +0300
committerunknown <jani@ua141d10.elisa.omakaista.fi>2005-10-27 23:43:20 +0300
commit7911c50718fa27c2fa56e99d765b54267481a8d2 (patch)
treeff71298ae3c57caff8ca7c70666d60292290e366 /myisam/myisamchk.c
parent6196a746116b4de60414f717eabcc243a7a3beb6 (diff)
parent987c33a97501ccd064ee2e68df44ad1d1e4618e6 (diff)
downloadmariadb-git-7911c50718fa27c2fa56e99d765b54267481a8d2.tar.gz
Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1
into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-tmp heap/_check.c: Auto merged heap/hp_create.c: Auto merged include/config-netware.h: Auto merged include/my_base.h: Auto merged include/my_handler.h: Auto merged include/myisam.h: Auto merged innobase/include/Makefile.am: Auto merged myisam/mi_check.c: Auto merged myisam/mi_delete.c: Auto merged myisam/mi_rnext_same.c: Auto merged myisam/mi_search.c: Auto merged myisam/mi_write.c: Auto merged myisam/myisamdef.h: Auto merged myisam/sort.c: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/date_formats.result: Auto merged mysql-test/r/update.result: Auto merged mysql-test/t/date_formats.test: Auto merged mysql-test/t/select.test: Auto merged mysql-test/t/update.test: Auto merged mysys/my_getopt.c: Auto merged mysys/my_handler.c: Auto merged scripts/make_binary_distribution.sh: Auto merged sql/ha_myisam.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/records.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_select.cc: Auto merged sql/structs.h: Auto merged strings/conf_to_src.c: Auto merged strings/ctype-win1250ch.c: Auto merged Makefile.am: Merged from 4.1 myisam/myisamchk.c: Merged from 4.1 mysql-test/mysql-test-run.pl: Merged from 4.1 mysql-test/r/insert_select.result: Merged from 4.1 mysql-test/r/myisam.result: Merged from 4.1 mysql-test/r/select.result: Merged from 4.1 mysql-test/t/insert_select.test: Merged from 4.1 mysql-test/t/myisam.test: Merged from 4.1 netware/mysql_test_run.c: Merged from 4.1 sql/item.cc: Merged from 4.1 sql/mysqld.cc: Merged from 4.1 sql/sql_update.cc: Merged from 4.1 tests/mysql_client_test.c: Merged from 4.1
Diffstat (limited to 'myisam/myisamchk.c')
-rw-r--r--myisam/myisamchk.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index a90495e5fcb..b3d95d21eb7 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -339,7 +339,8 @@ 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_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},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
@@ -451,6 +452,10 @@ static void usage(void)
-a, --analyze Analyze distribution of keys. Will make some joins in\n\
MySQL faster. You can check the calculated distribution\n\
by using '--description --verbose table_name'.\n\
+ --stats_method=name Specifies how index statistics collection code should\n\
+ threat NULLs. Possible values of name are \"nulls_unequal\"\n\
+ (default for 4.1/5.0), \"nulls_equal\" (emulate 4.0), and \n\
+ \"nulls_ignored\".\n\
-d, --description Prints some information about table.\n\
-A, --set-auto-increment[=value]\n\
Force auto_increment to start at this or higher value\n\
@@ -472,7 +477,7 @@ static void usage(void)
#include <help_end.h>
const char *myisam_stats_method_names[] = {"nulls_unequal", "nulls_equal",
- NullS};
+ "nulls_ignored", NullS};
TYPELIB myisam_stats_method_typelib= {
array_elements(myisam_stats_method_names) - 1, "",
myisam_stats_method_names, NULL};
@@ -699,13 +704,25 @@ get_one_option(int optid,
case OPT_STATS_METHOD:
{
int method;
+ enum_mi_stats_method method_conv;
myisam_stats_method_str= argument;
if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0)
{
fprintf(stderr, "Invalid value of stats_method: %s.\n", argument);
exit(1);
}
- check_param.stats_method= (enum_mi_stats_method) (method-1);
+ 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;
+ }
+ check_param.stats_method= method_conv;
break;
}
#ifdef DEBUG /* Only useful if debugging */