summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorBjorn Munch <bjorn.munch@oracle.com>2011-01-11 15:15:25 +0100
committerBjorn Munch <bjorn.munch@oracle.com>2011-01-11 15:15:25 +0100
commit8937cbd5ae593cc29b1473e18a0168e285f6fbff (patch)
tree2d39b6be598dc212c963ecd9651ec3292cfcd39b /client
parent83fea27b6124f9743a752f5d5cf3bea94763c9d9 (diff)
parente2b73747df97f7a739000671aa2454482b23f1d2 (diff)
downloadmariadb-git-8937cbd5ae593cc29b1473e18a0168e285f6fbff.tar.gz
upmerge 58896,58900,59002
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.cc40
1 files changed, 27 insertions, 13 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index f266197116b..63e74cf0b32 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -488,7 +488,7 @@ VAR* var_init(VAR* v, const char *name, int name_len, const char *val,
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,
- bool open_end=false, bool backtick=true);
+ bool open_end=false, bool do_eval=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();
@@ -1318,6 +1318,17 @@ static void cleanup_and_exit(int exit_code)
exit(exit_code);
}
+void print_file_stack()
+{
+ for (struct st_test_file* err_file= cur_file;
+ err_file != file_stack;
+ err_file--)
+ {
+ fprintf(stderr, "included from %s at line %d:\n",
+ err_file->file_name, err_file->lineno);
+ }
+}
+
void die(const char *fmt, ...)
{
static int dying= 0;
@@ -1337,8 +1348,12 @@ void die(const char *fmt, ...)
/* Print the error message */
fprintf(stderr, "mysqltest: ");
if (cur_file && cur_file != file_stack)
- fprintf(stderr, "In included file \"%s\": ",
+ {
+ fprintf(stderr, "In included file \"%s\": \n",
cur_file->file_name);
+ print_file_stack();
+ }
+
if (start_lineno > 0)
fprintf(stderr, "At line %u: ", start_lineno);
if (fmt)
@@ -1368,20 +1383,14 @@ void die(const char *fmt, ...)
void abort_not_supported_test(const char *fmt, ...)
{
va_list args;
- struct st_test_file* err_file= cur_file;
DBUG_ENTER("abort_not_supported_test");
/* Print include filestack */
fprintf(stderr, "The test '%s' is not supported by this installation\n",
file_stack->file_name);
fprintf(stderr, "Detected in file %s at line %d\n",
- err_file->file_name, err_file->lineno);
- while (err_file != file_stack)
- {
- err_file--;
- fprintf(stderr, "included from %s at line %d\n",
- err_file->file_name, err_file->lineno);
- }
+ cur_file->file_name, cur_file->lineno);
+ print_file_stack();
/* Print error message */
va_start(args, fmt);
@@ -2519,7 +2528,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
break;
}
}
- eval_expr(var, value, 0);
+ eval_expr(var, value, 0, false, false);
}
dynstr_free(&ds_query);
mysql_free_result(res);
@@ -2551,12 +2560,16 @@ void var_copy(VAR *dest, VAR *src)
void eval_expr(VAR *v, const char *p, const char **p_end,
- bool open_end, bool backtick)
+ bool open_end, bool do_eval)
{
DBUG_ENTER("eval_expr");
DBUG_PRINT("enter", ("p: '%s'", p));
+ /* Skip to treat as pure string if no evaluation */
+ if (! do_eval)
+ goto NO_EVAL;
+
if (*p == '$')
{
VAR *vp;
@@ -2576,7 +2589,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end,
DBUG_VOID_RETURN;
}
- if (*p == '`' && backtick)
+ if (*p == '`')
{
var_query_set(v, p, p_end);
DBUG_VOID_RETURN;
@@ -2599,6 +2612,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end,
}
}
+ NO_EVAL:
{
int new_val_len = (p_end && *p_end) ?
(int) (*p_end - p) : (int) strlen(p);