List:Commits« Previous MessageNext Message »
From:Mattias Jonsson Date:May 30 2012 6:55pm
Subject:bzr push into mysql-trunk branch (mattias.jonsson:3913 to 3914) WL#4443
View as plain text  
 3914 Mattias Jonsson	2012-05-30
      WL#4443: Remove scalability problem with many lock's
      and external lock's on partitioned tables with many partitions
      
      A stored program can not be constant until it is locked.
      
      Fixed by always setting const_item_cache to false
      during fix_fields if tables are not locked.

    modified:
      sql/item_func.cc
 3913 Mattias Jonsson	2012-05-30
      WL#4443:
      Reverted clearing the Item_func_sp::const_item_cache.
      which caused re-evaluation instead of using the cached
      value for deterministic functions.

    modified:
      sql/item_func.cc
=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc	revid:mattias.jonsson@stripped
+++ b/sql/item_func.cc	revid:mattias.jonsson@stripped
@@ -6937,8 +6937,10 @@ Item_func_sp::fix_fields(THD *thd, Item 
 
   res= Item_func::fix_fields(thd, ref);
 
-  /* this is reset by Item_func::fix_fields. */
+  /* These is reset/set by Item_func::fix_fields. */
   with_stored_program= true;
+  if (!m_sp->m_chistics->detistic || !tables_locked_cache)
+    const_item_cache= false;
 
   if (res)
     DBUG_RETURN(res);
@@ -6968,9 +6970,6 @@ Item_func_sp::fix_fields(THD *thd, Item 
 #endif /* ! NO_EMBEDDED_ACCESS_CHECKS */
   }
 
-  if (!m_sp->m_chistics->detistic)
-    const_item_cache= false;
-
   DBUG_RETURN(res);
 }
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (mattias.jonsson:3913 to 3914) WL#4443Mattias Jonsson30 May