Bug #13809 mysql-test: --replace_result option works on Windows incorrect
Submitted: 6 Oct 2005 16:02 Modified: 27 Feb 2006 19:50
Reporter: Serge Kozlov Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:5.0.13rc OS:Microsoft Windows (Windows XP)
Assigned to: Magnus Blåudd CPU Architecture:Any
Triage: D5 (Feature request)

[6 Oct 2005 16:02] Serge Kozlov
The option "--replace_result" works incorrect in a testcase on Windows/Cygwin if it called inside included file ("--source" option) and the files have DOS text format (each line ends by CRLF): 

This problem doesn't exist if testcases have UNIX format.

How to repeat:
1. Create 1.test file in main suite with following content (Note: make sure that the file has DOS format):

--source include/1.inc

2. Create 1.inc file in main suite ("include" directory) with following content (Note: make sure that the file has DOS format):


3. Run mysql-test-run.pl --record 1

4. Open 1.result file and look at line SELECT 2,'MYSQL_TEST_DIR'. Special character 0x0D was inserted after "R" character and before single quote.
[6 Oct 2005 18:50] Serge Kozlov
place it into t/ directory

Attachment: 1.test (application/octet-stream, text), 108 bytes.

[6 Oct 2005 18:51] Serge Kozlov
place it into include/ directory

Attachment: 1.inc (application/octet-stream, text), 83 bytes.

[6 Oct 2005 18:51] Serge Kozlov
It is the result file

Attachment: 1.result (application/octet-stream, text), 125 bytes.

[8 Oct 2005 2:25] Miguel Solorzano
Finding  Tests in the 'main' suite
Starting Tests in the 'main' suite

TEST                            RESULT

1                               [ pass ]
Ending Tests
Shutting-down MySQL daemon

Master(s) shutdown finished
Slave(s) shutdown finished
All 1 tests were successful.

miguel@light ~/mysql/mysql-test

and 1.result shows that behavior reported.
[15 Feb 2006 23:54] 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:

[24 Feb 2006 8:09] Magnus Blåudd
Pushed a fix to 5.0.19 and 5.1.8 that will make mysqltest convert all CR/LF to LF. Making it possible to read windows test files in a unix fashion.
[27 Feb 2006 19:50] Mike Hillyer
Documented in 5.0.19 and 5.1.8 changelogs:

          The <filename>mysqltest</filename> utility now converts all
          <literal>CR/LF</literal> combinations to <literal>LF</literal>
          to allow test cases intended for Windows to work properly on
          UNIX-like systems. (Bug #13809)