#At file:///home/bm136801/my/letbs-51/ based on revid:bjorn.bunch@stripped
2924 Bjorn Munch 2010-08-10
Bug #55413 mysqltest gives parse error for lines matching "^let.*\\.*;$"
Allow escaped quotes also in statements not starting with --
But will not support single unescaped ' or `
modified:
client/mysqltest.cc
mysql-test/r/mysqltest.result
mysql-test/t/mysqltest.test
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc 2010-08-04 10:19:51 +0000
+++ b/client/mysqltest.cc 2010-08-10 10:13:58 +0000
@@ -5507,6 +5507,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");
@@ -5578,9 +5580,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:
=== modified file 'mysql-test/r/mysqltest.result'
--- a/mysql-test/r/mysqltest.result 2010-08-04 08:52:45 +0000
+++ b/mysql-test/r/mysqltest.result 2010-08-10 10:13:58 +0000
@@ -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
=== modified file 'mysql-test/t/mysqltest.test'
--- a/mysql-test/t/mysqltest.test 2010-08-04 08:52:45 +0000
+++ b/mysql-test/t/mysqltest.test 2010-08-10 10:13:58 +0000
@@ -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
Attachment: [text/bzr-bundle] bzr/bjorn.munch@oracle.com-20100810101358-et8m8inu6hjjcfqi.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-mtr branch (bjorn.munch:2924) Bug#55413 | Bjorn Munch | 10 Aug |