MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Dmitry Lenev Date:June 7 2010 1:41pm
Subject:bzr push into mysql-trunk-runtime branch (dlenev:3041 to 3042)
Bug#52289
View as plain text  
 3042 Dmitry Lenev	2010-06-07
      Follow-up for bug#52289 "performance regression
      for MyISAM in sysbench OLTP_RW test".
      
      Fixes compilation warnings about local variable
      shadowing I_P_List_fast_push_back::last member.
      
      Renamed I_P_List_fast_push_back::last member
      to m_last. Also to keep member naming consistent
      renamed I_P_List::first member to m_first.

    modified:
      sql/sql_plist.h
 3041 Konstantin Osipov	2010-06-07
      A fix for Bug#52432 "Crash in check_table_is_closed on an 
      information_schema query.
      Porting a fix done for a feature tree by Ingo Struewing.
      No test case since the crash only occurs under a stress
      load.
     @ storage/myisam/mi_dbug.c
        Iterate over the list of MyISAM shares and access the MyISAM 
        share internals under a lock.

    modified:
      storage/myisam/mi_dbug.c
=== modified file 'sql/sql_plist.h'
--- a/sql/sql_plist.h	2010-06-07 07:06:55 +0000
+++ b/sql/sql_plist.h	2010-06-07 13:40:52 +0000
@@ -66,7 +66,7 @@ template <typename T, typename B,
           typename I = I_P_List_no_push_back<T> >
 class I_P_List : public C, public I
 {
-  T *first;
+  T *m_first;
 
   /*
     Do not prohibit copying of I_P_List object to simplify their usage in
@@ -74,18 +74,18 @@ class I_P_List : public C, public I
     is a bad idea.
   */
 public:
-  I_P_List() : I(&first), first(NULL) {};
-  inline void empty()      { first= NULL; C::reset(); I::set_last(&first); }
-  inline bool is_empty() const { return (first == NULL); }
+  I_P_List() : I(&m_first), m_first(NULL) {};
+  inline void empty()      { m_first= NULL; C::reset(); I::set_last(&m_first); }
+  inline bool is_empty() const { return (m_first == NULL); }
   inline void push_front(T* a)
   {
-    *B::next_ptr(a)= first;
-    if (first)
-      *B::prev_ptr(first)= B::next_ptr(a);
+    *B::next_ptr(a)= m_first;
+    if (m_first)
+      *B::prev_ptr(m_first)= B::next_ptr(a);
     else
       I::set_last(B::next_ptr(a));
-    first= a;
-    *B::prev_ptr(a)= &first;
+    m_first= a;
+    *B::prev_ptr(a)= &m_first;
     C::inc();
   }
   inline void push_back(T *a)
@@ -124,20 +124,20 @@ public:
     **B::prev_ptr(a)= next;
     C::dec();
   }
-  inline T* front() { return first; }
-  inline const T *front() const { return first; }
+  inline T* front() { return m_first; }
+  inline const T *front() const { return m_first; }
   void swap(I_P_List<T, B, C> &rhs)
   {
-    swap_variables(T *, first, rhs.first);
+    swap_variables(T *, m_first, rhs.m_first);
     I::swap(rhs);
-    if (first)
-      *B::prev_ptr(first)= &first;
+    if (m_first)
+      *B::prev_ptr(m_first)= &m_first;
     else
-      I::set_last(&first);
-    if (rhs.first)
-      *B::prev_ptr(rhs.first)= &rhs.first;
+      I::set_last(&m_first);
+    if (rhs.m_first)
+      *B::prev_ptr(rhs.m_first)= &rhs.m_first;
     else
-      I::set_last(&rhs.first);
+      I::set_last(&rhs.m_first);
     C::swap(rhs);
   }
 #ifndef _lint
@@ -160,13 +160,13 @@ class I_P_List_iterator
   T *current;
 public:
   I_P_List_iterator(const I_P_List<T, B, C, I> &a)
-    : list(&a), current(a.first) {}
+    : list(&a), current(a.m_first) {}
   I_P_List_iterator(const I_P_List<T, B, C, I> &a, T* current_arg)
     : list(&a), current(current_arg) {}
   inline void init(const I_P_List<T, B, C, I> &a)
   {
     list= &a;
-    current= a.first;
+    current= a.m_first;
   }
   inline T* operator++(int)
   {
@@ -182,7 +182,7 @@ public:
   }
   inline void rewind()
   {
-    current= list->first;
+    current= list->m_first;
   }
 };
 
@@ -248,13 +248,13 @@ protected:
 
 template <typename T> class I_P_List_fast_push_back
 {
-  T **last;
+  T **m_last;
 protected:
-  I_P_List_fast_push_back(T **a) : last(a) { };
-  void set_last(T **a) { last= a; }
-  T** get_last() const { return last; }
+  I_P_List_fast_push_back(T **a) : m_last(a) { };
+  void set_last(T **a) { m_last= a; }
+  T** get_last() const { return m_last; }
   void swap(I_P_List_fast_push_back<T> &rhs)
-  { swap_variables(T**, last, rhs.last); }
+  { swap_variables(T**, m_last, rhs.m_last); }
 };
 
 #endif


Attachment: [text/bzr-bundle] bzr/dlenev@mysql.com-20100607134052-n3cq8rcv6wu3ecp6.bundle
Thread
bzr push into mysql-trunk-runtime branch (dlenev:3041 to 3042)Bug#52289Dmitry Lenev7 Jun