X-Account-Key: account4 X-UIDL: 1153746480.180765 X-Mozilla-Status: 0001 X-Mozilla-Status2: 00000000 X-Mozilla-Keys: Return-Path: Received: from mailget.mysql.com ([unix socket]) by mailget (Cyrus v2.3.1-Invoca-RPM-2.3.1-2.8.fc5) with LMTPA; Wed, 23 Jul 2008 02:26:52 +0200 X-Sieve: CMU Sieve 2.3 Received: from mail.mysql.com (mail.mysql.com [10.100.1.21]) by mailget.mysql.com (8.13.8/8.13.8) with ESMTP id m6N0QqdL009771 for ; Wed, 23 Jul 2008 02:26:52 +0200 Received: from mailgate-a.mysql.com (mailgate-a.mysql.com [10.128.2.13]) by mail.mysql.com (8.13.3/8.13.3) with ESMTP id m6N0QoIN006062 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 23 Jul 2008 02:26:51 +0200 Received: from lists.mysql.com (lists.mysql.com [10.100.1.37]) by mailgate-a.mysql.com (8.14.1/8.14.1) with SMTP id m6N0JeB9017580 for ; Wed, 23 Jul 2008 02:19:41 +0200 Received: (qmail 23243 invoked by uid 510); 23 Jul 2008 00:26:48 -0000 Mailing-List: contact commits-help@lists.mysql.com; run by ezmlm List-ID: Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Archive: http://lists.mysql.com/commits/50235 Delivered-To: mailing list commits@lists.mysql.com Received: (qmail 23218 invoked by uid 509); 23 Jul 2008 00:26:48 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit From: Marc Alff Subject: bzr commit into mysql-6.0-wl2110-review branch (marc.alff:2675) WL#2110 To: commits@lists.mysql.com User-Agent: Bazaar (1.4) X-CSetKey: marc.alff@sun.com-20080723002634-6dr3u2xybxi2o36b X-Worklog: 2110 X-bzr-action: commit X-bzr-revid: marc.alff@sun.com-20080723002634-6dr3u2xybxi2o36b X-bzr-revno: 2675 Message-Id: <20080723002640.EF1401DC614@lambda.WEBLAB> Date: Tue, 22 Jul 2008 18:26:40 -0600 (MDT) X-Cxn-Txn: 56108081,34985414 #At file:///home/malff/BZR-TREE/mysql-6.0-wl2110-review-part4/ 2675 Marc Alff 2008-07-22 WL#2110 (Stored Procedures: Implement SIGNAL) Formal review part 4/10: Warning list This patch adjust the code to comply with the changes in in the diagnostics area (THD::main_da.m_stmt_area.warn_list). sql/event_scheduler.cc sql/ha_ndbcluster_binlog.cc sql/log_event.cc sql/set_var.cc sql/slave.cc sql/sql_table.cc modified: sql/event_scheduler.cc sql/ha_ndbcluster_binlog.cc sql/log_event.cc sql/set_var.cc sql/slave.cc sql/sql_table.cc === modified file 'sql/event_scheduler.cc' --- a/sql/event_scheduler.cc 2008-05-08 16:01:15 +0000 +++ b/sql/event_scheduler.cc 2008-07-23 00:26:34 +0000 @@ -72,9 +72,9 @@ struct scheduler_param { void Event_worker_thread::print_warnings(THD *thd, Event_job_data *et) { - MYSQL_ERROR *err; + SQL_condition *cond; DBUG_ENTER("evex_print_warnings"); - if (!thd->warn_list.elements) + if (!thd->main_da.m_stmt_area.warn_list.elements) DBUG_VOID_RETURN; char msg_buf[10 * STRING_BUFFER_USUAL_SIZE]; @@ -90,17 +90,18 @@ Event_worker_thread::print_warnings(THD prefix.append(et->name.str, et->name.length, system_charset_info); prefix.append("] ", 2); - List_iterator_fast it(thd->warn_list); - while ((err= it++)) + List_iterator_fast it(thd->main_da.m_stmt_area.warn_list); + while ((cond= it++)) { String err_msg(msg_buf, sizeof(msg_buf), system_charset_info); /* set it to 0 or we start adding at the end. That's the trick ;) */ err_msg.length(0); err_msg.append(prefix); - err_msg.append(err->msg, strlen(err->msg), system_charset_info); - DBUG_ASSERT(err->level < 3); - (sql_print_message_handlers[err->level])("%*s", err_msg.length(), - err_msg.c_ptr()); + err_msg.append(cond->get_message_text(), + cond->get_message_octet_length(), system_charset_info); + DBUG_ASSERT(cond->m_level < 3); + (sql_print_message_handlers[cond->m_level])("%*s", err_msg.length(), + err_msg.c_ptr()); } DBUG_VOID_RETURN; } === modified file 'sql/ha_ndbcluster_binlog.cc' --- a/sql/ha_ndbcluster_binlog.cc 2008-06-20 13:11:20 +0000 +++ b/sql/ha_ndbcluster_binlog.cc 2008-07-23 00:26:34 +0000 @@ -962,6 +962,20 @@ struct Cluster_schema uint32 any_value; }; +void print_could_not_discover_error(THD *thd, const Cluster_schema *schema) +{ + sql_print_error("NDB Binlog: Could not discover table '%s.%s' from " + "binlog schema event '%s' from node %d. " + "my_errno: %d", + schema->db, schema->name, schema->query, + schema->node_id, my_errno); + List_iterator_fast it(thd->main_da.m_stmt_area.warn_list); + SQL_condition *cond; + while ((cond= it++)) + sql_print_warning("NDB Binlog: (%d)%s", cond->m_sql_errno, + cond->get_message_text()); +} + /* Transfer schema table data into corresponding struct */ @@ -1894,15 +1908,7 @@ ndb_binlog_thread_handle_schema_event(TH } else if (ndb_create_table_from_engine(thd, schema->db, schema->name)) { - sql_print_error("NDB Binlog: Could not discover table '%s.%s' from " - "binlog schema event '%s' from node %d. " - "my_errno: %d", - schema->db, schema->name, schema->query, - schema->node_id, my_errno); - List_iterator_fast it(thd->warn_list); - MYSQL_ERROR *err; - while ((err= it++)) - sql_print_warning("NDB Binlog: (%d)%s", err->code, err->msg); + print_could_not_discover_error(thd, schema); } pthread_mutex_unlock(&LOCK_open); log_query= 1; @@ -2255,14 +2261,7 @@ ndb_binlog_thread_handle_schema_event_po } else if (ndb_create_table_from_engine(thd, schema->db, schema->name)) { - sql_print_error("NDB Binlog: Could not discover table '%s.%s' from " - "binlog schema event '%s' from node %d. my_errno: %d", - schema->db, schema->name, schema->query, - schema->node_id, my_errno); - List_iterator_fast it(thd->warn_list); - MYSQL_ERROR *err; - while ((err= it++)) - sql_print_warning("NDB Binlog: (%d)%s", err->code, err->msg); + print_could_not_discover_error(thd, schema); } pthread_mutex_unlock(&LOCK_open); } @@ -2434,14 +2433,7 @@ ndb_binlog_thread_handle_schema_event_po } else if (ndb_create_table_from_engine(thd, schema->db, schema->name)) { - sql_print_error("NDB Binlog: Could not discover table '%s.%s' from " - "binlog schema event '%s' from node %d. my_errno: %d", - schema->db, schema->name, schema->query, - schema->node_id, my_errno); - List_iterator_fast it(thd->warn_list); - MYSQL_ERROR *err; - while ((err= it++)) - sql_print_warning("NDB Binlog: (%d)%s", err->code, err->msg); + print_could_not_discover_error(thd, schema); } pthread_mutex_unlock(&LOCK_open); } === modified file 'sql/log_event.cc' --- a/sql/log_event.cc 2008-07-10 23:29:27 +0000 +++ b/sql/log_event.cc 2008-07-23 00:26:34 +0000 @@ -132,17 +132,18 @@ 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 it(thd->warn_list); - MYSQL_ERROR *err; + List_iterator_fast it(thd->main_da.m_stmt_area.warn_list); + SQL_condition *cond; buff[0]= 0; - for (err= it++, slider= buff; err && slider < buff_end - 1; - slider += len, err= it++) + for (cond= it++, slider= buff; cond && slider < buff_end - 1; + slider += len, cond= it++) { len= my_snprintf(slider, buff_end - slider, - " %s, Error_code: %d;", err->msg, err->code); + " %s, Error_code: %d;", cond->get_message_text(), + cond->m_sql_errno); } - + rli->report(level, thd->is_error()? thd->main_da.sql_errno() : 0, "Could not execute %s event on table %s.%s;" "%s handler error %s; " === modified file 'sql/set_var.cc' --- a/sql/set_var.cc 2008-07-09 07:12:43 +0000 +++ b/sql/set_var.cc 2008-07-23 00:26:34 +0000 @@ -3061,16 +3061,16 @@ static int check_pseudo_thread_id(THD *t static uchar *get_warning_count(THD *thd) { thd->sys_var_tmp.long_value= - (thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_NOTE] + - thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR] + - thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_WARN]); + (thd->main_da.m_stmt_area.warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_NOTE] + + thd->main_da.m_stmt_area.warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR] + + thd->main_da.m_stmt_area.warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_WARN]); return (uchar*) &thd->sys_var_tmp.long_value; } static uchar *get_error_count(THD *thd) { - thd->sys_var_tmp.long_value= - thd->warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR]; + thd->sys_var_tmp.long_value= + thd->main_da.m_stmt_area.warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_ERROR]; return (uchar*) &thd->sys_var_tmp.long_value; } === modified file 'sql/slave.cc' --- a/sql/slave.cc 2008-07-10 23:29:27 +0000 +++ b/sql/slave.cc 2008-07-23 00:26:34 +0000 @@ -1660,12 +1660,13 @@ static int has_temporary_error(THD *thd) /* currently temporary error set in ndbcluster */ - List_iterator_fast it(thd->warn_list); - MYSQL_ERROR *err; - while ((err= it++)) - { - DBUG_PRINT("info", ("has warning %d %s", err->code, err->msg)); - switch (err->code) + List_iterator_fast it(thd->main_da.m_stmt_area.warn_list); + SQL_condition *cond; + while ((cond= it++)) + { + DBUG_PRINT("info", ("has condition %d %s", cond->m_sql_errno, + cond->get_message_text())); + switch (cond->m_sql_errno) { case ER_GET_TEMPORARY_ERRMSG: DBUG_RETURN(1); @@ -2575,18 +2576,19 @@ Slave SQL thread aborted. Can't execute } /* Print any warnings issued */ - List_iterator_fast it(thd->warn_list); - MYSQL_ERROR *err; + List_iterator_fast it(thd->main_da.m_stmt_area.warn_list); + SQL_condition *cond; /* Added controlled slave thread cancel for replication of user-defined variables. */ bool udf_error = false; - while ((err= it++)) + while ((cond= it++)) { - if (err->code == ER_CANT_OPEN_LIBRARY) + if (cond->m_sql_errno == ER_CANT_OPEN_LIBRARY) udf_error = true; - sql_print_warning("Slave: %s Error_code: %d",err->msg, err->code); + sql_print_warning("Slave: %s Error_code: %d", + cond->get_message_text(), cond->m_sql_errno); } if (udf_error) sql_print_error("Error loading user-defined library, slave SQL " === modified file 'sql/sql_table.cc' --- a/sql/sql_table.cc 2008-07-09 07:12:43 +0000 +++ b/sql/sql_table.cc 2008-07-23 00:26:34 +0000 @@ -4246,7 +4246,7 @@ static bool mysql_admin_table(THD* thd, if (!table->table) { DBUG_PRINT("admin", ("open table failed")); - if (!thd->warn_list.elements) + if (!thd->main_da.m_stmt_area.warn_list.elements) push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, ER_CHECK_NO_SUCH_TABLE, ER(ER_CHECK_NO_SUCH_TABLE)); /* if it was a view will check md5 sum */ @@ -4354,17 +4354,17 @@ send_result: lex->cleanup_after_one_table_open(); thd->clear_error(); // these errors shouldn't get client { - List_iterator_fast it(thd->warn_list); - MYSQL_ERROR *err; - while ((err= it++)) + List_iterator_fast it(thd->main_da.m_stmt_area.warn_list); + SQL_condition *cond; + while ((cond= it++)) { protocol->prepare_for_resend(); protocol->store(table_name, system_charset_info); protocol->store((char*) operator_name, system_charset_info); - protocol->store(warning_level_names[err->level].str, - warning_level_names[err->level].length, + protocol->store(warning_level_names[cond->m_level].str, + warning_level_names[cond->m_level].length, system_charset_info); - protocol->store(err->msg, system_charset_info); + protocol->store(cond->get_message_text(), system_charset_info); if (protocol->write()) goto err; } -- MySQL Code Commits Mailing List For list archives: http://lists.mysql.com/commits To unsubscribe: http://lists.mysql.com/commits?unsub=marc.alff@mysql.com