1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +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

@ -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

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
# ----------------------------------------------------------------------------