diff options
author | unknown <konstantin@mysql.com> | 2005-05-12 11:16:12 +0400 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2005-05-12 11:16:12 +0400 |
commit | 2a8556f32deb10ecf2b1f857a1038330b38af53f (patch) | |
tree | 554b6292888722f7406c34e5af18657d1bab8645 /include/errmsg.h | |
parent | edcdc57bff956bccd085de326d200a698919ac5c (diff) | |
download | mariadb-git-2a8556f32deb10ecf2b1f857a1038330b38af53f.tar.gz |
A fix and test case for Bug#9478 "mysql_stmt_attr_set mysql_stmt_execute"
(crash on attempt to re-execute a statement with an open cursor) +
post-review fixes.
include/errmsg.h:
Add a special error message when we attempt to mysql_stmt_fetch
from a statement which has no result set.
libmysql/errmsg.c:
Error message text for CR_NO_RESULT_SET
libmysql/libmysql.c:
Move the code which frees result sets on client and closes the cursor
on server, resets long data state on client and server.
This makes one function out of two (mysql_stmt_reset and
mysql_stmt_free_result), thus aggregating all related reset work
in one place.
sql-common/client.c:
Fix one place where we flushed the pending result set of a statement,
but didn't set unbuffered_fetch_cancelled flag.
sql/share/errmsg.txt:
Fix format of ER_UNKNOWN_STMT_HANDLER error message (needs to
be fixed separately in 4.1). Add two new error messages
for the case when we fetch from when there is no cursor
and for the case when we attempt to execute a statement while there is
a cursor.
sql/sql_prepare.cc:
Return error when we fetch while there is no open cursor and
when we call execute while there is a pending cursor.
Fix mysql_stmt_reset to close the open cursor if there is any.
sql/sql_select.cc:
free_items and free_root moved to Cursor::close().
sql/sql_select.h:
A comment added.
tests/mysql_client_test.c:
A test case for Bug#9478, test the case of mysql_stmt_reset
called for client-side cached result set and for the case with open cursor.
All strcpy replaced with strmov (review request).
Diffstat (limited to 'include/errmsg.h')
-rw-r--r-- | include/errmsg.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/errmsg.h b/include/errmsg.h index ae3b04b4f3a..fd3da392df4 100644 --- a/include/errmsg.h +++ b/include/errmsg.h @@ -95,6 +95,7 @@ extern const char *client_errors[]; /* Error messages */ #define CR_FETCH_CANCELED 2050 #define CR_NO_DATA 2051 #define CR_NO_STMT_METADATA 2052 -#define CR_ERROR_LAST /*Copy last error nr:*/ 2052 +#define CR_NO_RESULT_SET 2053 +#define CR_ERROR_LAST /*Copy last error nr:*/ 2053 /* Add error numbers before CR_ERROR_LAST and change it accordingly. */ |