Commit 3494a915 authored by Bjorn Munch's avatar Bjorn Munch

upmerge 58896,58900,59002

parents 5a66a6b8 596c8810
...@@ -488,7 +488,7 @@ VAR* var_init(VAR* v, const char *name, int name_len, const char *val, ...@@ -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, VAR* var_get(const char *var_name, const char** var_name_end,
my_bool raw, my_bool ignore_not_existing); 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 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); my_bool match_delimiter(int c, const char *delim, uint length);
void dump_result_to_reject_file(char *buf, int size); void dump_result_to_reject_file(char *buf, int size);
void dump_warning_messages(); void dump_warning_messages();
...@@ -1318,6 +1318,17 @@ static void cleanup_and_exit(int exit_code) ...@@ -1318,6 +1318,17 @@ static void cleanup_and_exit(int exit_code)
exit(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, ...) void die(const char *fmt, ...)
{ {
static int dying= 0; static int dying= 0;
...@@ -1337,8 +1348,12 @@ void die(const char *fmt, ...) ...@@ -1337,8 +1348,12 @@ void die(const char *fmt, ...)
/* Print the error message */ /* Print the error message */
fprintf(stderr, "mysqltest: "); fprintf(stderr, "mysqltest: ");
if (cur_file && cur_file != file_stack) if (cur_file && cur_file != file_stack)
fprintf(stderr, "In included file \"%s\": ", {
fprintf(stderr, "In included file \"%s\": \n",
cur_file->file_name); cur_file->file_name);
print_file_stack();
}
if (start_lineno > 0) if (start_lineno > 0)
fprintf(stderr, "At line %u: ", start_lineno); fprintf(stderr, "At line %u: ", start_lineno);
if (fmt) if (fmt)
...@@ -1368,20 +1383,14 @@ void die(const char *fmt, ...) ...@@ -1368,20 +1383,14 @@ void die(const char *fmt, ...)
void abort_not_supported_test(const char *fmt, ...) void abort_not_supported_test(const char *fmt, ...)
{ {
va_list args; va_list args;
struct st_test_file* err_file= cur_file;
DBUG_ENTER("abort_not_supported_test"); DBUG_ENTER("abort_not_supported_test");
/* Print include filestack */ /* Print include filestack */
fprintf(stderr, "The test '%s' is not supported by this installation\n", fprintf(stderr, "The test '%s' is not supported by this installation\n",
file_stack->file_name); file_stack->file_name);
fprintf(stderr, "Detected in file %s at line %d\n", fprintf(stderr, "Detected in file %s at line %d\n",
err_file->file_name, err_file->lineno); cur_file->file_name, cur_file->lineno);
while (err_file != file_stack) print_file_stack();
{
err_file--;
fprintf(stderr, "included from %s at line %d\n",
err_file->file_name, err_file->lineno);
}
/* Print error message */ /* Print error message */
va_start(args, fmt); va_start(args, fmt);
...@@ -2519,7 +2528,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var) ...@@ -2519,7 +2528,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
break; break;
} }
} }
eval_expr(var, value, 0); eval_expr(var, value, 0, false, false);
} }
dynstr_free(&ds_query); dynstr_free(&ds_query);
mysql_free_result(res); mysql_free_result(res);
...@@ -2551,12 +2560,16 @@ void var_copy(VAR *dest, VAR *src) ...@@ -2551,12 +2560,16 @@ 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 open_end, bool backtick) bool open_end, bool do_eval)
{ {
DBUG_ENTER("eval_expr"); DBUG_ENTER("eval_expr");
DBUG_PRINT("enter", ("p: '%s'", p)); DBUG_PRINT("enter", ("p: '%s'", p));
/* Skip to treat as pure string if no evaluation */
if (! do_eval)
goto NO_EVAL;
if (*p == '$') if (*p == '$')
{ {
VAR *vp; VAR *vp;
...@@ -2576,7 +2589,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end, ...@@ -2576,7 +2589,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end,
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
if (*p == '`' && backtick) if (*p == '`')
{ {
var_query_set(v, p, p_end); var_query_set(v, p, p_end);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
...@@ -2599,6 +2612,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end, ...@@ -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 new_val_len = (p_end && *p_end) ?
(int) (*p_end - p) : (int) strlen(p); (int) (*p_end - p) : (int) strlen(p);
......
...@@ -15,9 +15,13 @@ The syntax is as follows: ...@@ -15,9 +15,13 @@ The syntax is as follows:
and any subsequent characters are ignored. and any subsequent characters are ignored.
4) The full test case name including the suite and execution mode 4) The full test case name including the suite and execution mode
must be specified, for example: may be specified, for example:
main.alias 'row' # bug#00000 main.alias 'row' # bug#00000
4b) Now, combinations will also be covered if only the test name is
specified, for example:
rpl.rpl_ps # Covers 'row', 'mix' and 'stmt'
5) As an exception to item 4, the last character of the test case 5) As an exception to item 4, the last character of the test case
specification may be an asterisk (*). In that case, all test cases that specification may be an asterisk (*). In that case, all test cases that
start with the same characters up to the last letter before the asterisk start with the same characters up to the last letter before the asterisk
......
...@@ -23,7 +23,7 @@ main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeou ...@@ -23,7 +23,7 @@ main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeou
rpl.rpl_heartbeat_basic # BUG#54820 2010-06-26 alik rpl.rpl_heartbeat_basic fails sporadically again rpl.rpl_heartbeat_basic # BUG#54820 2010-06-26 alik rpl.rpl_heartbeat_basic fails sporadically again
rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically
rpl.rpl_innodb_bug28430* # Bug#46029 rpl.rpl_innodb_bug28430 # Bug#46029
sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
sys_vars.plugin_dir_basic # Bug#52223 2010-11-24 alik Test "plugin_dir_basic" does not support RPM build (test) directory structure sys_vars.plugin_dir_basic # Bug#52223 2010-11-24 alik Test "plugin_dir_basic" does not support RPM build (test) directory structure
......
...@@ -129,7 +129,8 @@ sub mtr_report_test ($) { ...@@ -129,7 +129,8 @@ sub mtr_report_test ($) {
# Find out if this test case is an experimental one, so we can treat # Find out if this test case is an experimental one, so we can treat
# the failure as an expected failure instead of a regression. # the failure as an expected failure instead of a regression.
for my $exp ( @$::experimental_test_cases ) { for my $exp ( @$::experimental_test_cases ) {
if ( $exp ne $test_name ) { # Include pattern match for combinations
if ( $exp ne $test_name && $test_name !~ /^$exp / ) {
# if the expression is not the name of this test case, but has # if the expression is not the name of this test case, but has
# an asterisk at the end, determine if the characters up to # an asterisk at the end, determine if the characters up to
# but excluding the asterisk are the same # but excluding the asterisk are the same
......
...@@ -311,12 +311,33 @@ failing query in let ...@@ -311,12 +311,33 @@ failing query in let
create table t1 (a varchar(100)); create table t1 (a varchar(100));
insert into t1 values ('`select 42`'); insert into t1 values ('`select 42`');
`select 42` `select 42`
insert into t1 values ('$dollar');
$dollar
`select 42`
drop table t1; drop table t1;
mysqltest: At line 1: Error running query 'failing query': 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing query' at line 1 mysqltest: At line 1: Error running query 'failing query': 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing query' at line 1
mysqltest: At line 1: Missing required argument 'filename' to command 'source' mysqltest: At line 1: Missing required argument 'filename' to command 'source'
mysqltest: At line 1: Could not open './non_existingFile' for reading, errno: 2 mysqltest: At line 1: Could not open './non_existingFile' for reading, errno: 2
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql":
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql": At line 1: query 'garbage ' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
At line 1: Source directives are nesting too deep
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql":
included from MYSQLTEST_VARDIR/tmp/error.sql at line 1:
At line 1: query 'garbage ' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
2 = outer loop variable after while 2 = outer loop variable after while
here is the sourced script here is the sourced script
...@@ -444,7 +465,9 @@ counter is 6 ...@@ -444,7 +465,9 @@ counter is 6
counter is 7 counter is 7
1 1
Testing while with not Testing while with not
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest_while.inc": At line 64: Nesting too deeply mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest_while.inc":
included from MYSQLTEST_VARDIR/tmp/mysqltest_while.inc at line 65:
At line 64: Nesting too deeply
mysqltest: At line 1: missing '(' in while mysqltest: At line 1: missing '(' in while
mysqltest: At line 1: missing ')' in while mysqltest: At line 1: missing ')' in while
mysqltest: At line 1: Missing '{' after while. Found "dec $i" mysqltest: At line 1: Missing '{' after while. Found "dec $i"
...@@ -493,8 +516,12 @@ mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: 1 ...@@ -493,8 +516,12 @@ mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: 1
mysqltest: At line 1: Illegal argument for port: 'illegal_port' mysqltest: At line 1: Illegal argument for port: 'illegal_port'
mysqltest: At line 1: Illegal option to connect: SMTP mysqltest: At line 1: Illegal option to connect: SMTP
200 connects succeeded 200 connects succeeded
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 3: connection 'test_con1' not found in connection pool mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql":
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 2: Connection test_con1 already exists included from MYSQLTEST_VARDIR/tmp/mysqltest.sql at line 3:
At line 3: connection 'test_con1' not found in connection pool
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql":
included from MYSQLTEST_VARDIR/tmp/mysqltest.sql at line 2:
At line 2: Connection test_con1 already exists
show tables; show tables;
ERROR 3D000: No database selected ERROR 3D000: No database selected
connect con1,localhost,root,,; connect con1,localhost,root,,;
......
...@@ -859,6 +859,12 @@ insert into t1 values ('`select 42`'); ...@@ -859,6 +859,12 @@ insert into t1 values ('`select 42`');
let $a= `select * from t1`; let $a= `select * from t1`;
# This should output `select 42`, not evaluate it again to 42 # This should output `select 42`, not evaluate it again to 42
echo $a; echo $a;
insert into t1 values ('$dollar');
# These should also output the string without evaluating it.
let $a= query_get_value(select * from t1 order by a, a, 1);
echo $a;
let $a= query_get_value(select * from t1 order by a, a, 2);
echo $a;
drop table t1; drop table t1;
--error 1 --error 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment