summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorBjorn Munch <bjorn.munch@oracle.com>2010-11-26 10:57:01 +0100
committerBjorn Munch <bjorn.munch@oracle.com>2010-11-26 10:57:01 +0100
commit20851e401265e6203aed6a5d979e9ac89e93f5d5 (patch)
tree480b8b293100c58a415bdba7b0f48d490d086b89 /client
parent08c9f317eeaefd864186ec12ef82d9c57f516013 (diff)
downloadmariadb-git-20851e401265e6203aed6a5d979e9ac89e93f5d5.tar.gz
Bug #58412 mysqltest: allow quoting of strings in let and in if comparison
Stripping quotes in let was a bad idea, will not fix Added code to strip quotes from rhs in comparisons
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 459abf8ffe1..dfd383cc714 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -5678,6 +5678,17 @@ void do_block(enum block_cmd cmd, struct st_command* command)
while (my_isspace(charset_info, *curr_ptr))
curr_ptr++;
+ /* Strip off trailing white space */
+ while (my_isspace(charset_info, expr_end[-1]))
+ expr_end--;
+ /* strip off ' or " around the string */
+ if (*curr_ptr == '\'' || *curr_ptr == '"')
+ {
+ if (expr_end[-1] != *curr_ptr)
+ die("Unterminated string value");
+ curr_ptr++;
+ expr_end--;
+ }
VAR v2;
var_init(&v2,0,0,0,0);
eval_expr(&v2, curr_ptr, &expr_end);