List:Commits« Previous MessageNext Message »
From:Jorgen Loland Date:January 3 2011 11:14am
Subject:bzr commit into mysql-next-mr-bugfixing branch (jorgen.loland:3244) WL#4800
View as plain text  
#At file:///export/home/jl208045/mysql/wl4800/mysql-next-mr-opt-backporting-wl4800-revert_printquick/ based on revid:jorgen.loland@stripped

 3244 Jorgen Loland	2011-01-03
      WL#4800: Followup patch: revert print_quick() and friends to 
      how they are in next-mr-opt-backporting.

    modified:
      sql/opt_range.cc
      sql/opt_range.h
=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2010-12-21 07:34:33 +0000
+++ b/sql/opt_range.cc	2011-01-03 11:14:55 +0000
@@ -792,13 +792,16 @@ TABLE_READ_PLAN *get_best_disjunct_quick
 static
 TRP_GROUP_MIN_MAX *get_best_group_min_max(PARAM *param, SEL_TREE *tree,
                                           double read_time);
-#if !defined(DBUG_OFF) || defined(OPTIMIZER_TRACE)
+#ifndef DBUG_OFF
 static void print_sel_tree(PARAM *param, SEL_TREE *tree, key_map *tree_map,
                            const char *msg);
 static void print_ror_scans_arr(TABLE *table, const char *msg,
                                 struct st_ror_scan_info **start,
                                 struct st_ror_scan_info **end);
 static void print_quick(QUICK_SELECT_I *quick, const key_map *needed_reg);
+#endif
+
+#ifdef OPTIMIZER_TRACE
 static void append_range(String *out,
                          const KEY_PART_INFO *key_parts,
                          const uchar *min_key, const uchar *max_key,
@@ -2415,7 +2418,6 @@ int SQL_SELECT::test_quick_select(THD *t
   DBUG_PRINT("enter",("keys_to_use: %lu  prev_tables: %lu  const_tables: %lu",
 		      (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;
   needed_reg.clear_all();
@@ -2587,7 +2589,6 @@ int SQL_SELECT::test_quick_select(THD *t
         */
         if (tree->type != SEL_TREE::KEY && tree->type != SEL_TREE::KEY_SMALLER)
         {
-          DBUG_ASSERT(tree->type == SEL_TREE::ALWAYS); //anything else possible?
           trace_range.add("range_scan_possible", false);
           if (tree->type == SEL_TREE::ALWAYS) 
             trace_range.add_alnum("cause", "condition_always_true");
@@ -5348,10 +5349,10 @@ static TRP_RANGE *get_key_scans_params(P
       read_plan->is_ror= tree->ror_scans_map.is_set(idx);
       read_plan->read_cost= read_time;
       read_plan->mrr_buf_size= best_buf_size;
-      //DBUG_PRINT("info",
-      //           ("Returning range plan for key %s, cost %g, records %lu",
-      //            param->table->key_info[param->real_keynr[idx]].name,
-      //            read_plan->read_cost, (ulong) read_plan->records));
+      DBUG_PRINT("info",
+                ("Returning range plan for key %s, cost %g, records %lu",
+                 param->table->key_info[param->real_keynr[idx]].name,
+                 read_plan->read_cost, (ulong) read_plan->records));
     }
   }
   else
@@ -12254,12 +12255,12 @@ static void print_ror_scans_arr(TABLE *t
 
 #endif /* !DBUG_OFF */
 
-#if !defined(DBUG_OFF) || defined(OPTIMIZER_TRACE)
-
 /*****************************************************************************
 ** Append a range for a single keypart into a stream.
 *****************************************************************************/
 
+#ifdef OPTIMIZER_TRACE
+
 /**
   Print a key into a stream
 
@@ -12346,6 +12347,8 @@ static void append_range(String *out,
   }
 }
 
+#endif //OPTIMIZER_TRACE
+
 /*****************************************************************************
 ** Print a quick range for debugging
 ** TODO:
@@ -12353,6 +12356,8 @@ static void append_range(String *out,
 ** of locking the DEBUG stream !
 *****************************************************************************/
 
+#ifndef DBUG_OFF
+
 static void
 print_multiple_key_values(KEY_PART *key_part, const uchar *key, 
                           uint used_length)
@@ -12408,10 +12413,6 @@ static void print_quick(QUICK_SELECT_I *
   quick->dbug_dump(0, TRUE);
   dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_sets);
 
-  /**
-     @todo problem: with optimizer trace on and --debug not used, this prints
-     to stderr
-  */
   fprintf(DBUG_FILE,"other_keys: 0x%s:\n", needed_reg->print(buf));
 
   DBUG_UNLOCK_FILE;
@@ -12546,7 +12547,7 @@ void QUICK_GROUP_MIN_MAX_SELECT::dbug_du
 }
 
 
-#endif /* !DBUG_OFF || OPTIMIZER_TRACE */
+#endif /* !DBUG_OFF */
 
 /*****************************************************************************
 ** Instantiate templates 

=== modified file 'sql/opt_range.h'
--- a/sql/opt_range.h	2010-11-17 12:27:39 +0000
+++ b/sql/opt_range.h	2011-01-03 11:14:55 +0000
@@ -355,7 +355,7 @@ public:
     Table record buffer used by this quick select.
   */
   uchar    *record;
-#if !defined(DBUG_OFF) || defined(OPTIMIZER_TRACE)
+#ifndef DBUG_OFF
   /*
     Print quick select information to DBUG_FILE. Caller is responsible
     for locking DBUG_FILE before this call and unlocking it afterwards.
@@ -473,7 +473,7 @@ public:
   int get_type() { return QS_TYPE_RANGE; }
   void add_keys_and_lengths(String *key_names, String *used_lengths);
   void add_info_string(String *str);
-#if !defined(DBUG_OFF) || defined(OPTIMIZER_TRACE)
+#ifndef DBUG_OFF
   void dbug_dump(int indent, bool verbose);
 #endif
   QUICK_SELECT_I *make_reverse(uint used_key_parts_arg);
@@ -571,7 +571,7 @@ public:
   void add_keys_and_lengths(String *key_names, String *used_lengths);
   void add_info_string(String *str);
   bool is_keys_used(const MY_BITMAP *fields);
-#if !defined(DBUG_OFF) || defined(OPTIMIZER_TRACE)
+#ifndef DBUG_OFF
   void dbug_dump(int indent, bool verbose);
 #endif
 
@@ -631,7 +631,7 @@ public:
   void add_keys_and_lengths(String *key_names, String *used_lengths);
   void add_info_string(String *str);
   bool is_keys_used(const MY_BITMAP *fields);
-#if !defined(DBUG_OFF) || defined(OPTIMIZER_TRACE)
+#ifndef DBUG_OFF
   void dbug_dump(int indent, bool verbose);
 #endif
   int init_ror_merged_scan(bool reuse_handler);
@@ -686,7 +686,7 @@ public:
   void add_keys_and_lengths(String *key_names, String *used_lengths);
   void add_info_string(String *str);
   bool is_keys_used(const MY_BITMAP *fields);
-#if !defined(DBUG_OFF) || defined(OPTIMIZER_TRACE)
+#ifndef DBUG_OFF
   void dbug_dump(int indent, bool verbose);
 #endif
 
@@ -810,7 +810,7 @@ public:
   bool unique_key_range() { return false; }
   int get_type() { return QS_TYPE_GROUP_MIN_MAX; }
   void add_keys_and_lengths(String *key_names, String *used_lengths);
-#if !defined(DBUG_OFF) || defined(OPTIMIZER_TRACE)
+#ifndef DBUG_OFF
   void dbug_dump(int indent, bool verbose);
 #endif
   bool is_agg_distinct() { return have_agg_distinct; }


Attachment: [text/bzr-bundle] bzr/jorgen.loland@oracle.com-20110103111455-qnyy790qpfm7wtxh.bundle
Thread
bzr commit into mysql-next-mr-bugfixing branch (jorgen.loland:3244) WL#4800Jorgen Loland3 Jan