summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-07-14 20:02:33 +0400
committerunknown <konstantin@mysql.com>2005-07-14 20:02:33 +0400
commitbd44c99b853c07761554214f57c2a0700804ffc3 (patch)
treeaac1f0563c4cb7598f9f497b6d3a8cfc33f6388a /libmysql
parent69ecbbcbf31aeb5165c9134d8fa1180f42d91da1 (diff)
downloadmariadb-git-bd44c99b853c07761554214f57c2a0700804ffc3.tar.gz
A fix and a test case for Bug#11183 "mysql_stmt_reset() doesn't reset
information about error". libmysql/libmysql.c: Clear the last error on the statement if mysql_stmt_reset succeeded. tests/mysql_client_test.c: A test case for Bug#11183 "mysql_stmt_reset() doesn't reset information about error"
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 4d92db26406..d80b2ef0e39 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -1834,6 +1834,17 @@ static void net_clear_error(NET *net)
}
}
+
+static void stmt_clear_error(MYSQL_STMT *stmt)
+{
+ if (stmt->last_errno)
+ {
+ stmt->last_errno= 0;
+ stmt->last_error[0]= '\0';
+ strmov(stmt->sqlstate, not_error_sqlstate);
+ }
+}
+
/*
Set statement error code, sqlstate, and error message
from given errcode and sqlstate.
@@ -4625,6 +4636,7 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt)
param < param_end;
param++)
param->long_data_used= 0;
+ stmt_clear_error(stmt);
DBUG_RETURN(0);
}