From 41e77ddf657bd14a14ab7b48a4b2f8bad12b0d69 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 Jul 2003 15:23:20 +0500 Subject: SCRUM - adding client into embedded server error handling fixed fetch_lengths made to work differently in embedded and client cases include/mysql.h: removed 'embedded' error containers - they're unnecessary now added declarations for fetch_lengths to be 'virtual' include/sql_common.h: fetch_lengths declaration removed libmysql/libmysql.c: implementations for fetch_lengths to be 'virtual' added libmysqld/lib_sql.cc: error informations now is moved from thd->net to mysql-net libmysqld/libmysqld.c: error data is in mysql->net now sql-common/client.c: we have to return old fetch_lengths implementation for 'client' case sql/protocol.cc: handling of sqlstate for embedded library added --- libmysqld/lib_sql.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libmysqld/lib_sql.cc') diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index f7b69b51d46..6d7b71c61be 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -76,8 +76,13 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, if (!skip_check) result= thd->net.last_errno ? -1 : 0; - mysql->last_error= thd->net.last_error; - mysql->net.last_errno= thd->net.last_errno; + if ((mysql->net.last_errno= thd->net.last_errno)) + { + memcpy(mysql->net.last_error, thd->net.last_error, + sizeof(mysql->net.last_error)); + memcpy(mysql->net.sqlstate, thd->net.sqlstate, + sizeof(mysql->net.sqlstate)); + } mysql->warning_count= ((THD*)mysql->thd)->total_warn_count; return result; } @@ -292,7 +297,6 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db) { THD *thd = (THD *)mysql->thd; thd->mysql= mysql; - mysql->last_error= thd->net.last_error; } void *create_embedded_thd(int client_flag, char *db) -- cgit v1.2.1