diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2010-11-22 12:21:10 +0300 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2010-11-22 12:21:10 +0300 |
commit | 65116d34089d977929f36542522e79d05786094d (patch) | |
tree | 855936cec6d3b0afd67eb17131c2c9c1133e3d82 /client | |
parent | e4d2fd35a7333fb6a9c92c6439b4c4123983ccde (diff) | |
parent | a6294cd5cbd02c48b28fe8b380f8c259f14f9d8c (diff) | |
download | mariadb-git-65116d34089d977929f36542522e79d05786094d.tar.gz |
Manual-merge from mysql-5.1-bugteam.
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 b473169b58b..0b565ff9394 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; @@ -5441,7 +5442,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, ')'); |