Bug #25340 Slight error in configure.js break source installation on Windows
Submitted: 30 Dec 2006 17:58 Modified: 14 Apr 2008 19:33
Reporter: Anders Karlsson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.0, 5.1.14 Falcon OS:Windows (Windows)
Assigned to: Daniel Fischer CPU Architecture:Any

[30 Dec 2006 17:58] Anders Karlsson
Description:
Building from source on Windows fails in configure.js. The reason is that the file being read as input, configure.in, has DOS CR/LF in it. This is probably different on what program you use to unpack the distribution, but WINZIP does this anyway, and as winzip is very common, this should be a common error.
What happens is that the function GetValue in configure.js breaks when it comes to removing traling double quotes mainly, but also in other cases, as it will only remove the trailing LF, not a CR if that exists, so the CR is left in the string. And if the value is double quoted, then the trailing double quote isn't removed and the syntax of the generated file is invalid (this is when looking for a trailing double qote, what is found is only a trailing CR).

How to repeat:
Download the MySQL source distro to windows. Unzip with Winzip. In the base directory, run win/configure. Now, look at the generated file win/configure.data, and this is clearly invalid, there are several embedded CR here and there.

Suggested fix:
Simple. Add a conditional clause to remove the trailing CR if it exists, before removing the trailing double quote, in GetValue. Like this:
function GetValue(str, key)
{
    var pos = str.indexOf(key+'=');
    if (pos == -1) return null;
    pos += key.length + 1;
    var end = str.indexOf("\n", pos);
    if (str.charAt(pos) == "\"")
        pos++;
// Remove trailing CR if it exists.
    if (str.charAt(end-1) != 13)
        end--;
    if (str.charAt(end-1) == "\"")
        end--;
    return str.substring(pos, end);    
}
[2 Jan 2007 21:51] Calvin Sun
It does no look like Falcon-specific.
[1 Feb 2008 17: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/commits/41577

ChangeSet@1.2521, 2008-02-01 18:51:46+01:00, df@pippilotta.erinye.com +1 -0
  BUG#25340 Slight error in configure.js break source installation on Windows
[1 Feb 2008 18:53] Timothy Smith
I agree with Kent this would fit in 5.0.
[27 Mar 2008 12:03] 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/commits/44510

ChangeSet@1.2596, 2008-03-27 13:02:59+01:00, df@pippilotta.erinye.com +1 -0
  BUG#25340
[27 Mar 2008 12:47] Daniel Fischer
Queued in 5.0 and 5.1 build trees
[27 Mar 2008 22:03] Bugs System
Pushed into 5.1.24-rc
[27 Mar 2008 22:11] Bugs System
Pushed into 5.0.60
[31 Mar 2008 13:58] Bugs System
Pushed into 6.0.5-alpha
[14 Apr 2008 19:33] Paul DuBois
Noted in 5.0.60, 5.1.24, 6.0.5 changelogs.

On Windows, an error in configure.js caused installation of source
distributions to fail.