diff options
author | unknown <hf@deer.(none)> | 2003-07-23 15:23:20 +0500 |
---|---|---|
committer | unknown <hf@deer.(none)> | 2003-07-23 15:23:20 +0500 |
commit | 41e77ddf657bd14a14ab7b48a4b2f8bad12b0d69 (patch) | |
tree | 4f5589680b89450eee716ef28e4b85348fdb2c1f /libmysqld/lib_sql.cc | |
parent | ceb2374b69e37e18fa014f6685725fa4c5e52383 (diff) | |
download | mariadb-git-41e77ddf657bd14a14ab7b48a4b2f8bad12b0d69.tar.gz |
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
Diffstat (limited to 'libmysqld/lib_sql.cc')
-rw-r--r-- | libmysqld/lib_sql.cc | 10 |
1 files changed, 7 insertions, 3 deletions
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) |