1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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
This commit is contained in:
Bjorn Munch
2009-09-02 11:17:33 +02:00
parent d4854d7494
commit fe3ea31d93
3 changed files with 73 additions and 28 deletions

View File

@ -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 outer=$outer ifval=$ifval;
echo here is the sourced script;
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
# ----------------------------------------------------------------------------