diff options
author | unknown <konstantin@mysql.com> | 2005-07-14 15:27:24 +0400 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2005-07-14 15:27:24 +0400 |
commit | fd9f67f8d2c7bec5a1547db3c751349f6e64c803 (patch) | |
tree | 688fe5524a95846828b29c134acbcc3a4f7f0e39 /libmysql | |
parent | 8ba10fa95b23a8d99bd199aff5ba2b4b38d9f9de (diff) | |
download | mariadb-git-fd9f67f8d2c7bec5a1547db3c751349f6e64c803.tar.gz |
Implement MarkM optimization request to avoid redundnat packet exchange
in cursors.
libmysql/libmysql.c:
- reset_stmt_handle(): don't reset the server side just because we have
an open cursor: the server will close the cursor automatically if
needed
sql/sql_prepare.cc:
- implement Prepared_statement::close_cursor,
- implicitly close an open cursor in mysql_stmt_execute instead of
issuing an error (to reduce the need to explicitly close cursors
and save network bandwidth).
- cleanup
sql/sql_select.cc:
Remove a destructor: cursor destruction can not be done by simply
calling a destructor, because of cross-references between cursor
and statement memory.
sql/sql_select.h:
- add an empty Cursor destructor
tests/mysql_client_test.c:
- remove a test for dropped functionality
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/libmysql.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 2074abd0f85..a896460beeb 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -4907,13 +4907,12 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) { MYSQL *mysql= stmt->mysql; MYSQL_DATA *result= &stmt->result; - my_bool has_cursor= stmt->read_row_func == stmt_read_row_from_cursor; /* Reset stored result set if so was requested or it's a part of cursor fetch. */ - if (result->data && (has_cursor || (flags & RESET_STORE_RESULT))) + if (result->data && (flags & RESET_STORE_RESULT)) { /* Result buffered */ free_root(&result->alloc, MYF(MY_KEEP_PREALLOC)); @@ -4944,7 +4943,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) mysql->status= MYSQL_STATUS_READY; } } - if (has_cursor || (flags & RESET_SERVER_SIDE)) + if (flags & RESET_SERVER_SIDE) { /* Reset the server side statement and close the server side |