diff options
author | Bjorn Munch <bjorn.munch@oracle.com> | 2010-08-30 11:26:40 +0200 |
---|---|---|
committer | Bjorn Munch <bjorn.munch@oracle.com> | 2010-08-30 11:26:40 +0200 |
commit | 6d2ff118bc152f3d785c7275c8fa267543bf91cb (patch) | |
tree | d2b380a1baa8283ff97dbe30b9fc09e531974bac | |
parent | 93b8156365630192ede711f4b5a33b8adf9cddd4 (diff) | |
parent | 788b4e404bbd97ff6b215ae55633e0971f8d19d6 (diff) | |
download | mariadb-git-6d2ff118bc152f3d785c7275c8fa267543bf91cb.tar.gz |
merge 55413
-rw-r--r-- | client/mysqltest.cc | 10 | ||||
-rw-r--r-- | mysql-test/r/mysqltest.result | 3 | ||||
-rw-r--r-- | mysql-test/t/mysqltest.test | 10 |
3 files changed, 21 insertions, 2 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 756208a0f96..b7b7ad25d23 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -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"); @@ -5580,9 +5582,13 @@ int read_line(char *buf, int size) } else if (c == '\'' || c == '"' || c == '`') { - last_quote= c; - state= R_Q; + if (! have_slash) + { + last_quote= c; + state= R_Q; + } } + have_slash= (c == '\\'); break; case R_COMMENT: diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index e4f68d68c3f..1044127b06e 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -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 diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 031c51a0720..9da19ec00e0 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -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 |