summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2003-07-23 15:23:20 +0500
committerunknown <hf@deer.(none)>2003-07-23 15:23:20 +0500
commit41e77ddf657bd14a14ab7b48a4b2f8bad12b0d69 (patch)
tree4f5589680b89450eee716ef28e4b85348fdb2c1f /sql/protocol.cc
parentceb2374b69e37e18fa014f6685725fa4c5e52383 (diff)
downloadmariadb-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 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index b695409ec61..e90aa7585e2 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -83,6 +83,7 @@ void send_error(THD *thd, uint sql_errno, const char *err)
#ifdef EMBEDDED_LIBRARY
net->last_errno= sql_errno;
strmake(net->last_error, err, sizeof(net->last_error)-1);
+ strmov(net->sqlstate, mysql_errno_to_sqlstate(sql_errno));
#else
if (net->vio == 0)
@@ -230,6 +231,7 @@ net_printf(THD *thd, uint errcode, ...)
#else
net->last_errno= errcode;
strmake(net->last_error, text_pos, length);
+ strmake(net->sqlstate, mysql_errno_to_sqlstate(errcode), SQLSTATE_LENGTH);
#endif
thd->is_fatal_error=0; // Error message is given
DBUG_VOID_RETURN;