Bug #28184 | min() and max() macro defines in my_global.h conflict with c++ headers | ||
---|---|---|---|
Submitted: | 1 May 2007 18:26 | Modified: | 27 Nov 2007 19:11 |
Reporter: | Arkadiusz Miskiewicz (Basic Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Compiling | Severity: | S3 (Non-critical) |
Version: | 5.1.17, 5.0.37,6.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | Contribution, qc |
[1 May 2007 18:26]
Arkadiusz Miskiewicz
[1 May 2007 19:00]
Valeriy Kravchuk
Thank you for a problem report. Verified just as described with code review.
[10 Jul 2007 7:32]
Arkadiusz Miskiewicz
Replaces min() max() with mysql_min() and mysql_max()
Attachment: mysql-min_max.patch (application/octet-stream, text), 142.99 KiB.
[10 Jul 2007 7:33]
Arkadiusz Miskiewicz
Compile tested. Replaces all (hope that I didn't miss anything in code that's not compiled in by default) occurences of min() and max() with non-conflicting mysql_min() and mysql_max(). Please review and merge since the bug is annoying for anyone using recent compiler (note, gcc 4.2.0 was already released some time ago).
[10 Jul 2007 21:42]
Sergei Golubchik
see also http://lists.mysql.com/internals/34680 and references therein
[11 Jul 2007 13:09]
Arkadiusz Miskiewicz
Uppercasing to indicate that these are macros is a good idea. So after applying my patch: find . -type f -exec sed -i -e 's|mysql_min|MYSQL_MIN|g' -e 's|mysql_max|MYSQL_MAX|g' '{}' ';'
[23 Jul 2007 13:04]
Paul DuBois
This occurs now on Gentoo Linux, for which a 4.2.0 ebuild has been released recently. % gcc --version gcc (GCC) 4.2.0 (Gentoo 4.2.0 p1.4) Affects the 5.1, 5.1-falcon, and 5.2 bk trees.
[12 Nov 2007 17:28]
Hartmut Holzgraefe
Also affects Debian "testing" and "unstable" as both have gcc 4.2.x as default compiler now (probably also some Ubuntu versions?)
[12 Nov 2007 17:44]
Arkadiusz Miskiewicz
We use smaller version mentioned earlier in commeents: http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/~checkout~/SOURCES/mysql-min_max.patch?rev=1.6... Works.
[23 Nov 2007 13:30]
Hartmut Holzgraefe
Fixed by http://mysql.bkbits.net:8080/mysql-5.1/?PAGE=cset&REV=46dbec1c1lAGFuqFZQy58XVe4KSijg
[26 Nov 2007 18:28]
Paul DuBois
Noted in 5.1.23, 6.0.4 changelogs. MySQL now can be compiled with gcc 4.2.x. There was a problem involving a conflict with the min() and max() macros in my_global.h, which now have been renamed to mysql_min() and mysql_max().
[26 Nov 2007 19:21]
Sergei Golubchik
No, they weren't renamed, see the patch at the link
[27 Nov 2007 19:11]
Paul DuBois
Removed the "which have been renamed" part from the changelog entry.
[1 May 2013 17:06]
Jon Baker
Is this still fixed? I'm running into this issue using mysql-devel-5.5-1.3