List:Commits« Previous MessageNext Message »
From:Karen Langford Date:June 10 2011 6:20pm
Subject:bzr commit into mysql-trunk branch (karen.langford:3192)
View as plain text  
#At file:///net/helheim/store/bteam/bzr/mysql-trunk/ based on revid:karen.langford@stripped

 3192 Karen Langford	2011-06-10 [merge]
      Committed merge

    modified:
      libmysqld/emb_qcache.cc
      libmysqld/lib_sql.cc
      sql/event_scheduler.cc
      sql/field.cc
      sql/ha_ndbcluster_binlog.cc
      sql/log_event.cc
      sql/protocol.cc
      sql/rpl_slave.cc
      sql/sp.cc
      sql/sp_head.cc
      sql/sql_admin.cc
      sql/sql_audit.h
      sql/sql_base.cc
      sql/sql_class.cc
      sql/sql_class.h
      sql/sql_error.cc
      sql/sql_insert.cc
      sql/sql_load.cc
      sql/sql_parse.cc
      sql/sql_prepare.cc
      sql/sql_select.cc
      sql/sql_signal.cc
      sql/sql_table.cc
      sql/sql_time.cc
      sql/sql_update.cc
      sql/sys_vars.cc
=== modified file 'libmysqld/emb_qcache.cc'
--- a/libmysqld/emb_qcache.cc	2011-06-09 08:58:41 +0000
+++ b/libmysqld/emb_qcache.cc	2011-06-10 16:57:01 +0000
@@ -487,7 +487,7 @@ int emb_load_querycache_result(THD *thd,
   data->embedded_info->prev_ptr= prev_row;
 return_ok:
   net_send_eof(thd, thd->server_status,
-               thd->get_warning_info()->statement_warn_count());
+               thd->get_stmt_wi()->statement_warn_count());
   DBUG_RETURN(0);
 err:
   DBUG_RETURN(1);

=== modified file 'libmysqld/lib_sql.cc'
--- a/libmysqld/lib_sql.cc	2011-06-09 08:58:41 +0000
+++ b/libmysqld/lib_sql.cc	2011-06-10 16:57:01 +0000
@@ -241,7 +241,7 @@ static my_bool emb_read_prepare_result(M
   stmt->stmt_id= thd->client_stmt_id;
   stmt->param_count= thd->client_param_count;
   stmt->field_count= 0;
-  mysql->warning_count= thd->get_warning_info()->statement_warn_count();
+  mysql->warning_count= thd->get_stmt_wi()->statement_warn_count();
 
   if (thd->first_data)
   {
@@ -1047,7 +1047,7 @@ bool Protocol::send_result_set_metadata(
 
   if (flags & SEND_EOF)
     write_eof_packet(thd, thd->server_status,
-                     thd->get_warning_info()->statement_warn_count());
+                     thd->get_stmt_wi()->statement_warn_count());
 
   DBUG_RETURN(prepare_for_send(list->elements));
  err:

=== modified file 'sql/event_scheduler.cc'
--- a/sql/event_scheduler.cc	2011-06-09 08:58:41 +0000
+++ b/sql/event_scheduler.cc	2011-06-10 16:57:01 +0000
@@ -77,7 +77,7 @@ Event_worker_thread::print_warnings(THD
 {
   MYSQL_ERROR *err;
   DBUG_ENTER("evex_print_warnings");
-  if (thd->get_warning_info()->is_empty())
+  if (thd->get_stmt_wi()->is_empty())
     DBUG_VOID_RETURN;
 
   char msg_buf[10 * STRING_BUFFER_USUAL_SIZE];
@@ -93,7 +93,7 @@ Event_worker_thread::print_warnings(THD
   prefix.append(et->name.str, et->name.length, system_charset_info);
   prefix.append("] ", 2);
 
-  List_iterator_fast<MYSQL_ERROR> it(thd->get_warning_info()->warn_list());
+  List_iterator_fast<MYSQL_ERROR> it(thd->get_stmt_wi()->warn_list());
   while ((err= it++))
   {
     String err_msg(msg_buf, sizeof(msg_buf), system_charset_info);

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2011-06-09 08:58:41 +0000
+++ b/sql/field.cc	2011-06-10 16:57:01 +0000
@@ -1163,7 +1163,7 @@ int Field_num::check_int(const CHARSET_I
                         ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, 
                         ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
                         "integer", err.ptr(), field_name,
-                        (ulong) table->in_use->get_warning_info()->
+                        (ulong) table->in_use->get_stmt_wi()->
                         current_row_for_warning());
     return 1;
   }
@@ -2649,7 +2649,7 @@ int Field_new_decimal::store(const char
                         ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
                         ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
                         "decimal", errmsg.ptr(), field_name,
-                        (ulong) table->in_use->get_warning_info()->
+                        (ulong) table->in_use->get_stmt_wi()->
                         current_row_for_warning());
 
     DBUG_RETURN(err);
@@ -2670,7 +2670,7 @@ int Field_new_decimal::store(const char
                           ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
                           ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
                           "decimal", errmsg.ptr(), field_name,
-                          (ulong) table->in_use->get_warning_info()->
+                          (ulong) table->in_use->get_stmt_wi()->
                           current_row_for_warning());
       my_decimal_set_zero(&decimal_value);
       break;
@@ -5233,7 +5233,7 @@ bool Field_time::get_date(MYSQL_TIME *lt
     push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
                         ER_WARN_DATA_OUT_OF_RANGE,
                         ER(ER_WARN_DATA_OUT_OF_RANGE), field_name,
-                        thd->get_warning_info()->current_row_for_warning());
+                        thd->get_stmt_wi()->current_row_for_warning());
     return 1;
   }
   return Field_time::get_time(ltime);
@@ -6232,7 +6232,7 @@ check_string_copy_error(Field_str *field
                       ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
                       ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
                       "string", tmp, field->field_name,
-                      thd->get_warning_info()->current_row_for_warning());
+                      thd->get_stmt_wi()->current_row_for_warning());
   return TRUE;
 }
 
@@ -10080,7 +10080,7 @@ Field::set_warning(MYSQL_ERROR::enum_war
   {
     thd->cuted_fields+= cuted_increment;
     push_warning_printf(thd, level, code, ER(code), field_name,
-                        thd->get_warning_info()->current_row_for_warning());
+                        thd->get_stmt_wi()->current_row_for_warning());
     return 0;
   }
   return level >= MYSQL_ERROR::WARN_LEVEL_WARN;

=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc	2011-06-09 08:58:41 +0000
+++ b/sql/ha_ndbcluster_binlog.cc	2011-06-10 16:57:01 +0000
@@ -982,7 +982,7 @@ static void print_could_not_discover_err
                   "my_errno: %d",
                    schema->db, schema->name, schema->query,
                    schema->node_id, my_errno);
-  List_iterator_fast<MYSQL_ERROR> it(thd->get_warning_info()->warn_list());
+  List_iterator_fast<MYSQL_ERROR> it(thd->get_stmt_wi()->warn_list());
   MYSQL_ERROR *err;
   while ((err= it++))
     sql_print_warning("NDB Binlog: (%d)%s", err->get_sql_errno(),

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2011-06-09 08:58:41 +0000
+++ b/sql/log_event.cc	2011-06-10 16:57:01 +0000
@@ -208,7 +208,7 @@ static void inline slave_rows_error_repo
   char buff[MAX_SLAVE_ERRMSG], *slider;
   const char *buff_end= buff + sizeof(buff);
   uint len;
-  List_iterator_fast<MYSQL_ERROR> it(thd->get_warning_info()->warn_list());
+  List_iterator_fast<MYSQL_ERROR> it(thd->get_stmt_wi()->warn_list());
   MYSQL_ERROR *err;
   buff[0]= 0;
 
@@ -5300,7 +5300,7 @@ int Load_log_event::do_apply_event(NET*
   {
     thd->set_time((time_t)when);
     thd->set_query_id(next_query_id());
-    thd->get_warning_info()->opt_clear_warning_info(thd->query_id);
+    thd->get_stmt_wi()->opt_clear_warning_info(thd->query_id);
 
     TABLE_LIST tables;
     char table_buf[NAME_LEN + 1];

=== modified file 'sql/protocol.cc'
--- a/sql/protocol.cc	2011-06-09 08:58:41 +0000
+++ b/sql/protocol.cc	2011-06-10 16:57:01 +0000
@@ -802,7 +802,7 @@ bool Protocol::send_result_set_metadata(
       Send no warning information, as it will be sent at statement end.
     */
     if (write_eof_packet(thd, &thd->net, thd->server_status,
-                         thd->get_warning_info()->statement_warn_count()))
+                         thd->get_stmt_wi()->statement_warn_count()))
       DBUG_RETURN(1);
   }
   DBUG_RETURN(prepare_for_send(list->elements));

=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc	2011-06-09 08:58:41 +0000
+++ b/sql/rpl_slave.cc	2011-06-10 16:57:01 +0000
@@ -3747,7 +3747,7 @@ log '%s' at position %s, relay log '%s'
         }
 
         /* Print any warnings issued */
-        List_iterator_fast<MYSQL_ERROR> it(thd->get_warning_info()->warn_list());
+        List_iterator_fast<MYSQL_ERROR> it(thd->get_stmt_wi()->warn_list());
         MYSQL_ERROR *err;
         /*
           Added controlled slave thread cancel for replication

=== modified file 'sql/sp.cc'
--- a/sql/sp.cc	2011-06-09 08:58:41 +0000
+++ b/sql/sp.cc	2011-06-10 16:57:01 +0000
@@ -1727,7 +1727,7 @@ sp_exist_routines(THD *thd, TABLE_LIST *
                                sp_find_routine(thd, TYPE_ENUM_FUNCTION,
                                                name, &thd->sp_func_cache,
                                                FALSE) != NULL;
-    thd->get_warning_info()->clear_warning_info(thd->query_id);
+    thd->get_stmt_wi()->clear_warning_info(thd->query_id);
     if (! sp_object_found)
     {
       my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION or PROCEDURE",

=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc	2011-06-10 07:58:11 +0000
+++ b/sql/sp_head.cc	2011-06-10 16:57:01 +0000
@@ -1146,9 +1146,9 @@ find_handler_after_execution(THD *thd, s
                       MYSQL_ERROR::WARN_LEVEL_ERROR,
                       thd->get_stmt_da()->message());
   }
-  else if (thd->get_warning_info()->statement_warn_count())
+  else if (thd->get_stmt_wi()->statement_warn_count())
   {
-    List_iterator<MYSQL_ERROR> it(thd->get_warning_info()->warn_list());
+    List_iterator<MYSQL_ERROR> it(thd->get_stmt_wi()->warn_list());
     MYSQL_ERROR *err;
     while ((err= it++))
     {
@@ -1216,7 +1216,7 @@ sp_head::execute(THD *thd, bool merge_da
   Object_creation_ctx *saved_creation_ctx;
   Diagnostics_area *da= thd->get_stmt_da();
   Warning_info *saved_warning_info;
-  Warning_info warning_info(thd->get_warning_info()->warn_id(), false);
+  Warning_info warning_info(thd->get_stmt_wi()->warn_id(), false);
 
   /*
     Just reporting a stack overrun error
@@ -1287,8 +1287,8 @@ sp_head::execute(THD *thd, bool merge_da
   old_arena= thd->stmt_arena;
 
   /* Push a new warning information area. */
-  warning_info.append_warning_info(thd, thd->get_warning_info());
-  saved_warning_info= thd->get_warning_info();
+  warning_info.append_warning_info(thd, thd->get_stmt_wi());
+  saved_warning_info= thd->get_stmt_wi();
   da->set_warning_info(&warning_info);
 
   /*
@@ -1389,7 +1389,7 @@ sp_head::execute(THD *thd, bool merge_da
     }
 
     /* Reset number of warnings for this query. */
-    thd->get_warning_info()->reset_for_next_command();
+    thd->get_stmt_wi()->reset_for_next_command();
 
     DBUG_PRINT("execute", ("Instruction %u", ip));
 
@@ -1497,7 +1497,7 @@ sp_head::execute(THD *thd, bool merge_da
         propagated to the caller in any case.
   */
   if (err_status || merge_da_on_success)
-    saved_warning_info->merge_with_routine_info(thd, thd->get_warning_info());
+    saved_warning_info->merge_with_routine_info(thd, thd->get_stmt_wi());
   da->set_warning_info(saved_warning_info);
 
  done:

=== modified file 'sql/sql_admin.cc'
--- a/sql/sql_admin.cc	2011-06-10 07:58:11 +0000
+++ b/sql/sql_admin.cc	2011-06-10 16:57:01 +0000
@@ -353,7 +353,7 @@ static bool mysql_admin_table(THD* thd,
 
         Diagnostics_area *da= thd->get_stmt_da();
         Warning_info wi(thd->query_id, false);
-        Warning_info *wi_saved= thd->get_warning_info();
+        Warning_info *wi_saved= thd->get_stmt_wi();
 
         da->set_warning_info(&wi);
 
@@ -480,7 +480,7 @@ static bool mysql_admin_table(THD* thd,
     if (!table->table)
     {
       DBUG_PRINT("admin", ("open table failed"));
-      if (thd->get_warning_info()->is_empty())
+      if (thd->get_stmt_wi()->is_empty())
         push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
                      ER_CHECK_NO_SUCH_TABLE, ER(ER_CHECK_NO_SUCH_TABLE));
       /* if it was a view will check md5 sum */
@@ -639,7 +639,7 @@ send_result:
     lex->cleanup_after_one_table_open();
     thd->clear_error();  // these errors shouldn't get client
     {
-      List_iterator_fast<MYSQL_ERROR> it(thd->get_warning_info()->warn_list());
+      List_iterator_fast<MYSQL_ERROR> it(thd->get_stmt_wi()->warn_list());
       MYSQL_ERROR *err;
       while ((err= it++))
       {
@@ -653,7 +653,7 @@ send_result:
         if (protocol->write())
           goto err;
       }
-      thd->get_warning_info()->clear_warning_info(thd->query_id);
+      thd->get_stmt_wi()->clear_warning_info(thd->query_id);
     }
     protocol->prepare_for_resend();
     protocol->store(table_name, system_charset_info);

=== modified file 'sql/sql_audit.h'
--- a/sql/sql_audit.h	2011-06-09 08:58:41 +0000
+++ b/sql/sql_audit.h	2011-06-10 16:57:01 +0000
@@ -117,7 +117,7 @@ void mysql_audit_general(THD *thd, uint
       query= thd->query_string;
       user= user_buff;
       userlen= make_user_name(thd, user_buff);
-      rows= thd->get_warning_info()->current_row_for_warning();
+      rows= thd->get_stmt_wi()->current_row_for_warning();
     }
     else
     {

=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc	2011-06-09 08:58:41 +0000
+++ b/sql/sql_base.cc	2011-06-10 16:57:01 +0000
@@ -4016,7 +4016,7 @@ recover_from_failed_open(THD *thd)
         ha_create_table_from_engine(thd, m_failed_table->db,
                                     m_failed_table->table_name);
 
-        thd->get_warning_info()->clear_warning_info(thd->query_id);
+        thd->get_stmt_wi()->clear_warning_info(thd->query_id);
         thd->clear_error();                 // Clear error message
         thd->mdl_context.release_transactional_locks();
         break;

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2011-06-10 07:49:17 +0000
+++ b/sql/sql_class.cc	2011-06-10 16:57:01 +0000
@@ -596,7 +596,7 @@ int thd_tx_isolation(const THD *thd)
 extern "C"
 void thd_inc_row_count(THD *thd)
 {
-  thd->get_warning_info()->inc_current_row_for_warning();
+  thd->get_stmt_wi()->inc_current_row_for_warning();
 }
 
 
@@ -1010,7 +1010,7 @@ MYSQL_ERROR* THD::raise_condition(uint s
                                   const char* msg)
 {
   Diagnostics_area *da= get_stmt_da();
-  Warning_info *wi= get_warning_info();
+  Warning_info *wi= da->get_warning_info();
   MYSQL_ERROR *cond= NULL;
   DBUG_ENTER("THD::raise_condition");
 

=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h	2011-06-10 15:17:42 +0000
+++ b/sql/sql_class.h	2011-06-10 16:57:01 +0000
@@ -2833,7 +2833,7 @@ public:
   inline bool is_error() const { return get_stmt_da()->is_error(); }
 
   /// Returns Warning-information-area for the current diagnostics area.
-  Warning_info *get_warning_info()
+  Warning_info *get_stmt_wi()
   { return get_stmt_da()->get_warning_info(); }
 
   /// Returns Diagnostics-area for the current statement.

=== modified file 'sql/sql_error.cc'
--- a/sql/sql_error.cc	2011-06-10 07:49:17 +0000
+++ b/sql/sql_error.cc	2011-06-10 16:57:01 +0000
@@ -378,7 +378,7 @@ Diagnostics_area::set_ok_status(THD *thd
   if (is_error() || is_disabled())
     return;
 
-  m_statement_warn_count= thd->get_warning_info()->statement_warn_count();
+  m_statement_warn_count= thd->get_stmt_wi()->statement_warn_count();
   m_affected_rows= affected_rows_arg;
   m_last_insert_id= last_insert_id_arg;
   if (message_arg)
@@ -413,7 +413,7 @@ Diagnostics_area::set_eof_status(THD *th
     anyway.
   */
   m_statement_warn_count= (thd->spcont ?
-                           0 : thd->get_warning_info()->statement_warn_count());
+                           0 : thd->get_stmt_wi()->statement_warn_count());
 
   m_status= DA_EOF;
   DBUG_VOID_RETURN;
@@ -682,7 +682,7 @@ bool mysqld_show_warnings(THD *thd, ulon
   List<Item> field_list;
   DBUG_ENTER("mysqld_show_warnings");
 
-  DBUG_ASSERT(thd->get_warning_info()->is_read_only());
+  DBUG_ASSERT(thd->get_stmt_wi()->is_read_only());
 
   field_list.push_back(new Item_empty_string("Level", 7));
   field_list.push_back(new Item_return_int("Code",4, MYSQL_TYPE_LONG));
@@ -700,7 +700,7 @@ bool mysqld_show_warnings(THD *thd, ulon
 
   unit->set_limit(sel);
 
-  List_iterator_fast<MYSQL_ERROR> it(thd->get_warning_info()->warn_list());
+  List_iterator_fast<MYSQL_ERROR> it(thd->get_stmt_wi()->warn_list());
   while ((err= it++))
   {
     /* Skip levels that the user is not interested in */
@@ -723,7 +723,7 @@ bool mysqld_show_warnings(THD *thd, ulon
   }
   my_eof(thd);
 
-  thd->get_warning_info()->set_read_only(FALSE);
+  thd->get_stmt_wi()->set_read_only(FALSE);
 
   DBUG_RETURN(FALSE);
 }

=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc	2011-06-09 08:58:41 +0000
+++ b/sql/sql_insert.cc	2011-06-10 16:57:01 +0000
@@ -931,7 +931,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *t
       error=write_record(thd, table ,&info);
     if (error)
       break;
-    thd->get_warning_info()->inc_current_row_for_warning();
+    thd->get_stmt_wi()->inc_current_row_for_warning();
   }
 
   free_underlaid_joins(thd, &thd->lex->select_lex);
@@ -1086,11 +1086,11 @@ bool mysql_insert(THD *thd,TABLE_LIST *t
       sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
 	      (lock_type == TL_WRITE_DELAYED) ? (ulong) 0 :
 	      (ulong) (info.records - info.copied),
-              (ulong) thd->get_warning_info()->statement_warn_count());
+              (ulong) thd->get_stmt_wi()->statement_warn_count());
     else
       sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
 	      (ulong) (info.deleted + updated),
-              (ulong) thd->get_warning_info()->statement_warn_count());
+              (ulong) thd->get_stmt_wi()->statement_warn_count());
     ::my_ok(thd, info.copied + info.deleted + updated, id, buff);
   }
   thd->abort_on_warning= 0;
@@ -3573,11 +3573,11 @@ bool select_insert::send_eof()
   if (info.ignore)
     sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
 	    (ulong) (info.records - info.copied),
-            (ulong) thd->get_warning_info()->statement_warn_count());
+            (ulong) thd->get_stmt_wi()->statement_warn_count());
   else
     sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
 	    (ulong) (info.deleted+info.updated),
-            (ulong) thd->get_warning_info()->statement_warn_count());
+            (ulong) thd->get_stmt_wi()->statement_warn_count());
   row_count= info.copied + info.deleted +
              ((thd->client_capabilities & CLIENT_FOUND_ROWS) ?
               info.touched : info.updated);

=== modified file 'sql/sql_load.cc'
--- a/sql/sql_load.cc	2011-06-09 08:58:41 +0000
+++ b/sql/sql_load.cc	2011-06-10 16:57:01 +0000
@@ -590,7 +590,7 @@ int mysql_load(THD *thd,sql_exchange *ex
   }
   sprintf(name, ER(ER_LOAD_INFO), (ulong) info.records, (ulong) info.deleted,
 	  (ulong) (info.records - info.copied),
-          (ulong) thd->get_warning_info()->statement_warn_count());
+          (ulong) thd->get_stmt_wi()->statement_warn_count());
 
 #ifndef EMBEDDED_LIBRARY
   if (mysql_bin_log.is_open())
@@ -833,7 +833,7 @@ read_fixed_length(THD *thd, COPY_INFO &i
         push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
                             ER_WARN_TOO_FEW_RECORDS,
                             ER(ER_WARN_TOO_FEW_RECORDS),
-                            thd->get_warning_info()->current_row_for_warning());
+                            thd->get_stmt_wi()->current_row_for_warning());
         if (!field->maybe_null() && field->type() == FIELD_TYPE_TIMESTAMP)
             ((Field_timestamp*) field)->set_time();
       }
@@ -857,7 +857,7 @@ read_fixed_length(THD *thd, COPY_INFO &i
       push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
                           ER_WARN_TOO_MANY_RECORDS,
                           ER(ER_WARN_TOO_MANY_RECORDS),
-                          thd->get_warning_info()->current_row_for_warning());
+                          thd->get_stmt_wi()->current_row_for_warning());
     }
 
     if (thd->killed ||
@@ -893,9 +893,9 @@ read_fixed_length(THD *thd, COPY_INFO &i
       push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
                           ER_WARN_TOO_MANY_RECORDS,
                           ER(ER_WARN_TOO_MANY_RECORDS),
-                          thd->get_warning_info()->current_row_for_warning());
+                          thd->get_stmt_wi()->current_row_for_warning());
     }
-    thd->get_warning_info()->inc_current_row_for_warning();
+    thd->get_stmt_wi()->inc_current_row_for_warning();
 continue_loop:;
   }
   DBUG_RETURN(test(read_info.error));
@@ -959,7 +959,7 @@ read_sep_field(THD *thd, COPY_INFO &info
           if (field->reset())
           {
             my_error(ER_WARN_NULL_TO_NOTNULL, MYF(0), field->field_name,
-                     thd->get_warning_info()->current_row_for_warning());
+                     thd->get_stmt_wi()->current_row_for_warning());
             DBUG_RETURN(1);
           }
           field->set_null();
@@ -1031,7 +1031,7 @@ read_sep_field(THD *thd, COPY_INFO &info
           if (field->reset())
           {
             my_error(ER_WARN_NULL_TO_NOTNULL, MYF(0),field->field_name,
-                     thd->get_warning_info()->current_row_for_warning());
+                     thd->get_stmt_wi()->current_row_for_warning());
             DBUG_RETURN(1);
           }
           if (!field->maybe_null() && field->type() == FIELD_TYPE_TIMESTAMP)
@@ -1046,7 +1046,7 @@ read_sep_field(THD *thd, COPY_INFO &info
           push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
                               ER_WARN_TOO_FEW_RECORDS,
                               ER(ER_WARN_TOO_FEW_RECORDS),
-                              thd->get_warning_info()->current_row_for_warning());
+                              thd->get_stmt_wi()->current_row_for_warning());
         }
         else if (item->type() == Item::STRING_ITEM)
         {
@@ -1092,11 +1092,11 @@ read_sep_field(THD *thd, COPY_INFO &info
       thd->cuted_fields++;			/* To long row */
       push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
                           ER_WARN_TOO_MANY_RECORDS, ER(ER_WARN_TOO_MANY_RECORDS),
-                          thd->get_warning_info()->current_row_for_warning());
+                          thd->get_stmt_wi()->current_row_for_warning());
       if (thd->killed)
         DBUG_RETURN(1);
     }
-    thd->get_warning_info()->inc_current_row_for_warning();
+    thd->get_stmt_wi()->inc_current_row_for_warning();
 continue_loop:;
   }
   DBUG_RETURN(test(read_info.error));
@@ -1230,7 +1230,7 @@ read_xml_field(THD *thd, COPY_INFO &info
           push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
                               ER_WARN_TOO_FEW_RECORDS,
                               ER(ER_WARN_TOO_FEW_RECORDS),
-                              thd->get_warning_info()->current_row_for_warning());
+                              thd->get_stmt_wi()->current_row_for_warning());
         }
         else
           ((Item_user_var_as_out_param *)item)->set_null_value(cs);
@@ -1260,7 +1260,7 @@ read_xml_field(THD *thd, COPY_INFO &info
       We don't need to reset auto-increment field since we are restoring
       its default value at the beginning of each loop iteration.
     */
-    thd->get_warning_info()->inc_current_row_for_warning();
+    thd->get_stmt_wi()->inc_current_row_for_warning();
     continue_loop:;
   }
   DBUG_RETURN(test(read_info.error) || thd->is_error());

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2011-06-10 07:38:06 +0000
+++ b/sql/sql_parse.cc	2011-06-10 16:57:01 +0000
@@ -2025,12 +2025,12 @@ mysql_execute_command(THD *thd)
     variables, but for now this is probably good enough.
   */
   if ((sql_command_flags[lex->sql_command] & CF_DIAGNOSTIC_STMT) != 0)
-    thd->get_warning_info()->set_read_only(TRUE);
+    thd->get_stmt_wi()->set_read_only(TRUE);
   else
   {
-    thd->get_warning_info()->set_read_only(FALSE);
+    thd->get_stmt_wi()->set_read_only(FALSE);
     if (all_tables)
-      thd->get_warning_info()->opt_clear_warning_info(thd->query_id);
+      thd->get_stmt_wi()->opt_clear_warning_info(thd->query_id);
   }
 
 #ifdef HAVE_REPLICATION
@@ -5444,7 +5444,7 @@ void THD::reset_for_next_command()
   }
   thd->clear_error();
   thd->get_stmt_da()->reset_diagnostics_area();
-  thd->get_warning_info()->reset_for_next_command();
+  thd->get_stmt_wi()->reset_for_next_command();
   thd->rand_used= 0;
   thd->m_sent_row_count= thd->m_examined_row_count= 0;
   thd->thd_marker.emb_on_expr_nest= NULL;

=== modified file 'sql/sql_prepare.cc'
--- a/sql/sql_prepare.cc	2011-06-10 09:52:57 +0000
+++ b/sql/sql_prepare.cc	2011-06-10 16:57:01 +0000
@@ -340,7 +340,7 @@ static bool send_prep_stmt(Prepared_stat
   int2store(buff+5, columns);
   int2store(buff+7, stmt->param_count);
   buff[9]= 0;                                   // Guard against a 4.1 client
-  tmp= min(stmt->thd->get_warning_info()->statement_warn_count(), 65535);
+  tmp= min(stmt->thd->get_stmt_wi()->statement_warn_count(), 65535);
   int2store(buff+10, tmp);
 
   /*
@@ -1957,7 +1957,7 @@ static bool check_prepared_statement(Pre
 
   /* Reset warning count for each query that uses tables */
   if (tables)
-    thd->get_warning_info()->opt_clear_warning_info(thd->query_id);
+    thd->get_stmt_wi()->opt_clear_warning_info(thd->query_id);
 
   if (sql_command_flags[sql_command] & CF_HA_CLOSE)
     mysql_ha_rm_tables(thd, tables);
@@ -3561,7 +3561,7 @@ Prepared_statement::reprepare()
       Sic: we can't simply silence warnings during reprepare, because if
       it's failed, we need to return all the warnings to the user.
     */
-    thd->get_warning_info()->clear_warning_info(thd->query_id);
+    thd->get_stmt_wi()->clear_warning_info(thd->query_id);
   }
   return error;
 }

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2011-06-10 08:34:13 +0000
+++ b/sql/sql_select.cc	2011-06-10 16:57:01 +0000
@@ -17672,7 +17672,7 @@ sub_select(JOIN *join,JOIN_TAB *join_tab
     /* Set first_unmatched for the last inner table of this group */
     join_tab->last_inner->first_unmatched= join_tab;
   }
-  join->thd->get_warning_info()->reset_current_row_for_warning();
+  join->thd->get_stmt_wi()->reset_current_row_for_warning();
 
   error= (*join_tab->read_first_record)(join_tab);
 
@@ -17999,7 +17999,7 @@ evaluate_join_record(JOIN *join, JOIN_TA
       enum enum_nested_loop_state rc;
       /* A match from join_tab is found for the current partial join. */
       rc= (*join_tab->next_select)(join, join_tab+1, 0);
-      join->thd->get_warning_info()->inc_current_row_for_warning();
+      join->thd->get_stmt_wi()->inc_current_row_for_warning();
       if (rc != NESTED_LOOP_OK && rc != NESTED_LOOP_NO_MORE_ROWS)
         DBUG_RETURN(rc);
 
@@ -18031,7 +18031,7 @@ evaluate_join_record(JOIN *join, JOIN_TA
     }
     else
     {
-      join->thd->get_warning_info()->inc_current_row_for_warning();
+      join->thd->get_stmt_wi()->inc_current_row_for_warning();
       if (join_tab->not_null_compl)
       {
         /* a NULL-complemented row is not in a table so cannot be locked */
@@ -18046,7 +18046,7 @@ evaluate_join_record(JOIN *join, JOIN_TA
       with the beginning coinciding with the current partial join.
     */
     join->examined_rows++;
-    join->thd->get_warning_info()->inc_current_row_for_warning();
+    join->thd->get_stmt_wi()->inc_current_row_for_warning();
     if (join_tab->not_null_compl)
       join_tab->read_record.unlock_row(join_tab);
   }

=== modified file 'sql/sql_signal.cc'
--- a/sql/sql_signal.cc	2011-06-09 08:58:41 +0000
+++ b/sql/sql_signal.cc	2011-06-10 16:57:01 +0000
@@ -469,7 +469,7 @@ bool Sql_cmd_signal::execute(THD *thd)
 
   thd->get_stmt_da()->reset_diagnostics_area();
   thd->set_row_count_func(0);
-  thd->get_warning_info()->clear_warning_info(thd->query_id);
+  thd->get_stmt_wi()->clear_warning_info(thd->query_id);
 
   result= raise_condition(thd, &cond);
 
@@ -484,7 +484,7 @@ bool Sql_cmd_resignal::execute(THD *thd)
 
   DBUG_ENTER("Sql_cmd_resignal::execute");
 
-  thd->get_warning_info()->m_warn_id= thd->query_id;
+  thd->get_stmt_wi()->m_warn_id= thd->query_id;
 
   if (! thd->spcont || ! (signaled= thd->spcont->raised_condition()))
   {

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2011-06-09 13:15:29 +0000
+++ b/sql/sql_table.cc	2011-06-10 16:57:01 +0000
@@ -2942,7 +2942,7 @@ const CHARSET_INFO* get_sql_field_charse
 
 bool check_duplicate_warning(THD *thd, char *msg, ulong length)
 {
-  List_iterator_fast<MYSQL_ERROR> it(thd->get_warning_info()->warn_list());
+  List_iterator_fast<MYSQL_ERROR> it(thd->get_stmt_wi()->warn_list());
   MYSQL_ERROR *err;
   while ((err= it++))
   {
@@ -7058,7 +7058,7 @@ bool mysql_alter_table(THD *thd,char *ne
 end_temporary:
   my_snprintf(tmp_name, sizeof(tmp_name), ER(ER_INSERT_INFO),
 	      (ulong) (copied + deleted), (ulong) deleted,
-	      (ulong) thd->get_warning_info()->statement_warn_count());
+	      (ulong) thd->get_stmt_wi()->statement_warn_count());
   my_ok(thd, copied + deleted, 0L, tmp_name);
   DBUG_RETURN(FALSE);
 
@@ -7085,7 +7085,7 @@ err:
     Report error here.
   */
   if (alter_info->error_if_not_empty &&
-      thd->get_warning_info()->current_row_for_warning())
+      thd->get_stmt_wi()->current_row_for_warning())
   {
     const char *f_val= 0;
     enum enum_mysql_timestamp_type t_type= MYSQL_TIMESTAMP_DATE;
@@ -7290,7 +7290,7 @@ copy_data_between_tables(TABLE *from,TAB
   init_read_record(&info, thd, from, (SQL_SELECT *) 0, 1, 1, FALSE);
   if (ignore)
     to->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
-  thd->get_warning_info()->reset_current_row_for_warning();
+  thd->get_stmt_wi()->reset_current_row_for_warning();
   restore_record(to, s->default_values);        // Create empty record
   while (!(error=info.read_record(&info)))
   {
@@ -7349,7 +7349,7 @@ copy_data_between_tables(TABLE *from,TAB
     }
     else
       found_count++;
-    thd->get_warning_info()->inc_current_row_for_warning();
+    thd->get_stmt_wi()->inc_current_row_for_warning();
   }
   end_read_record(&info);
   free_io_cache(from);

=== modified file 'sql/sql_time.cc'
--- a/sql/sql_time.cc	2011-06-09 08:58:41 +0000
+++ b/sql/sql_time.cc	2011-06-10 16:57:01 +0000
@@ -817,7 +817,7 @@ void make_truncated_value_warning(THD *t
     cs->cset->snprintf(cs, warn_buff, sizeof(warn_buff),
                        ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
                        type_str, str.c_ptr(), field_name,
-                       (ulong) thd->get_warning_info()->current_row_for_warning());
+                       (ulong) thd->get_stmt_wi()->current_row_for_warning());
   else
   {
     if (time_type > MYSQL_TIMESTAMP_ERROR)

=== modified file 'sql/sql_update.cc'
--- a/sql/sql_update.cc	2011-06-09 08:58:41 +0000
+++ b/sql/sql_update.cc	2011-06-10 16:57:01 +0000
@@ -791,7 +791,7 @@ int mysql_update(THD *thd,
     }
     else
       table->file->unlock_row();
-    thd->get_warning_info()->inc_current_row_for_warning();
+    thd->get_stmt_wi()->inc_current_row_for_warning();
     if (thd->is_error())
     {
       error= 1;
@@ -897,7 +897,7 @@ int mysql_update(THD *thd,
     char buff[MYSQL_ERRMSG_SIZE];
     my_snprintf(buff, sizeof(buff), ER(ER_UPDATE_INFO), (ulong) found,
                 (ulong) updated,
-                (ulong) thd->get_warning_info()->statement_warn_count());
+                (ulong) thd->get_stmt_wi()->statement_warn_count());
     my_ok(thd, (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated,
           id, buff);
     DBUG_PRINT("info",("%ld records updated", (long) updated));

=== modified file 'sql/sys_vars.cc'
--- a/sql/sys_vars.cc	2011-06-09 08:58:41 +0000
+++ b/sql/sys_vars.cc	2011-06-10 16:57:01 +0000
@@ -2838,7 +2838,7 @@ static Sys_var_session_special Sys_rand_
 
 static ulonglong read_error_count(THD *thd)
 {
-  return thd->get_warning_info()->error_count();
+  return thd->get_stmt_wi()->error_count();
 }
 // this really belongs to the SHOW STATUS
 static Sys_var_session_special Sys_error_count(
@@ -2850,7 +2850,7 @@ static Sys_var_session_special Sys_error
 
 static ulonglong read_warning_count(THD *thd)
 {
-  return thd->get_warning_info()->warn_count();
+  return thd->get_stmt_wi()->warn_count();
 }
 // this really belongs to the SHOW STATUS
 static Sys_var_session_special Sys_warning_count(

No bundle (reason: revision is a merge (you can force generation of a bundle with env var BZR_FORCE_BUNDLE=1)).
Thread
bzr commit into mysql-trunk branch (karen.langford:3192) Karen Langford11 Jun