Bug #54805 definitions in regex/my_regex.h conflict with /usr/include/regex.h
Submitted: 25 Jun 2010 12:55 Modified: 18 Jan 2011 19:57
Reporter: Tor Didriksen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Tor Didriksen CPU Architecture:Any

[25 Jun 2010 12:55] Tor Didriksen
Description:
The mysql source has its own version of regcomp etc. compiled in.
All symbols with linkage (i.e. global functions) have been renamed
(added my_ prefix) to avoid linkage problems.

When compiling with googletest, I get lots of warnings like these:
regex/my_regex.h:68:1: warning: "REG_STARTEND" redefined

and also
my_regex.h:14: error: conflicting declaration ‘typedef off_t regoff_t’

How to repeat:
Try to compile this:

#include <gtest/gtest.h>
#include "my_regex.h"

Note that my_regex.h is included with the Item hierarchy, 
so this effectively blocks the possibility to write unit tests
for a lot of our source code.

Suggested fix:
Rename macros:
REG_STARTEND => MY_REG_STARTEND
etc.
[21 Jul 2010 7:58] Tor Didriksen
See also
http://bugs.mysql.com/bug.php?id=55427
[21 Jul 2010 8:40] 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/114011
[22 Jul 2010 15:23] 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/114158
[26 Jul 2010 10:40] 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/114331
[26 Jul 2010 13:04] Tor Didriksen
Pushed to my:next-mr-bugfixing
[27 Jul 2010 13:02] 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/114442

3319 Tor Didriksen	2010-07-27
      Bug #54805 definitions in regex/my_regex.h conflict with /usr/include/regex.h
      
      Post Push fix: my_regex-t was vulnerable to #include file ordering:
      the result was that sizeof(off_t) == 4 in the .cc main program
      but sizeof(off_t) == 8 in the regex .c files
      
      fix: always include my_config.h first
      Added the same #include to all gunit test files.
[30 Jul 2010 8:34] 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/114708

3329 Tor Didriksen	2010-07-30
      Bug #54805 definitions in regex/my_regex.h conflict with /usr/include/regex.h
      
      Pos-push fix: header guard in my_regex.h conflicts with /usr/include/regex.h
      
      Also: Implement mock functions for new interactions between MDL and THD.
      Also: Don't gunit tests with sql library, link with a minimal library instead.
     @ regex/my_regex.h
        Fix include guard.
     @ sql/CMakeLists.txt
        New, minimal, library for gunit tests.
     @ unittest/gunit/CMakeLists.txt
        Do not link with sql library.
     @ unittest/gunit/mdl-t.cc
        New mock functions for MDL/THD interaction.
     @ unittest/gunit/mdl_mytap-t.cc
        New mock functions for MDL/THD interaction.
[4 Aug 2010 8:08] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:13] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:14] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:15] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:16] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:17] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:24] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804081533-c1d3rbipo9e8rt1s) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 9:00] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804081533-c1d3rbipo9e8rt1s) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (merge vers: 5.6.99-m4) (pib:20)
[4 Aug 2010 9:04] Bugs System
Pushed into mysql-next-mr (revid:alik@ibmvm-20100804081630-ntapn8bf9pko9vj3) (version source revid:alik@sun.com-20100731075120-qz9z8c25zum2wgmm) (pib:20)
[18 Jan 2011 19:57] Paul DuBois
Problem does not occur in any released version.