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

 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.

    modified:
      regex/my_regex.h
      sql/CMakeLists.txt
      unittest/gunit/CMakeLists.txt
      unittest/gunit/mdl-t.cc
      unittest/gunit/mdl_mytap-t.cc
=== modified file 'regex/my_regex.h'
--- a/regex/my_regex.h	2010-07-26 10:39:38 +0000
+++ b/regex/my_regex.h	2010-07-30 08:34:23 +0000
@@ -1,5 +1,6 @@
-#ifndef _REGEX_H_
-#define	_REGEX_H_	/* never again */
+#ifndef MY_REGEX_INCLUDED
+#define MY_REGEX_INCLUDED
+
 /* ========= begin header generated by ./mkh ========= */
 
 #include "m_ctype.h"
@@ -84,4 +85,5 @@ extern void my_regex_end(void);	/* If on
 }
 #endif
 /* ========= end header generated by ./mkh ========= */
-#endif
+
+#endif  // MY_REGEX_INCLUDED

=== modified file 'sql/CMakeLists.txt'
--- a/sql/CMakeLists.txt	2010-07-29 13:37:49 +0000
+++ b/sql/CMakeLists.txt	2010-07-30 08:34:23 +0000
@@ -103,6 +103,7 @@ ADD_DEPENDENCIES(master GenError)
 SET (SLAVE_SOURCE rpl_slave.cc rpl_reporting.cc rpl_mi.cc rpl_rli.cc)
 ADD_LIBRARY(slave ${SLAVE_SOURCE})
 ADD_DEPENDENCIES(slave GenError)
+ADD_LIBRARY(sqlgunitlib mdl.cc sql_list.cc sql_string.cc thr_malloc.cc)
 
 
 IF(WIN32)

=== modified file 'unittest/gunit/CMakeLists.txt'
--- a/unittest/gunit/CMakeLists.txt	2010-07-26 10:39:38 +0000
+++ b/unittest/gunit/CMakeLists.txt	2010-07-30 08:34:23 +0000
@@ -210,7 +210,7 @@ ENDIF()
 SET(TESTS sql_list mdl mdl_mytap my_regex thread_utils)
 FOREACH(test ${TESTS})
   ADD_EXECUTABLE(${test}-t ${test}-t.cc)
-  TARGET_LINK_LIBRARIES(${test}-t gunit sql)
+  TARGET_LINK_LIBRARIES(${test}-t gunit sqlgunitlib strings dbug regex)
   IF (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
     SET_TARGET_PROPERTIES(${test}-t  PROPERTIES LINK_FLAGS "-library=stlport4")
   ENDIF()

=== modified file 'unittest/gunit/mdl-t.cc'
--- a/unittest/gunit/mdl-t.cc	2010-07-27 13:02:03 +0000
+++ b/unittest/gunit/mdl-t.cc	2010-07-30 08:34:23 +0000
@@ -38,6 +38,26 @@ pthread_key(THD*, THR_THD);
 mysql_mutex_t LOCK_open;
 uint    opt_debug_sync_timeout= 0;
 
+static mysql_mutex_t *current_mutex= NULL;
+extern "C"
+const char* thd_enter_cond(MYSQL_THD thd, mysql_cond_t *cond,
+                           mysql_mutex_t *mutex, const char *msg)
+{
+  current_mutex= mutex;
+  return NULL;
+}
+
+extern "C"
+void thd_exit_cond(MYSQL_THD thd, const char *old_msg)
+{
+  mysql_mutex_unlock(current_mutex);
+}
+
+extern "C" int thd_killed(const MYSQL_THD thd)
+{
+  return 0;
+}
+
 /*
   A mock error handler.
 */

=== modified file 'unittest/gunit/mdl_mytap-t.cc'
--- a/unittest/gunit/mdl_mytap-t.cc	2010-07-27 13:02:03 +0000
+++ b/unittest/gunit/mdl_mytap-t.cc	2010-07-30 08:34:23 +0000
@@ -34,6 +34,27 @@
 #include "thr_malloc.h"
 #include "thread_utils.h"
 
+static mysql_mutex_t *current_mutex= NULL;
+extern "C"
+const char* thd_enter_cond(MYSQL_THD thd, mysql_cond_t *cond,
+                           mysql_mutex_t *mutex, const char *msg)
+{
+  current_mutex= mutex;
+  return NULL;
+}
+
+extern "C"
+void thd_exit_cond(MYSQL_THD thd, const char *old_msg)
+{
+  mysql_mutex_unlock(current_mutex);
+}
+
+extern "C" int thd_killed(const MYSQL_THD thd)
+{
+  return 0;
+}
+
+
 pthread_key(MEM_ROOT**,THR_MALLOC);
 pthread_key(THD*, THR_THD);
 mysql_mutex_t LOCK_open;


Attachment: [text/bzr-bundle] bzr/tor.didriksen@oracle.com-20100730083423-s7e0vl1fjp15sh2i.bundle
Thread
bzr commit into mysql-next-mr-bugfixing branch (tor.didriksen:3329) Bug#54805Tor Didriksen30 Jul