List:Commits« Previous MessageNext Message »
From:Tor Didriksen Date:August 28 2012 2:41pm
Subject:bzr push into mysql-5.5 branch (tor.didriksen:3952 to 3953) Bug#14549809
View as plain text  
 3953 Tor Didriksen	2012-08-28
      Bug#14549809 LINKING PROBLEM IN 5.5.28 BUILDS WITH THREADPOOL PLUGIN
      
      The use of Thread_iterator did not work on windows (linking problems).
      Solution: Change the interface between the thread_pool and the server
      to only use simple free functions.
      
      This patch is for 5.5 only (mimicks similar solution in 5.6)

    modified:
      include/mysql/thread_pool_priv.h
      sql/mysqld.cc
      sql/sql_list.h
 3952 Martin Hansson	2012-08-24 {clone-5.5.28-build} [merge]
      Bug#14498355: Merge

    modified:
      mysql-test/r/log_state.result
      mysql-test/r/variables.result
      mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result
      mysql-test/suite/sys_vars/r/log_basic.result
      mysql-test/suite/sys_vars/r/log_slow_queries_basic.result
      mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result
      mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_64.result
      mysql-test/suite/sys_vars/r/sql_big_selects_func.result
      mysql-test/suite/sys_vars/r/sql_max_join_size_basic.result
      mysql-test/suite/sys_vars/r/sql_max_join_size_func.result
      sql/set_var.cc
      sql/set_var.h
      sql/share/errmsg-utf8.txt
      sql/sql_plugin.cc
      sql/sys_vars.cc
      sql/sys_vars.h
=== modified file 'include/mysql/thread_pool_priv.h'
--- a/include/mysql/thread_pool_priv.h	2012-07-25 10:54:18 +0000
+++ b/include/mysql/thread_pool_priv.h	2012-08-28 14:13:03 +0000
@@ -62,24 +62,8 @@ void thd_set_mysys_var(THD *thd, st_my_t
 ulong  thd_get_net_wait_timeout(THD *thd);
 my_socket thd_get_fd(THD *thd);
 
-/* Interface class for  global thread  list iteration */
-class Thread_iterator
-{
-  public:
-    Thread_iterator() : m_iterator(threads) {}
-    THD* next()
-    {
-      THD* tmp = m_iterator++;
-      return tmp;
-    }
-  private:
-    /*
-      Don't allow copying  of this class.
-    */
-    Thread_iterator(const Thread_iterator&);
-    void operator=(const Thread_iterator&);
-    I_List_iterator<THD> m_iterator;
-};
+THD *first_global_thread();
+THD *next_global_thread(THD *thd);
 
 /* Print to the MySQL error log */
 void sql_print_error(const char *format, ...);

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2012-08-07 13:37:13 +0000
+++ b/sql/mysqld.cc	2012-08-28 14:13:03 +0000
@@ -601,6 +601,21 @@ I_List<THD> threads;
 Rpl_filter* rpl_filter;
 Rpl_filter* binlog_filter;
 
+THD *first_global_thread()
+{
+  if (threads.is_empty())
+    return NULL;
+  return threads.head();
+}
+
+THD *next_global_thread(THD *thd)
+{
+  if (threads.is_last(thd))
+    return NULL;
+  struct ilink *next= thd->next;
+  return static_cast<THD*>(next);
+}
+
 struct system_variables global_system_variables;
 struct system_variables max_system_variables;
 struct system_status_var global_status_var;

=== modified file 'sql/sql_list.h'
--- a/sql/sql_list.h	2011-06-30 15:46:53 +0000
+++ b/sql/sql_list.h	2012-08-28 14:13:03 +0000
@@ -585,6 +585,9 @@ public:
   inline void empty() { first= &last; last.prev= &first; }
   base_ilist() { empty(); }
   inline bool is_empty() {  return first == &last; }
+  // Returns true if p is the last "real" object in the list,
+  // i.e. p->next points to the sentinel.
+  inline bool is_last(ilink *p) { return p->next == NULL || p->next == &last; }
   inline void append(ilink *a)
   {
     first->prev= &a->next;
@@ -660,6 +663,7 @@ class I_List :private base_ilist
 {
 public:
   I_List() :base_ilist()	{}
+  inline bool is_last(T *p)     { return base_ilist::is_last(p); }
   inline void empty()		{ base_ilist::empty(); }
   inline bool is_empty()        { return base_ilist::is_empty(); } 
   inline void append(T* a)	{ base_ilist::append(a); }

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5 branch (tor.didriksen:3952 to 3953) Bug#14549809Tor Didriksen28 Aug