Commit 34f2f8ea authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-256 lp:995501 - mysqltest attempts to parse Perl code inside a block

with false condition, gets confused and throws wrong errors
parent 57f824b0
...@@ -8259,8 +8259,12 @@ int main(int argc, char **argv) ...@@ -8259,8 +8259,12 @@ int main(int argc, char **argv)
command->abort_on_error= (command->expected_errors.count == 0 && command->abort_on_error= (command->expected_errors.count == 0 &&
abort_on_error); abort_on_error);
/* delimiter needs to be executed so we can continue to parse */ /*
ok_to_do= cur_block->ok || command->type == Q_DELIMITER; some commmands need to be executed or at least parsed unconditionally,
because they change the grammar.
*/
ok_to_do= cur_block->ok || command->type == Q_DELIMITER
|| command->type == Q_PERL;
/* /*
Some commands need to be "done" the first time if they may get Some commands need to be "done" the first time if they may get
re-iterated over in a true context. This can only happen if there's re-iterated over in a true context. This can only happen if there's
...@@ -8271,8 +8275,7 @@ int main(int argc, char **argv) ...@@ -8271,8 +8275,7 @@ int main(int argc, char **argv)
if (command->type == Q_SOURCE || if (command->type == Q_SOURCE ||
command->type == Q_ERROR || command->type == Q_ERROR ||
command->type == Q_WRITE_FILE || command->type == Q_WRITE_FILE ||
command->type == Q_APPEND_FILE || command->type == Q_APPEND_FILE)
command->type == Q_PERL)
{ {
for (struct st_block *stb= cur_block-1; stb >= block_stack; stb--) for (struct st_block *stb= cur_block-1; stb >= block_stack; stb--)
{ {
......
#
# MDEV-256 lp:995501 - mysqltest attempts to parse Perl code inside a block
# with false condition, gets confused and throws wrong errors
#
let $run = 0;
if ($run)
{
--perl
foreach (1)
{
print "In perl\n";
}
EOF
SELECT 1;
}
--echo # Done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment