1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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
This commit is contained in:
unknown
2005-07-14 15:27:24 +04:00
parent 8ba10fa95b
commit fd9f67f8d2
5 changed files with 34 additions and 45 deletions

View File

@ -13050,27 +13050,6 @@ static void test_bug9478()
check_execute(stmt, rc);
if (!opt_silent && i == 0)
printf("Fetched row: %s\n", a);
/*
Although protocol-wise an attempt to execute a statement which
already has an open cursor associated with it will yield an error,
the client library behavior tested here is consistent with
the non-cursor execution scenario: mysql_stmt_execute will
silently close the cursor if necessary.
*/
{
char buff[9];
/* Fill in the execute packet */
int4store(buff, stmt->stmt_id);
buff[4]= 0; /* Flag */
int4store(buff+5, 1); /* Reserved for array bind */
rc= ((*mysql->methods->advanced_command)(mysql, COM_STMT_EXECUTE, buff,
sizeof(buff), 0,0,1) ||
(*mysql->methods->read_query_result)(mysql));
DIE_UNLESS(rc);
if (!opt_silent && i == 0)
printf("Got error (as expected): %s\n", mysql_error(mysql));
}
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
@ -13429,7 +13408,7 @@ static void test_bug10794()
bind[1].length= &a_len;
rc= mysql_stmt_bind_param(stmt, bind);
check_execute(stmt, rc);
for (i= 0; i < 34; i++)
for (i= 0; i < 42; i++)
{
id_val= (i+1)*10;
sprintf(a, "a%d", i);