#At file:///home/bm136801/my/while-51/ based on revid:bjorn.munch@stripped
2810 Bjorn Munch 2009-07-28
Bug #41913 mysqltest cannot source files from if inside while
Source within if within while is ignored if the if is false on first iteration
Fixed by forcing source even if inside a false if
modified:
client/mysqltest.cc
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc 2009-05-29 11:04:02 +0000
+++ b/client/mysqltest.cc 2009-07-28 10:22:22 +0000
@@ -7932,6 +7932,26 @@ int main(int argc, char **argv)
break;
}
}
+ /*
+ source commands should be done nonetheless; the contents will
+ be ignored (not executed) but cached.
+ However, this is only needed if we're inside a while loop at some
+ level above the current block, in which case we might pass
+ over this source line again.
+ */
+ else if (command->type == Q_SOURCE)
+ {
+ for (struct st_block *stb= cur_block-1; stb >= block_stack; stb--)
+ {
+ if (stb->cmd == cmd_while)
+ {
+ command->last_argument= command->first_argument;
+ processed = 1;
+ do_source(command);
+ break;
+ }
+ }
+ }
if (!processed)
{
Attachment: [text/bzr-bundle] bzr/bjorn.munch@sun.com-20090728102222-n7eht45f7uedi3o5.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2810) Bug#41913 | Bjorn Munch | 28 Jul |