From 86c36aa1fd05c510b036dcc8573e68b58549742d Mon Sep 17 00:00:00 2001 From: He Zhenxing Date: Fri, 2 Oct 2009 16:25:53 +0800 Subject: Backport BUG#25192 Using relay-log and relay-log-index without values produces unexpected results. Options loaded from config files were added before command line arguments, and they were parsed together, which could interprete the following: option-a option-b as --option-a=--option-b if 'option-a' requires a value, and caused confusing. Because all options that requires a value are always given in the form '--option=value', so it's an error if there is no '=value' part for such an option read from config file. This patch added a separator to separate the arguments from config files and that from command line, so that they can be handled differently. And report an error for options loaded from config files that requires a value and is not given in the form '--option=value'. --- sql-common/client.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql-common') diff --git a/sql-common/client.c b/sql-common/client.c index 84029b449af..cbed3a5e2a8 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1053,6 +1053,8 @@ void mysql_read_default_options(struct st_mysql_options *options, char **option=argv; while (*++option) { + if (option[0] == args_separator) /* skip arguments separator */ + continue; /* DBUG_PRINT("info",("option: %s",option[0])); */ if (option[0][0] == '-' && option[0][1] == '-') { -- cgit v1.2.1