summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
authorhf@deer.(none) <>2003-07-23 15:23:20 +0500
committerhf@deer.(none) <>2003-07-23 15:23:20 +0500
commita4f899dfc0a96ab95e64b11a1890736feab72d3b (patch)
tree4f5589680b89450eee716ef28e4b85348fdb2c1f /sql/protocol.cc
parent2e35e6f866adce1c2a4d8397c8a259a3c5a9e02f (diff)
downloadmariadb-git-a4f899dfc0a96ab95e64b11a1890736feab72d3b.tar.gz
SCRUM - adding client into embedded server
error handling fixed fetch_lengths made to work differently in embedded and client cases
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;