diff options
author | Bjorn Munch <bjorn.munch@oracle.com> | 2010-11-19 10:29:08 +0100 |
---|---|---|
committer | Bjorn Munch <bjorn.munch@oracle.com> | 2010-11-19 10:29:08 +0100 |
commit | 6580097adcaa76006256720561e77451897b743d (patch) | |
tree | a244d63dc8101e48cce08269438b1d71696652aa /client | |
parent | cae834561ec1a650fe0614a21c915a2c2cc3b139 (diff) | |
parent | 32ea070845fd4196ad5d9e5ffc4ce64b736c9869 (diff) | |
download | mariadb-git-6580097adcaa76006256720561e77451897b743d.tar.gz |
merge from 5.1-mtr
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 35ceaaaa5de..4e03ad27246 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -471,7 +471,7 @@ VAR* var_init(VAR* v, const char *name, int name_len, const char *val, void var_free(void* v); VAR* var_get(const char *var_name, const char** var_name_end, my_bool raw, my_bool ignore_not_existing); -void eval_expr(VAR* v, const char *p, const char** p_end); +void eval_expr(VAR* v, const char *p, const char** p_end, bool backtick= true); my_bool match_delimiter(int c, const char *delim, uint length); void dump_result_to_reject_file(char *buf, int size); void dump_warning_messages(); @@ -2233,7 +2233,8 @@ void var_query_set(VAR *var, const char *query, const char** query_end) dynstr_append_mem(&result, "\t", 1); } end= result.str + result.length-1; - eval_expr(var, result.str, (const char**) &end); + /* Evaluation should not recurse via backtick */ + eval_expr(var, result.str, (const char**) &end, false); dynstr_free(&result); } else @@ -2389,7 +2390,7 @@ void var_copy(VAR *dest, VAR *src) } -void eval_expr(VAR *v, const char *p, const char **p_end) +void eval_expr(VAR *v, const char *p, const char **p_end, bool backtick) { DBUG_ENTER("eval_expr"); @@ -2414,7 +2415,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end) DBUG_VOID_RETURN; } - if (*p == '`') + if (*p == '`' && backtick) { var_query_set(v, p, p_end); DBUG_VOID_RETURN; @@ -5439,7 +5440,9 @@ void do_block(enum block_cmd cmd, struct st_command* command) if (*expr_start == '!') { not_expr= TRUE; - expr_start++; /* Step past the '!' */ + expr_start++; /* Step past the '!', then any whitespace */ + while (*expr_start && my_isspace(charset_info, *expr_start)) + expr_start++; } /* Find ending ')' */ expr_end= strrchr(expr_start, ')'); |