Bug #53752 | Simplifier unable to produce test file upon simplifying a crash | ||
---|---|---|---|
Submitted: | 18 May 2010 13:47 | Modified: | 18 May 2010 13:50 |
Reporter: | John Embretsen | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | Tools: Random Query Generator | Severity: | S2 (Serious) |
Version: | bzr | OS: | Any |
Assigned to: | Bernt Marius Johnsen | CPU Architecture: | Any |
[18 May 2010 13:47]
John Embretsen
[18 May 2010 13:53]
John Embretsen
Full output of simplify_crash.pl run.
Attachment: simplify-crash.log (text/plain), 415.35 KiB.
[18 May 2010 13:55]
John Embretsen
Simplification utility script (slightly modified (query etc.) from simplify-crash.pl)
Attachment: simplify-crash-valgrind.pl (application/octet-stream, text), 3.87 KiB.
[18 May 2010 15:53]
Philip Stoev
The reason for this behavior is that when the test case is produced, EXPLAIN SELECT is issued in order to record the query plan within the test case. Unfortunately, for this particular SELECT crash, EXPLAIN SELECT crashes as well, causing simplified test generation to fail. Quick workaround: In lib/GenTest/Simplifier/Test.pm , disable the block around EXPLAIN. Possible longer-term solution: Handle crashing queries separately by passing a special flag to Simplifier::Test, which would cause the EXPLAIN call to be skipped altogether. EXPLAIN output is not strictly required for fixing crashing queries, so can safely be ommitted when generating a simplified test case.
[18 May 2010 16:35]
Philip Stoev
Quick and dirty patch: === modified file 'lib/GenTest/Simplifier/Test.pm' --- lib/GenTest/Simplifier/Test.pm 2010-03-30 11:54:09 +0000 +++ lib/GenTest/Simplifier/Test.pm 2010-05-18 15:48:58 +0000 @@ -169,12 +169,12 @@ foreach my $ex (0..1) { if (defined $executors->[$ex]) { $test .= "/* Query plan Server $ex:\n"; - my $plan = $executors->[$ex]->dbh()->selectall_arrayref("EXPLAIN $query"); +# my $plan = $executors->[$ex]->dbh()->selectall_arrayref("EXPLAIN $query"); - foreach my $row (@$plan) { - $test .= "# |".join("|",@$row)."|\n"; - } - $test .= "# */\n\n"; +# foreach my $row (@$plan) { +# $test .= "# |".join("|",@$row)."|\n"; +# } +# $test .= "# */\n\n"; } } }