From f918dfc8b2e449fc55c6f8466bc1a923f47e5a44 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Dec 2002 09:17:51 +0200 Subject: rename of net_pkg.cc to protocol.cc Class for sending data from server to client (Protocol) This handles both the old ( <= 4.0 ) protocol and then new binary protocol that is used for prepared statements. libmysql/libmysql.c: Jump over reserved bits in the binary protocol libmysqld/Makefile.am: rename of net_pkg.cc to protocol.cc mysql-test/r/case.result: Fixed previously wrong test mysql-test/r/cast.result: Fixed previously wrong test sql/Makefile.am: Rename of net_pkg.cc to protocol.cc sql/field.cc: Binary protocol Added key handling functions for new VARCHAR type sql/field.h: New protocol sql/ha_berkeley.cc: New protocol sql/ha_berkeley.h: New protocol sql/ha_innodb.cc: New protocol sql/ha_myisam.cc: New protocol sql/item.cc: New protocol sql/item.h: New protocol sql/item_func.cc: Removed old code from 3.23 sql/item_func.h: Set cached_result_type as it was previosly used before set sql/item_subselect.cc: Standard make_field() is now good enough sql/item_subselect.h: Use default make_field() sql/item_sum.cc: Clean up Item_sum::make_field() sql/item_sum.h: Use standard make_field() sql/item_timefunc.h: return correct types for casts() Use standard make_field() sql/log_event.cc: New protocol sql/log_event.h: New protocol sql/mysql_priv.h: Move things to protocol.h sql/opt_range.cc: Indentation cleanups + small optimization sql/procedure.h: Use MYSQL_TYPE instead of FIELD_TYPE sql/protocol.cc: Class for sending data from server to client. This handles both the old ( <= 4.0 ) protocol and then new binary protocol that is used for prepared statements. sql/repl_failsafe.cc: New protocol sql/slave.cc: New protocol sql/sql_acl.cc: New protocol sql/sql_base.cc: Move send_fields() to protocol.cc sql/sql_class.cc: New protocol sql/sql_class.h: New protocol sql/sql_db.cc: New protocol sql/sql_error.cc: New protocol sql/sql_handler.cc: New protocol sql/sql_help.cc: New protocol sql/sql_parse.cc: Remove wrong assert (variable was not initalized at this point) sql/sql_prepare.cc: New protocol sql/sql_repl.cc: New protocol sql/sql_select.cc: New protocol sql/sql_show.cc: New protocol sql/sql_string.h: New functions used by the protocol functions sql/sql_table.cc: New protocol sql/structs.h: Make second_part ulong to prepare for ANSI sub-seconds sql/time.cc: New convert function needed by the new protocol functions --- sql/sql_error.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'sql/sql_error.cc') diff --git a/sql/sql_error.cc b/sql/sql_error.cc index bba49cf818b..b208015a2bb 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -150,7 +150,7 @@ void store_warning(THD *thd, uint errcode, ...) */ static const char *warning_level_names[]= {"Note", "Warning", "Error", "?"}; - +static int warning_level_length[]= { 4, 7, 5, 1 }; my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show) { @@ -161,12 +161,13 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show) field_list.push_back(new Item_int("Code",0,4)); field_list.push_back(new Item_empty_string("Message",MYSQL_ERRMSG_SIZE)); - if (send_fields(thd,field_list,1)) + if (thd->protocol->send_fields(&field_list,1)) DBUG_RETURN(1); MYSQL_ERROR *err; SELECT_LEX *sel= &thd->lex.select_lex; ha_rows offset= sel->offset_limit, limit= sel->select_limit; + Protocol *protocol=thd->protocol; List_iterator_fast it(thd->warn_list); while ((err= it++)) @@ -179,11 +180,12 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show) offset--; continue; } - thd->packet.length(0); - net_store_data(&thd->packet,warning_level_names[err->level]); - net_store_data(&thd->packet,(uint32) err->code); - net_store_data(&thd->packet,err->msg); - if (my_net_write(&thd->net,(char*)thd->packet.ptr(),thd->packet.length())) + protocol->prepare_for_resend(); + protocol->store(warning_level_names[err->level], + warning_level_length[err->level]); + protocol->store((uint32) err->code); + protocol->store(err->msg, strlen(err->msg)); + if (protocol->write()) DBUG_RETURN(1); if (!--limit) break; -- cgit v1.2.1