From ec9ac3fe5c823b6ae7ccb0902c267b811bf732e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Jun 2005 16:17:10 +0400 Subject: A fix and a test case for Bug#10794 "mysql_stmt_attr_set no open cursor after mysql_stmt_execute" + post-review fixes. The bug was caused by wrong flags in stmt->server_status on the client side: if there was no cursor, the server didn't send server_status flags to the client, and the old flags were used to set up the fetch function of a statement. Consequently, stmt_read_row_from_cursor was used when there was no cursor. The fix fixes the server to always send server flags to the client. include/mysql_com.h: Update stale comments. libmysql/libmysql.c: Remove an extra assignment. libmysqld/lib_sql.cc: Update to correspond to the changed signature of send_eof sql/protocol.cc: Actual fix for bug#10794: create a function that writes the eof packet to network and use it from send_fields. We need to send a full eof packet from send_fields to inform the client about the cursor status (that there is no cursor in this case). sql/protocol.h: Remove an unused parameter for send_eof. tests/mysql_client_test.c: A test case for Bug#10794 "mysql_stmt_attr_set no open cursor after mysql_stmt_execute" --- include/mysql_com.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/mysql_com.h') diff --git a/include/mysql_com.h b/include/mysql_com.h index 2293476c76c..88a614bc4a3 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -137,14 +137,14 @@ enum enum_server_command #define SERVER_QUERY_NO_GOOD_INDEX_USED 16 #define SERVER_QUERY_NO_INDEX_USED 32 /* - The server was able to fulfill client request and open read-only - non-scrollable cursor for the query. This flag comes in server - status with reply to COM_EXECUTE and COM_EXECUTE_DIRECT commands. + The server was able to fulfill the clients request and opened a + read-only non-scrollable cursor for a query. This flag comes + in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands. */ #define SERVER_STATUS_CURSOR_EXISTS 64 /* - This flag is sent with last row of read-only cursor, in reply to - COM_FETCH command. + This flag is sent when a read-only cursor is exhausted, in reply to + COM_STMT_FETCH command. */ #define SERVER_STATUS_LAST_ROW_SENT 128 #define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */ -- cgit v1.2.1