diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-02-06 14:50:50 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-02-06 14:50:50 +0100 |
commit | 4771ae4b22d2bdef0aafc563570c71d4636a2493 (patch) | |
tree | d115bd7c68b1e6feab68ff6fcd547e0c86c79296 /client/mysql.cc | |
parent | 60f51af755ea9d07c20a596ba21de184816fa265 (diff) | |
parent | 0c25e58db6b045df92c209d396031cac5b528bbf (diff) | |
download | mariadb-git-4771ae4b22d2bdef0aafc563570c71d4636a2493.tar.gz |
Merge branch 'github/10.1' into 10.2
Diffstat (limited to 'client/mysql.cc')
-rw-r--r-- | client/mysql.cc | 12 |
1 files changed, 7 insertions, 5 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) |