summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorBjorn Munch <Bjorn.Munch@sun.com>2009-09-02 11:17:33 +0200
committerBjorn Munch <Bjorn.Munch@sun.com>2009-09-02 11:17:33 +0200
commitd65168fddab05ed08d95eb5fead7cb1aad38edd5 (patch)
treed849c1875734f401491af8b14ce665485f3347fe /mysql-test
parent5703baad97a116694b9f95009ab788dc6fc0fc2a (diff)
downloadmariadb-git-d65168fddab05ed08d95eb5fead7cb1aad38edd5.tar.gz
Bug #32296 mysqltest fails to parse "append_file" inside a "while", it works inside
a "if" Bug #41913 mysqltest cannot source files from if inside while Some commands require additional processing which only works first time Keep content for write_file or append_file with the st_command struct Add tests for those cases to mysqltest.test
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/mysqltest.result19
-rw-r--r--mysql-test/t/mysqltest.test26
2 files changed, 27 insertions, 18 deletions
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 52a1734ea54..f68413264e4 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -314,21 +314,10 @@ here is the sourced script
1 = outer loop variable before dec
0 = outer loop variable after dec
-
-2 = outer loop variable after while
+outer=2 ifval=0
+outer=1 ifval=1
here is the sourced script
-2 = outer loop variable before dec
-
-1 = outer loop variable after dec
-
-1 = outer loop variable after while
-here is the sourced script
-
-1 = outer loop variable before dec
-
-0 = outer loop variable after dec
-
In loop
here is the sourced script
@@ -538,6 +527,10 @@ mysqltest: At line 1: Missing required argument 'filename' to command 'write_fil
mysqltest: At line 1: End of file encountered before 'EOF' delimiter was found
Content for test_file1
mysqltest: At line 1: File already exist: 'MYSQLTEST_VARDIR/tmp/test_file1.tmp'
+These lines should be repeated,
+if things work as expected
+These lines should be repeated,
+if things work as expected
Some data
for cat_file command
of mysqltest
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 92f39d943b9..9859e73cfae 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -853,16 +853,18 @@ while ($outer)
eval SELECT '$outer = outer loop variable after dec' AS "";
}
+# Test source in an if in a while which is false on 1st iteration
let $outer= 2; # Number of outer loops
+let $ifval= 0; # false 1st time
while ($outer)
{
- eval SELECT '$outer = outer loop variable after while' AS "";
-
- echo here is the sourced script;
+ echo outer=$outer ifval=$ifval;
- eval SELECT '$outer = outer loop variable before dec' AS "";
+ if ($ifval) {
+ --source $MYSQLTEST_VARDIR/tmp/sourced.inc
+ }
dec $outer;
- eval SELECT '$outer = outer loop variable after dec' AS "";
+ inc $ifval;
}
@@ -1663,6 +1665,20 @@ EOF
remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
+# Test append_file within while
+let $outer= 2; # Number of outer loops
+while ($outer)
+{
+ append_file $MYSQLTEST_VARDIR/tmp/app_while.tmp;
+These lines should be repeated,
+if things work as expected
+EOF
+ dec $outer;
+}
+
+cat_file $MYSQLTEST_VARDIR/tmp/app_while.tmp;
+remove_file $MYSQLTEST_VARDIR/tmp/app_while.tmp;
+
# ----------------------------------------------------------------------------
# test for cat_file
# ----------------------------------------------------------------------------