summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-06-27 13:25:50 +0200
committerSergei Golubchik <serg@mariadb.org>2017-06-27 13:25:50 +0200
commit39385ff7b253302723a94c896d199a83adb8622f (patch)
treee6b46b320c7f2cd17cab59ec3934e8b084feb95d /client
parentded614d7dbc930e373d1a69a0d2a7e4bf0a2c6d3 (diff)
downloadmariadb-git-39385ff7b253302723a94c896d199a83adb8622f.tar.gz
MDEV-13187 incorrect backslash parsing in clients
don't do backslash escapes inside backticks
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc4
-rw-r--r--client/mysqltest.cc4
2 files changed, 4 insertions, 4 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 57cb0a918a7..6a800e407a3 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -2287,8 +2287,8 @@ static bool add_line(String &buffer, char *line, ulong line_length,
continue;
}
#endif
- if (!*ml_comment && inchar == '\\' &&
- !(*in_string &&
+ if (!*ml_comment && inchar == '\\' && *in_string != '`' &&
+ !(*in_string &&
(mysql.server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES)))
{
// Found possbile one character command like \c
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 4de40953f7d..ee636c9401d 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -6594,7 +6594,7 @@ int read_line(char *buf, int size)
state= R_Q;
}
}
- have_slash= (c == '\\');
+ have_slash= (c == '\\' && last_quote != '`');
break;
case R_COMMENT:
@@ -6664,7 +6664,7 @@ int read_line(char *buf, int size)
case R_Q:
if (c == last_quote)
state= R_NORMAL;
- else if (c == '\\')
+ else if (c == '\\' && last_quote != '`')
state= R_SLASH_IN_Q;
break;