summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorBjorn Munch <Bjorn.Munch@sun.com>2009-08-11 23:41:44 +0200
committerBjorn Munch <Bjorn.Munch@sun.com>2009-08-11 23:41:44 +0200
commitb742c771afac36558d3355172f416381ea96f3da (patch)
tree0e01ae32e29e2ef0ee955a4c6104c5413f08cfdf /client
parent1d99f9eae5f24b0c60872041ea960985386c4371 (diff)
downloadmariadb-git-b742c771afac36558d3355172f416381ea96f3da.tar.gz
Bug #44012 mtr: test cases that are not supposed to return output always fail
Output would match an empty result file but we don't check Allow empty output IFF there is an empty result file.
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index a39cabdc64d..a40ee1cd1d0 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -7987,6 +7987,8 @@ int main(int argc, char **argv)
if (parsing_disabled)
die("Test ended with parsing disabled");
+ my_bool empty_result= FALSE;
+
/*
The whole test has been executed _sucessfully_.
Time to compare result or save it to record file.
@@ -8027,11 +8029,20 @@ int main(int argc, char **argv)
}
else
{
- die("The test didn't produce any output");
+ /* Empty output is an error *unless* we also have an empty result file */
+ if (! result_file_name || record ||
+ compare_files (log_file.file_name(), result_file_name))
+ {
+ die("The test didn't produce any output");
+ }
+ else
+ {
+ empty_result= TRUE; /* Meaning empty was expected */
+ }
}
- if (!command_executed && result_file_name)
- die("No queries executed but result file found!");
+ if (!command_executed && result_file_name && !empty_result)
+ die("No queries executed but non-empty result file found!");
verbose_msg("Test has succeeded!");
timer_output();