List:Commits« Previous MessageNext Message »
From:Guilhem Bichot Date:March 17 2011 3:49pm
Subject:bzr commit into mysql-trunk branch (guilhem.bichot:3280)
View as plain text  
#At file:///home/mysql_src/bzrrepos_new/mysql-next-mr-opt-backporting-wl4800/ based on revid:jorgen.loland@stripped

 3280 Guilhem Bichot	2011-03-17
      Opt_trace_context::get_current_struct() not needed anymore, is deleted.
     @ sql/opt_range.cc
        fix for compiler problem
     @ sql/opt_trace.cc
        get_current_struct() gone; assert_current_struct() is enough and has narrower scope.
     @ sql/opt_trace.h
        get_current_struct() gone

    modified:
      WL4800_TODO.txt
      sql/opt_range.cc
      sql/opt_trace.cc
      sql/opt_trace.h
=== modified file 'WL4800_TODO.txt'
--- a/WL4800_TODO.txt	2011-02-16 15:06:06 +0000
+++ b/WL4800_TODO.txt	2011-03-17 15:49:17 +0000
@@ -27,11 +27,6 @@ Review comments left:
 decrypt what "id" is about in EXPLAIN).
 - more checks for non-unique keys?
 
-merge latest opt-backporting with fix for uninitialized keyuse, then
-fix all crashes of --opt-trace-protocol
-
-try to avoid the call to get_current_struct in opt_range.cc
-
 The optimizer may have second thoughts about which access method to
 use for a table. This should be traced. See example query (1) where
 the trace says that ref-access is best but we change our mind and use
@@ -55,3 +50,5 @@ make the charset parameter "const CHARSE
 In typelib.c: at the next merge, once the fix for BUG#59894 is in,
 test the crash and eliminate the workaround (search for "BUG#53164" in
 text). If so, close BUG#53164.
+
+eliminate the workaround for BUG#57341 / #11764503 when fix is merged.

=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2011-03-17 12:03:30 +0000
+++ b/sql/opt_range.cc	2011-03-17 15:49:17 +0000
@@ -8061,7 +8061,7 @@ uint sel_arg_range_seq_next(range_seq_t 
   String *active_trace_ptr= NULL; 
 
 #ifdef OPTIMIZER_TRACE
-  if (unlikely(trace_array) && 
+  if (unlikely(trace_array != NULL) &&
       unlikely(seq->param->thd->opt_trace != NULL) &&
       seq->param->thd->opt_trace->is_started())
   {

=== modified file 'sql/opt_trace.cc'
--- a/sql/opt_trace.cc	2011-03-02 09:30:17 +0000
+++ b/sql/opt_trace.cc	2011-03-17 15:49:17 +0000
@@ -153,12 +153,8 @@ public:
   size_t alloced_length() const
   { return trace_buffer.alloced_length() + query_buffer.alloced_length(); }
 
-  /**
-    Not "logical const", bad.
-    Will go away when get_get_current_struct() is not used in opt_range.cc
-    anymore.
-  */
-  Opt_trace_struct *get_current_struct() { return current_struct; }
+  void assert_current_struct(const Opt_trace_struct *s) const
+  { DBUG_ASSERT(current_struct == s); }
 
 private:
 
@@ -453,13 +449,8 @@ Opt_trace_struct& Opt_trace_struct::do_a
 const char *Opt_trace_struct::check_key(const char *key)
 {
   DBUG_ASSERT(started);
-  /**
-    User should always add to the innermost open object, not outside.
-    @todo: replace this with a member function in Opt_trace_stmt doing
-    this check; or make current_struct return a pointer-to-const. This will be
-    possible after Opt_trace_context::get_current_struct() is deleted.
-  */
-  DBUG_ASSERT(stmt->get_current_struct() == this);
+  //  User should always add to the innermost open object, not outside.
+  stmt->assert_current_struct(this);
   bool has_key= key != NULL;
   if (unlikely(has_key != requires_key))
   {
@@ -1323,12 +1314,6 @@ bool Opt_trace_context::set_query(const 
 }
 
 
-Opt_trace_struct *Opt_trace_context::get_current_struct() const
-{
-  return current_stmt_in_gen->get_current_struct();
-}
-
-
 const char *Opt_trace_context::get_tail(size_t size)
 {
   return current_stmt_in_gen->trace_buffer_tail(size);

=== modified file 'sql/opt_trace.h'
--- a/sql/opt_trace.h	2011-03-08 07:18:14 +0000
+++ b/sql/opt_trace.h	2011-03-17 15:49:17 +0000
@@ -460,12 +460,6 @@ public:
   bool set_query(const char* query, size_t length, CHARSET_INFO *charset);
 
   /**
-     @returns the current (=open, unfinished, being-generated) structure. This
-     function will be deleted after being eliminated from opt_range.cc.
-  */
-  Opt_trace_struct *get_current_struct() const;
-
-  /**
      @returns a pointer to the last bytes of the current trace, 0-terminated.
      Can be called only if is_started() is true.
      @param  size  how many last bytes are wanted


Attachment: [text/bzr-bundle] bzr/guilhem.bichot@oracle.com-20110317154917-d3l87war96tdwojh.bundle
Thread
bzr commit into mysql-trunk branch (guilhem.bichot:3280) Guilhem Bichot17 Mar