Commit 6d2ff118 authored by Bjorn Munch's avatar Bjorn Munch

merge 55413

parents 93b81563 788b4e40
......@@ -5509,6 +5509,8 @@ int read_line(char *buf, int size)
char c, UNINIT_VAR(last_quote);
char *p= buf, *buf_end= buf + size - 1;
int skip_char= 0;
my_bool have_slash= FALSE;
enum {R_NORMAL, R_Q, R_SLASH_IN_Q,
R_COMMENT, R_LINE_START} state= R_LINE_START;
DBUG_ENTER("read_line");
......@@ -5579,10 +5581,14 @@ int read_line(char *buf, int size)
DBUG_RETURN(0);
}
else if (c == '\'' || c == '"' || c == '`')
{
if (! have_slash)
{
last_quote= c;
state= R_Q;
}
}
have_slash= (c == '\\');
break;
case R_COMMENT:
......
......@@ -262,6 +262,9 @@ a long \$where variable content
banana = banana
Not a banana: ba\$cat\$cat
with\`some"escaped\'quotes
with\`some"escaped\'quotes
single'tick`backtick
mysqltest: At line 1: Missing arguments to let
mysqltest: At line 1: Missing variable name in let
mysqltest: At line 1: Missing assignment operator in let
......
......@@ -701,6 +701,16 @@ echo banana = $cat;
let $cat=ba\\\$cat\\\$cat;
echo Not a banana: $cat;
# Bug #55413 would cause this to fail
let $escape= with\`some\"escaped\'quotes;
echo $escape;
--let $escape= with\`some\"escaped\'quotes
echo $escape;
# This only works with "--let" syntax
--let $tick= single'tick`backtick
echo $tick;
# Test illegal uses of let
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment