List:Commits« Previous MessageNext Message »
From:Tor Didriksen Date:July 27 2010 1:02pm
Subject:bzr commit into mysql-next-mr-bugfixing branch (tor.didriksen:3319) Bug#54805
View as plain text  
#At file:///export/home/didrik/repo/next-mr-bf-bug54805-pp/ based on revid:epotemkin@stripped

 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.

    modified:
      unittest/gunit/gunit_test_main.cc
      unittest/gunit/mdl-t.cc
      unittest/gunit/mdl_mytap-t.cc
      unittest/gunit/my_regex-t.cc
      unittest/gunit/sql_list-t.cc
      unittest/gunit/tap_event_listener.cc
      unittest/gunit/thread_utils-t.cc
      unittest/gunit/thread_utils.cc
=== modified file 'unittest/gunit/gunit_test_main.cc'
--- a/unittest/gunit/gunit_test_main.cc	2010-07-24 13:47:42 +0000
+++ b/unittest/gunit/gunit_test_main.cc	2010-07-27 13:02:03 +0000
@@ -13,6 +13,9 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
+// First include (the generated) my_config.h, to get correct platform defines,
+// then gtest.h (before any other MySQL headers), to avoid min() macros etc ...
+#include "my_config.h"
 #include <gtest/gtest.h>
 
 #include "mdl.h"                                // SHOULD BE my_sys.h

=== modified file 'unittest/gunit/mdl-t.cc'
--- a/unittest/gunit/mdl-t.cc	2010-06-23 11:01:12 +0000
+++ b/unittest/gunit/mdl-t.cc	2010-07-27 13:02:03 +0000
@@ -22,7 +22,9 @@
    The code below should hopefully be (mostly) self-explanatory.
  */
 
-// Must include gtest first, since MySQL source has macros for min() etc ....
+// First include (the generated) my_config.h, to get correct platform defines,
+// then gtest.h (before any other MySQL headers), to avoid min() macros etc ...
+#include "my_config.h"
 #include <gtest/gtest.h>
 
 #include "mdl.h"

=== modified file 'unittest/gunit/mdl_mytap-t.cc'
--- a/unittest/gunit/mdl_mytap-t.cc	2010-06-23 11:01:12 +0000
+++ b/unittest/gunit/mdl_mytap-t.cc	2010-07-27 13:02:03 +0000
@@ -21,6 +21,7 @@
    numbers in case of failures.
  */
 
+#include "my_config.h"
 #include <string>
 #include <iostream>
 #include <stdio.h>

=== modified file 'unittest/gunit/my_regex-t.cc'
--- a/unittest/gunit/my_regex-t.cc	2010-07-26 10:39:38 +0000
+++ b/unittest/gunit/my_regex-t.cc	2010-07-27 13:02:03 +0000
@@ -13,7 +13,9 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
-// Must include gtest first, since MySQL source has macros for min() etc ....
+// First include (the generated) my_config.h, to get correct platform defines,
+// then gtest.h (before any other MySQL headers), to avoid min() macros etc ...
+#include "my_config.h"
 #include <gtest/gtest.h>
 
 #include "my_regex.h"

=== modified file 'unittest/gunit/sql_list-t.cc'
--- a/unittest/gunit/sql_list-t.cc	2010-04-21 07:26:14 +0000
+++ b/unittest/gunit/sql_list-t.cc	2010-07-27 13:02:03 +0000
@@ -20,7 +20,9 @@
   http://code.google.com/p/googletest/wiki/GoogleTestPrimer
 */
 
-// Must include gtest first, since MySQL source has macros for min() etc ....
+// First include (the generated) my_config.h, to get correct platform defines,
+// then gtest.h (before any other MySQL headers), to avoid min() macros etc ...
+#include "my_config.h"
 #include <gtest/gtest.h>
 
 #include "sql_list.h"

=== modified file 'unittest/gunit/tap_event_listener.cc'
--- a/unittest/gunit/tap_event_listener.cc	2010-03-19 07:48:37 +0000
+++ b/unittest/gunit/tap_event_listener.cc	2010-07-27 13:02:03 +0000
@@ -13,7 +13,11 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
+// First include (the generated) my_config.h, to get correct platform defines,
+// then gtest.h (before any other MySQL headers), to avoid min() macros etc ...
+#include "my_config.h"
 #include <gtest/gtest.h>
+
 #include <stdarg.h>
 #include <string>
 #include <sstream>

=== modified file 'unittest/gunit/thread_utils-t.cc'
--- a/unittest/gunit/thread_utils-t.cc	2010-03-18 13:39:53 +0000
+++ b/unittest/gunit/thread_utils-t.cc	2010-07-27 13:02:03 +0000
@@ -13,7 +13,9 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
-// Must include gtest first, since MySQL source has macros for min() etc ....
+// First include (the generated) my_config.h, to get correct platform defines,
+// then gtest.h (before any other MySQL headers), to avoid min() macros etc ...
+#include "my_config.h"
 #include <gtest/gtest.h>
 
 #include "thread_utils.h"

=== modified file 'unittest/gunit/thread_utils.cc'
--- a/unittest/gunit/thread_utils.cc	2010-07-23 12:49:56 +0000
+++ b/unittest/gunit/thread_utils.cc	2010-07-27 13:02:03 +0000
@@ -13,7 +13,11 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
+// First include (the generated) my_config.h, to get correct platform defines,
+// then gtest.h (before any other MySQL headers), to avoid min() macros etc ...
+#include "my_config.h"
 #include <gtest/gtest.h>
+
 #include "thread_utils.h"
 #include "mysql/psi/mysql_thread.h"
 


Attachment: [text/bzr-bundle] bzr/tor.didriksen@oracle.com-20100727130203-8wufa1ssxxn1froj.bundle
Thread
bzr commit into mysql-next-mr-bugfixing branch (tor.didriksen:3319) Bug#54805Tor Didriksen27 Jul