Bug #11316 mysqltest, problems when assigning value with '#' to $variable
Submitted: 14 Jun 2005 13:23 Modified: 1 Sep 2005 19:21
Reporter: Matthias Leich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:4.1 OS:
Assigned to: Magnus Blåudd CPU Architecture:Any

[14 Jun 2005 13:23] Matthias Leich
Description:
Example:
Script:   
let $message= # Testcase Pi/2:  Ensure that Pi is not an 
                       #                 integer number.
                       #                 Third line.;
eval select '$message' as "";
Protocol:
select '# Testcase Pi/2:  Ensure that Pi is not an 
#                 integer number.' as "";
           The statement is smaller than expected, because 
           the third line of the expanded $message is missing.
           That means either the assignment 
                let $message= ...     or
                eval 
           works wrong.

If I replace the "#" with "." the behaviour is correct and
all three lines are written.
I guess there is a problem within the parser of mysqltest.
Maybe it is because "#" could be also used for comments.
We have this bug within MySQL 4.1 and 5.0.

My environment:
   - Intel PC with Linux(SuSE 9.3)
   - MySQL compiled from source
        Version 4.1 ChangeSet@1.2181, 2005-04-14
        Version 5.0 ChangeSet@1.1927.2.1, 2005-06-14

How to repeat:
Please execute the statements above
[5 Jul 2005 7:56] Magnus Blåudd
It looks like what you really need is a way to add comments and/or messages to the result file. I would suggest that we add the new command echo instead of this. That would make it easier to keep track of which part of the result file belong sto which part of the test.
Ex:
echo Message that will go into the result file
[5 Jul 2005 11:42] Matthias Leich
Yes and No. A new mysqltest command like "echo" would be very nice.
But even the current method (SELECT + some limitions because of
this bug) is no big problem. 
The real problem what I see is that mysqltest works partially 
wrong when I assign string values containing a "#", "--" etc.
This might cause bad side effects during the development of tests
like mangled strings, misleading error messages ... And the analysis
of such effects costs too much time. There are some more examples,
where mysqltest is not able to decide where a statement or a comment
starts and ends.  Example: -- END TEST >>> 0001 <<< END TEST
[15 Jul 2005 15:52] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/27180
[22 Aug 2005 19:03] Michael Widenius
Reviewed by email 2005-08-17
Waiting for new patch that corrects the found issues
[23 Aug 2005 14:03] Magnus Blåudd
Sent mail with new patch.
[31 Aug 2005 15:16] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/29106
[1 Sep 2005 18:58] Magnus Blåudd
Pushed to 4.1.15 and 5.0.13
Internal change, affects only mysqltest
[1 Sep 2005 19:21] Paul DuBois
No changelog entry needed.