| Bug #53535 | Generated MTR tests not runnable when MTR command follows comment | ||
|---|---|---|---|
| Submitted: | 10 May 2010 9:33 | Modified: | 13 Oct 2010 13:34 |
| Reporter: | John Embretsen | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | Tools: Random Query Generator | Severity: | S3 (Non-critical) |
| Version: | OS: | Any | |
| Assigned to: | Bernt Marius Johnsen | CPU Architecture: | Any |
[10 May 2010 9:33]
John Embretsen
[10 May 2010 9:56]
John Embretsen
Similarly, for comments at the end of a test such as: /* End of test case for query 1 */ MTR fails with: mysqltest: At line 309: End of line junk detected: "/* End of test case for query 1 */ "
[5 Oct 2010 12:33]
Bernt Marius Johnsen
Need a new "How to repeat" since the given example does not repeat the problem. A fix is ready, but need to be verified.
[5 Oct 2010 14:27]
Bernt Marius Johnsen
Possible fix
Attachment: bug_53535.patch (application/x-subversion-stat, text), 3.10 KiB.
[11 Oct 2010 10:36]
John Embretsen
The attached patch (bug_53535.patch) has one if-test reversed and a typo:
Reversed if-test, causing the opposite behavior than desired:
if ($useHash) {
return "/* ". $splitLine . " */";
} else {
return "# " . $splitLine;
}
which should be
if ($useHash) {
return "# " . $splitLine;
} else {
return "/* ". $splitLine . " */";
}
There is also a typo in the following comment (harmless):
## We use Hash-comments in an pure MySQL environment due to MTR
## limtations
Change "limtations" to "limitations".
With these changes the patch seems to work fine, at least with the simple scenarios I have tested.
[11 Oct 2010 10:41]
John Embretsen
One way of testing a patch for this issue is to do the following:
1) Prepare one version of MySQL and refer to its basedir as $CODE
2) Prepare another version of MySQL and refer to its basedir as $CODE2
3) Save a grammar file "mygrammar.yy" with the following contents:
query_init:
# Insert the "minor" version digit into table B.
# Will cause diffs in comparison testing between minor releases.
INSERT INTO B (`col_varchar_nokey`) ( SELECT SUBSTR(@@version FROM 3 FOR 1) );
query:
SELECT pk, `col_varchar_nokey` FROM B;
4) Run the following RQG command from the randgen tree:
perl ./runall.pl \
--basedir1=$CODE \
--basedir2=$CODE2 \
--vardir1=$PWD/var-compare/vardir-1 \
--vardir2=$PWD/var-compare/vardir-2 \
--threads=1 \
--queries=2 \
--grammar=$PWD/mygrammar.yy \
--validator=ResultsetComparatorSimplify \
--reporters=Shutdown \
--duration=30 \
--engine=InnoDB
You should see a diff and a reference to a generated simplified .test file as long as the two MySQL versions differ in their "minor version" digit.
