summaryrefslogtreecommitdiff
path: root/libmysql/errmsg.c
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-05-12 11:16:12 +0400
committerunknown <konstantin@mysql.com>2005-05-12 11:16:12 +0400
commit2a8556f32deb10ecf2b1f857a1038330b38af53f (patch)
tree554b6292888722f7406c34e5af18657d1bab8645 /libmysql/errmsg.c
parentedcdc57bff956bccd085de326d200a698919ac5c (diff)
downloadmariadb-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 'libmysql/errmsg.c')
-rw-r--r--libmysql/errmsg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c
index 90ad3aefaca..48e44327d0f 100644
--- a/libmysql/errmsg.c
+++ b/libmysql/errmsg.c
@@ -80,6 +80,7 @@ const char *client_errors[]=
"Row retrieval was canceled by mysql_stmt_close() call",
"Attempt to read column without prior row fetch",
"Prepared statement contains no metadata",
+ "Attempt to read a row while there is no result set associated with the statement"
""
};
@@ -141,6 +142,7 @@ const char *client_errors[]=
"Row retrieval was canceled by mysql_stmt_close() call",
"Attempt to read column without prior row fetch",
"Prepared statement contains no metadata",
+ "Attempt to read a row while there is no result set associated with the statement"
""
};
@@ -200,6 +202,7 @@ const char *client_errors[]=
"Row retrieval was canceled by mysql_stmt_close() call",
"Attempt to read column without prior row fetch",
"Prepared statement contains no metadata",
+ "Attempt to read a row while there is no result set associated with the statement"
""
};
#endif