diff options
author | unknown <konstantin@mysql.com> | 2005-05-16 18:27:21 +0400 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2005-05-16 18:27:21 +0400 |
commit | 1bb1bc69935a234fcb72088e1065712ac59f475b (patch) | |
tree | e6dfafb73cbb2de3614c02947064cf7fc10404ab /include/mysql.h | |
parent | 6f4c2486439dfcbaab7e1686860385282562d442 (diff) | |
download | mariadb-git-1bb1bc69935a234fcb72088e1065712ac59f475b.tar.gz |
A fix and a test case for Bug#9643 " CURSOR_TYPE_SCROLLABLE dos not work"
- check on the client the unsupported feature and return
an error message if it's been requested.
Additionally added API support for STMT_ATTR_PREFETCH_ROWS.
Post-review fixes.
include/errmsg.h:
Add a new error code for "Not implemented" client-side error message.
include/mysql.h:
Add a statement attribute STMT_ATTR_PREFETCH_ROWS - unsigned long
number of rows to fetch per one COM_FETCH command, used when there
is a read-only cursor.
Note, that we don't break compatibility by adding this new member
because MYSQL_STMT is always allocated inside the client library by
mysql_stmt_init.
libmysql/errmsg.c:
Text for the error message CR_NOT_IMPLEMENTED
libmysql/libmysql.c:
Implement support for STMT_ATTR_PREFETCH_ROWS
Return an error message on attempt to set an attribute of a prepared
statement which is not implemented yet. We probably should be doing
it in the server: currently the server just ignores unknown attributes.
tests/mysql_client_test.c:
A test case for Bug#9643 "CURSOR_TYPE_SCROLLABLE dos not work"
- check that an error message is returned for CURSOR_TYPE_SCROLLABLE.
Additionally, check setting of STMT_ATTR_PREFETCH_ROWS.
Diffstat (limited to 'include/mysql.h')
-rw-r--r-- | include/mysql.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/mysql.h b/include/mysql.h index 24f1961a260..1b2fb7825c8 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -663,6 +663,7 @@ typedef struct st_mysql_stmt unsigned char **row); unsigned long stmt_id; /* Id for prepared statement */ unsigned long flags; /* i.e. type of cursor to open */ + unsigned long prefetch_rows; /* number of rows per one COM_FETCH */ /* Copied from mysql->server_status after execute/fetch to know server-side cursor status for this statement. @@ -701,7 +702,12 @@ enum enum_stmt_attr_type unsigned long with combination of cursor flags (read only, for update, etc) */ - STMT_ATTR_CURSOR_TYPE + STMT_ATTR_CURSOR_TYPE, + /* + Amount of rows to retrieve from server per one fetch if using cursors. + Accepts unsigned long attribute in the range 1 - ulong_max + */ + STMT_ATTR_PREFETCH_ROWS }; |