summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorkonstantin@mysql.com <>2005-02-10 17:53:06 +0300
committerkonstantin@mysql.com <>2005-02-10 17:53:06 +0300
commit6054f8140c9797f7efe81b66e3cd2c553def60d1 (patch)
tree7bfba9f1adbfda2e33a18e54b581ca9e86fa2512 /libmysql
parente9225b2588fd4c3c94ff3d74e3b38fd5f090d3e2 (diff)
parent4b2b327dccfb2acc2903d83a5611045987e47183 (diff)
downloadmariadb-git-6054f8140c9797f7efe81b66e3cd2c553def60d1.tar.gz
Merge mysql.com:/home/kostja/work/mysql-4.1-root
into mysql.com:/home/kostja/work/mysql-5.0-root
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 48af83f4de5..d0dee7976db 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -1809,6 +1809,18 @@ static my_bool my_realloc_str(NET *net, ulong length)
}
+/* Clear possible error statee of struct NET */
+
+static void net_clear_error(NET *net)
+{
+ if (net->last_errno)
+ {
+ net->last_errno= 0;
+ net->last_error[0]= '\0';
+ strmov(net->sqlstate, not_error_sqlstate);
+ }
+}
+
/*
Set statement error code, sqlstate, and error message
from given errcode and sqlstate.
@@ -4869,6 +4881,11 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
if (mysql->unbuffered_fetch_owner == &stmt->unbuffered_fetch_cancelled)
mysql->unbuffered_fetch_owner= 0;
+ /*
+ Clear NET error state: if the following commands come through
+ successfully, connection will still be usable for other commands.
+ */
+ net_clear_error(&mysql->net);
if (mysql->status != MYSQL_STATUS_READY)
{
/*