Commit 10bf0150 authored by unknown's avatar unknown

Merge work.mysql.com:/home/bk/mysql-4.1

into myvenu.com:/home/venu/work/sql/dev-4.1
parents 02daa107 bc953f05
...@@ -5430,12 +5430,15 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt) ...@@ -5430,12 +5430,15 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
static my_bool stmt_close(MYSQL_STMT *stmt, my_bool skip_list) static my_bool stmt_close(MYSQL_STMT *stmt, my_bool skip_list)
{ {
MYSQL *mysql; MYSQL *mysql;
my_bool error= 0;
DBUG_ENTER("mysql_stmt_close"); DBUG_ENTER("mysql_stmt_close");
DBUG_ASSERT(stmt != 0); DBUG_ASSERT(stmt != 0);
mysql= stmt->mysql; if (!(mysql= stmt->mysql))
{
my_free((gptr) stmt, MYF(MY_WME));
DBUG_RETURN(0);
}
if (mysql->status != MYSQL_STATUS_READY) if (mysql->status != MYSQL_STATUS_READY)
{ {
/* Clear the current execution status */ /* Clear the current execution status */
...@@ -5454,18 +5457,20 @@ static my_bool stmt_close(MYSQL_STMT *stmt, my_bool skip_list) ...@@ -5454,18 +5457,20 @@ static my_bool stmt_close(MYSQL_STMT *stmt, my_bool skip_list)
{ {
char buff[4]; char buff[4];
int4store(buff, stmt->stmt_id); int4store(buff, stmt->stmt_id);
error= simple_command(mysql, COM_CLOSE_STMT, buff, 4, 1); if (simple_command(mysql, COM_CLOSE_STMT, buff, 4, 1))
}
if (!error)
{ {
set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno);
stmt->mysql= NULL; /* connection isn't valid anymore */
DBUG_RETURN(1);
}
}
mysql_free_result(stmt->result); mysql_free_result(stmt->result);
free_root(&stmt->mem_root, MYF(0)); free_root(&stmt->mem_root, MYF(0));
if (!skip_list) if (!skip_list)
mysql->stmts= list_delete(mysql->stmts, &stmt->list); mysql->stmts= list_delete(mysql->stmts, &stmt->list);
mysql->status= MYSQL_STATUS_READY; mysql->status= MYSQL_STATUS_READY;
my_free((gptr) stmt, MYF(MY_WME)); my_free((gptr) stmt, MYF(MY_WME));
} DBUG_RETURN(0);
DBUG_RETURN(error);
} }
my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt) my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment