summaryrefslogtreecommitdiff
path: root/client/mysql.cc
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2018-01-24 12:29:31 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2018-01-24 12:29:31 +0200
commitd833bb65d53b9a4375fa71cc485b4719fdb0ee53 (patch)
treed1271339e1c3a660e4788a5c9913bfe54e0271f1 /client/mysql.cc
parente431d90065d277e62fa4f81a1654790f58a84146 (diff)
parent76577e1e2602f3c30859a176808c433a263e1b0a (diff)
downloadmariadb-git-d833bb65d53b9a4375fa71cc485b4719fdb0ee53.tar.gz
Merge remote-tracking branch '5.5' into 10.0
Diffstat (limited to 'client/mysql.cc')
-rw-r--r--client/mysql.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 9f7ad685d05..4f6c313d3c5 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -4593,8 +4593,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)