List:Commits« Previous MessageNext Message »
From:Jorgen Loland Date:April 6 2011 1:36pm
Subject:bzr commit into mysql-trunk branch (jorgen.loland:3333) Bug#11882131
View as plain text  
#At file:///export/home/jl208045/mysql/mysql-trunk-11882131/ based on revid:georgi.kodinov@stripped

 3333 Jorgen Loland	2011-04-06
      BUG#11882131 Post-commit cleanup: Replace 
        delete select->quick; select->quick=X;
      with existing utility-function SQL_SELECT::set_quick().

    modified:
      sql/opt_range.cc
      sql/sql_join_cache.cc
      sql/sql_select.cc
      sql/sql_update.cc
=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2011-04-04 08:47:25 +0000
+++ b/sql/opt_range.cc	2011-04-06 13:36:32 +0000
@@ -1154,8 +1154,7 @@ SQL_SELECT::SQL_SELECT() :quick(0),cond(
 
 void SQL_SELECT::cleanup()
 {
-  delete quick;
-  quick= 0;
+  set_quick(NULL);
   if (free_cond)
   {
     free_cond=0;
@@ -2216,8 +2215,7 @@ int SQL_SELECT::test_quick_select(THD *t
 		      (ulong) keys_to_use.to_ulonglong(), (ulong) prev_tables,
 		      (ulong) const_tables));
   DBUG_PRINT("info", ("records: %lu", (ulong) head->file->stats.records));
-  delete quick;
-  quick=0;
+  set_quick(NULL);
   needed_reg.clear_all();
   quick_keys.clear_all();
   if (keys_to_use.is_clear_all())
@@ -2458,10 +2456,7 @@ int SQL_SELECT::test_quick_select(THD *t
     {
       records= best_trp->records;
       if (!(quick= best_trp->make_quick(&param, TRUE)) || quick->init())
-      {
-        delete quick;
-        quick= NULL;
-      }
+        set_quick(NULL);
     }
 
   free_mem:

=== modified file 'sql/sql_join_cache.cc'
--- a/sql/sql_join_cache.cc	2011-03-22 11:44:40 +0000
+++ b/sql/sql_join_cache.cc	2011-04-06 13:36:32 +0000
@@ -1777,12 +1777,9 @@ enum_nested_loop_state JOIN_CACHE_BNL::j
   if (skip_last)     
     put_record();     
  
-  if (join_tab->use_quick == 2 && join_tab->select->quick)
-  { 
+  if (join_tab->use_quick == QS_DYNAMIC_RANGE && join_tab->select->quick)
     /* A dynamic range access was used last. Clean up after it */
-    delete join_tab->select->quick;
-    join_tab->select->quick= 0;
-  }
+    join_tab->select->set_quick(NULL);
 
   for (tab= join->join_tab; tab != join_tab ; tab++)
   {

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2011-04-04 08:47:25 +0000
+++ b/sql/sql_select.cc	2011-04-06 13:36:32 +0000
@@ -11253,10 +11253,7 @@ make_join_readinfo(JOIN *join, ulonglong
     case JT_REF_OR_NULL:
     case JT_REF:
       if (tab->select)
-      {
-	delete tab->select->quick;
-	tab->select->quick=0;
-      }
+        tab->select->set_quick(NULL);
       delete tab->quick;
       tab->quick=0;
       /* fall through */
@@ -18421,8 +18418,7 @@ int read_first_record_seq(JOIN_TAB *tab)
 static int
 test_if_quick_select(JOIN_TAB *tab)
 {
-  delete tab->select->quick;
-  tab->select->quick=0;
+  tab->select->set_quick(NULL);
   return tab->select->test_quick_select(tab->join->thd, 
                                         tab->keys,
                                         0,          // empty table map
@@ -20341,10 +20337,8 @@ skipped_filesort:
 use_filesort:
   // Restore original save_quick
   if (select && select->quick != save_quick)
-  {
-    delete select->quick;
-    select->quick= save_quick;
-  }
+    select->set_quick(save_quick);
+
   if (orig_select_cond_saved)
     tab->set_cond(orig_select_cond, __LINE__);
   DBUG_RETURN(0);

=== modified file 'sql/sql_update.cc'
--- a/sql/sql_update.cc	2011-04-01 14:04:52 +0000
+++ b/sql/sql_update.cc	2011-04-06 13:36:32 +0000
@@ -577,11 +577,10 @@ int mysql_update(THD *thd,
       /* Change select to use tempfile */
       if (select)
       {
-	delete select->quick;
-	if (select->free_cond)
-	  delete select->cond;
-	select->quick=0;
-	select->cond=0;
+        select->set_quick(NULL);
+        if (select->free_cond)
+          delete select->cond;
+        select->cond=0;
       }
       else
       {


Attachment: [text/bzr-bundle] bzr/jorgen.loland@oracle.com-20110406133632-7fnnpffk5jv9f26r.bundle
Thread
bzr commit into mysql-trunk branch (jorgen.loland:3333) Bug#11882131Jorgen Loland6 Apr