summaryrefslogtreecommitdiff
path: root/sql/sql_error.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-12-11 09:18:43 +0200
committerunknown <monty@mashka.mysql.fi>2002-12-11 09:18:43 +0200
commit4a81706558ca558abd22fbcaee2a41ecba66c2d7 (patch)
tree6269df71542c5b73ad0eb4740601b29234482f8f /sql/sql_error.cc
parent540b243aceb1a868e4262056971242a69568a4e3 (diff)
parentf918dfc8b2e449fc55c6f8466bc1a923f47e5a44 (diff)
downloadmariadb-git-4a81706558ca558abd22fbcaee2a41ecba66c2d7.tar.gz
Merge work:/home/bk/mysql-4.1 into mashka.mysql.fi:/home/my/mysql-4.1
sql/field.cc: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/procedure.h: Auto merged sql/sql_parse.cc: Auto merged
Diffstat (limited to 'sql/sql_error.cc')
-rw-r--r--sql/sql_error.cc16
1 files changed, 9 insertions, 7 deletions
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<MYSQL_ERROR> 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;