summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2005-12-13 18:07:13 +0100
committerunknown <msvensson@neptunus.(none)>2005-12-13 18:07:13 +0100
commit637232d90bf9c0a7eae7c3a56f8a9889a6b1f971 (patch)
treeb822a919a3564d199504421023e30dc743db56d7
parent6576b3849dcce8ae4437249f7f7171c1228c437f (diff)
downloadmariadb-git-637232d90bf9c0a7eae7c3a56f8a9889a6b1f971.tar.gz
Fix tests after merge
Straighten out and comment behaviour for --require and --result in run_query client/mysqltest.c: If --require or --result has been provided for a query command->record_file file be set. In that case it should either dump to file if recording or check with content in file if running. mysql-test/r/mysqltest.result: Fix up tests and results after merge mysql-test/t/mysqltest.test: Fix up tests and results after merge
-rw-r--r--client/mysqltest.c32
-rw-r--r--mysql-test/r/mysqltest.result15
-rw-r--r--mysql-test/t/mysqltest.test18
3 files changed, 34 insertions, 31 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 135fa370688..3f8b6582eb9 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -3925,22 +3925,26 @@ static void run_query(MYSQL *mysql, struct st_query *command, int flags)
mysql_errno(mysql), mysql_error(mysql));
}
- if (record)
+ if (command->record_file[0])
{
- /* Recording in progress */
- if (!command->record_file[0])
- die("Missing result file");
- /* Dump the output from _this_ query to the specified record_file */
- str_to_file(command->record_file, ds->str, ds->length);
- }
- else if (command->record_file[0])
- {
- /*
- The output from _this_ query should be checked against an already
- existing file which has been specified using --require or --result
- */
- check_result(ds, command->record_file, command->require_file);
+ /* A result file was specified for _this_ query */
+ if (record)
+ {
+ /*
+ Recording in progress
+ Dump the output from _this_ query to the specified record_file
+ */
+ str_to_file(command->record_file, ds->str, ds->length);
+
+ } else {
+
+ /*
+ The output from _this_ query should be checked against an already
+ existing file which has been specified using --require or --result
+ */
+ check_result(ds, command->record_file, command->require_file);
+ }
}
dynstr_free(&ds_warnings);
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 8ea3a48e948..2e78f468f93 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -396,20 +396,20 @@ root@localhost
--------------------------------------------------------------------------------
this will be executed
this will be executed
+mysqltest: Result length mismatch
+mysqltest: The test didn't produce any output
+Failing multi statement query
mysqltest: At line 3: query 'create table t1 (a int primary key);
insert into t1 values (1);
select 'select-me';
insertz 'error query'' 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 'insertz 'error query'' at line 1
drop table t1;
-drop table t1;
-create table t1 (a int primary key);
+mysqltest: At line 3: query 'create table t1 (a int primary key);
insert into t1 values (1);
select 'select-me';
-insertz error query||||
-select-me
-select-me
-ERROR 42000: 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 'insertz error query' at line 1
+insertz 'error query'' 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 'insertz 'error query'' at line 1
drop table t1;
+Multi statement using expected error
create table t1 (a int primary key);
insert into t1 values (1);
select 'select-me';
@@ -418,5 +418,4 @@ select-me
select-me
ERROR 42000: 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 'insertz error query' at line 1
drop table t1;
-mysqltest: Result length mismatch
-mysqltest: The test didn't produce any output
+drop table t1;
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 1d22705fb8e..132a6329178 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -984,7 +984,7 @@ select "this will be executed";
# non-1st queries
#
-# Failing multi statement query
+echo Failing multi statement query;
# PS does not support multi statement
--exec echo "--disable_ps_protocol" > var/tmp/bug11731.sql
--exec echo "delimiter ||||;" >> var/tmp/bug11731.sql
@@ -999,14 +999,13 @@ select "this will be executed";
drop table t1;
--error 1
---exec $MYSQL_TEST --record -x $MYSQL_TEST_DIR/var/tmp/bug11731.sql -R $MYSQL_TEST_DIR/var/tmp/bug11731.out
-# The .out file should be empty, cat will fail!
---error 1
---exec cat $MYSQL_TEST_DIR/var/tmp/bug11731.out
+--exec $MYSQL_TEST --record -x $MYSQL_TEST_DIR/var/tmp/bug11731.sql -R $MYSQL_TEST_DIR/var/tmp/bug11731.out 2>&1
+# The .out file should be non existent
+--exec test ! -e $MYSQL_TEST_DIR/var/tmp/bug11731.out
drop table t1;
-# Using expected error
+echo Multi statement using expected error;
# PS does not support multi statement
--exec echo "--disable_ps_protocol" > var/tmp/bug11731.sql
--exec echo "delimiter ||||;" >> var/tmp/bug11731.sql
@@ -1018,11 +1017,12 @@ drop table t1;
--exec echo "delimiter ;||||" >> var/tmp/bug11731.sql
# These two should work since the error is expected
---exec $MYSQL_TEST -x $MYSQL_TEST_DIR/var/tmp/bug11731.sql 2>&1
+--exec $MYSQL_TEST -x $MYSQL_TEST_DIR/var/tmp/bug11731.sql 2>&1
drop table t1;
---exec $MYSQL_TEST --record -x $MYSQL_TEST_DIR/var/tmp/bug11731.sql -R $MYSQL_TEST_DIR/var/tmp/bug11731.out
---exec cat $MYSQL_TEST_DIR/var/tmp/bug11731.out
+--exec $MYSQL_TEST --record -x $MYSQL_TEST_DIR/var/tmp/bug11731.sql -R $MYSQL_TEST_DIR/var/tmp/bug11731.out 2>&1
+# The .out file should exist
+--exec test -s $MYSQL_TEST_DIR/var/tmp/bug11731.out
drop table t1;