List:Commits« Previous MessageNext Message »
From:Jon Olav Hauglid Date:October 4 2012 8:51am
Subject:bzr push into mysql-trunk branch (jon.hauglid:4624 to 4625)
View as plain text  
 4625 Jon Olav Hauglid	2012-10-04 [merge]
      Merge from mysql-5.6 to mysql-trunk
      No conflicts

    modified:
      sql/sp_rcontext.cc
      sql/sp_rcontext.h
 4624 Marko Mäkelä	2012-10-04 [merge]
      Null merge mysql-5.6 to mysql-trunk.

=== modified file 'sql/sp_rcontext.cc'
--- a/sql/sp_rcontext.cc	2012-06-06 12:12:51 +0000
+++ b/sql/sp_rcontext.cc	2012-10-04 08:21:30 +0000
@@ -48,7 +48,10 @@ sp_rcontext::~sp_rcontext()
   if (m_var_table)
     free_blobs(m_var_table);
 
-  // Leave m_visible_handlers, m_activated_handlers, m_var_items, m_cstack
+  while (m_activated_handlers.elements())
+    delete m_activated_handlers.pop();
+
+  // Leave m_visible_handlers, m_var_items, m_cstack
   // and m_case_expr_holders untouched.
   // They are allocated in mem roots and will be freed accordingly.
 }
@@ -209,7 +212,7 @@ void sp_rcontext::exit_handler(sp_pconte
 {
   // Pop the current handler frame.
 
-  m_activated_handlers.pop();
+  delete m_activated_handlers.pop();
 
   // Pop frames below the target scope level.
 
@@ -218,7 +221,7 @@ void sp_rcontext::exit_handler(sp_pconte
     int handler_level= m_activated_handlers.at(i)->handler->scope->get_level();
 
     if (handler_level > target_scope->get_level())
-      m_activated_handlers.pop();
+      delete m_activated_handlers.pop();
   }
 }
 
@@ -354,13 +357,9 @@ bool sp_rcontext::handle_sql_condition(T
                                 // (e.g. "bad data").
 
   /* Add a frame to handler-call-stack. */
-  Sql_condition_info *cond_info=
-    new (callers_arena->mem_root) Sql_condition_info(found_condition,
-                                                     callers_arena);
-  Handler_call_frame *frame=
-    new (callers_arena->mem_root) Handler_call_frame(found_handler,
-                                                     cond_info,
-                                                     continue_ip);
+  Handler_call_frame *frame= new Handler_call_frame(found_handler,
+                                                    found_condition,
+                                                    continue_ip);
   m_activated_handlers.append(frame);
 
   *ip= handler_entry->first_ip;

=== modified file 'sql/sp_rcontext.h'
--- a/sql/sp_rcontext.h	2012-06-06 12:12:51 +0000
+++ b/sql/sp_rcontext.h	2012-10-04 08:21:30 +0000
@@ -113,7 +113,7 @@ public:
   /// standard SQL-condition processing (Diagnostics_area should contain an
   /// object for active SQL-condition, not just information stored in DA's
   /// fields).
-  class Sql_condition_info : public Sql_alloc
+  class Sql_condition_info
   {
   public:
     /// SQL error code.
@@ -126,21 +126,20 @@ public:
     char sql_state[SQLSTATE_LENGTH + 1];
 
     /// Text message.
-    char *message;
+    char message[MYSQL_ERRMSG_SIZE];
 
     /// The constructor.
     ///
     /// @param _sql_condition  The SQL condition.
     /// @param arena           Query arena for SP
-    Sql_condition_info(const Sql_condition *_sql_condition,
-                       Query_arena *arena)
+    Sql_condition_info(const Sql_condition *_sql_condition)
       :sql_errno(_sql_condition->get_sql_errno()),
        level(_sql_condition->get_level())
     {
       memcpy(sql_state, _sql_condition->get_sqlstate(), SQLSTATE_LENGTH);
       sql_state[SQLSTATE_LENGTH]= '\0';
 
-      message= strdup_root(arena->mem_root, _sql_condition->get_message_text());
+      strncpy(message, _sql_condition->get_message_text(), MYSQL_ERRMSG_SIZE);
     }
   };
 
@@ -148,14 +147,14 @@ private:
   /// This class represents a call frame of SQL-handler (one invocation of a
   /// handler). Basically, it's needed to store continue instruction pointer for
   /// CONTINUE SQL-handlers.
-  class Handler_call_frame : public Sql_alloc
+  class Handler_call_frame
   {
   public:
     /// Handler definition (from parsing context).
     const sp_handler *handler;
 
     /// SQL-condition, triggered handler activation.
-    const Sql_condition_info *sql_condition;
+    const Sql_condition_info sql_condition;
 
     /// Continue-instruction-pointer for CONTINUE-handlers.
     /// The attribute contains 0 for EXIT-handlers.
@@ -166,7 +165,7 @@ private:
     /// @param _sql_condition SQL-condition, triggered handler activation.
     /// @param _continue_ip   Continue instruction pointer.
     Handler_call_frame(const sp_handler *_handler,
-                       const Sql_condition_info *_sql_condition,
+                       const Sql_condition *_sql_condition,
                        uint _continue_ip)
      :handler(_handler),
       sql_condition(_sql_condition),
@@ -230,7 +229,7 @@ public:
   const Sql_condition_info *raised_condition() const
   {
     return m_activated_handlers.elements() ?
-      (*m_activated_handlers.back())->sql_condition : NULL;
+      &(*m_activated_handlers.back())->sql_condition : NULL;
   }
 
   /// Handle current SQL condition (if any).

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (jon.hauglid:4624 to 4625) Jon Olav Hauglid4 Oct