summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-02-06 14:50:50 +0100
committerSergei Golubchik <serg@mariadb.org>2018-02-06 14:50:50 +0100
commit4771ae4b22d2bdef0aafc563570c71d4636a2493 (patch)
treed115bd7c68b1e6feab68ff6fcd547e0c86c79296 /client
parent60f51af755ea9d07c20a596ba21de184816fa265 (diff)
parent0c25e58db6b045df92c209d396031cac5b528bbf (diff)
downloadmariadb-git-4771ae4b22d2bdef0aafc563570c71d4636a2493.tar.gz
Merge branch 'github/10.1' into 10.2
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc12
-rw-r--r--client/mysqltest.cc4
2 files changed, 7 insertions, 9 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 90357da358c..9e50bb86933 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1140,6 +1140,7 @@ int main(int argc,char *argv[])
current_prompt = my_strdup(default_prompt,MYF(MY_WME));
prompt_counter=0;
aborted= 0;
+ sf_leaking_memory= 1; /* no memory leak reports yet */
outfile[0]=0; // no (default) outfile
strmov(pager, "stdout"); // the default, if --pager wasn't given
@@ -1205,6 +1206,7 @@ int main(int argc,char *argv[])
my_end(0);
exit(1);
}
+ sf_leaking_memory= 0;
glob_buffer.realloc(512);
completion_hash_init(&ht, 128);
init_alloc_root(&hash_mem_root, 16384, 0, MYF(0));
@@ -1799,10 +1801,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
#ifndef EMBEDDED_LIBRARY
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
- {
- sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
- }
#endif
break;
case OPT_SERVER_ARG:
@@ -4597,8 +4596,11 @@ static char *get_arg(char *line, get_arg_mode mode)
}
for (start=ptr ; *ptr; ptr++)
{
- if ((*ptr == '\\' && ptr[1]) || // escaped character
- (!short_cmd && qtype && *ptr == qtype && ptr[1] == qtype)) // quote
+ /* if short_cmd use historical rules (only backslash) otherwise SQL rules */
+ if (short_cmd
+ ? (*ptr == '\\' && ptr[1]) // escaped character
+ : (*ptr == '\\' && ptr[1] && qtype != '`') || // escaped character
+ (qtype && *ptr == qtype && ptr[1] == qtype)) // quote
{
// Remove (or skip) the backslash (or a second quote)
if (mode != CHECK)
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 55a2b1ec43a..4c8d4750a23 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -1566,7 +1566,6 @@ static void cleanup_and_exit(int exit_code)
}
}
- sf_leaking_memory= 0; /* all memory should be freed by now */
exit(exit_code);
}
@@ -7293,10 +7292,7 @@ get_one_option(int optid, const struct my_option *opt, char *argument)
#ifndef EMBEDDED_LIBRARY
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
- {
- sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
- }
#endif
break;
case '?':