summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorHe Zhenxing <zhenxing.he@sun.com>2009-10-02 16:25:53 +0800
committerHe Zhenxing <zhenxing.he@sun.com>2009-10-02 16:25:53 +0800
commit9739efbfec4c069996cf2f46f165e555a7edf30f (patch)
tree579cf79cc98b55b5b950b8325984464a251a362b /storage
parentbb6953d1d80e5fef2e333e0a4147aa5a43e809ab (diff)
downloadmariadb-git-9739efbfec4c069996cf2f46f165e555a7edf30f.tar.gz
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'.
Diffstat (limited to 'storage')
-rw-r--r--storage/ndb/test/run-test/setup.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/storage/ndb/test/run-test/setup.cpp b/storage/ndb/test/run-test/setup.cpp
index cbb7a34f171..60f8285888c 100644
--- a/storage/ndb/test/run-test/setup.cpp
+++ b/storage/ndb/test/run-test/setup.cpp
@@ -105,6 +105,8 @@ setup_config(atrt_config& config)
*/
for (j = 0; j<(size_t)argc; j++)
{
+ if (tmp[j] == args_separator) /* skip arguments separator */
+ continue;
for (k = 0; proc_args[k].name; k++)
{
if (!strncmp(tmp[j], proc_args[k].name, strlen(proc_args[k].name)))
@@ -369,6 +371,12 @@ load_options(int argc, char** argv, int type, atrt_options& opts)
{
for (size_t i = 0; i<(size_t)argc; i++)
{
+ /**
+ * Skip the separator for arguments from config file and command
+ * line
+ */
+ if (argv[i] == args_separator)
+ continue;
for (size_t j = 0; f_options[j].name; j++)
{
const char * name = f_options[j].name;