Skip to content

Commit

Permalink
MDEV-12660 inconsistent mysql_stmt_close
Browse files Browse the repository at this point in the history
remove dead code: this "return rc" could've never happened,
because reset_stmt_handle can only possibly fail if RESET_SERVER
flag is used.

But this "return rc" was confusing, it was under DBUG_ENTER (while
not being DBUG_RETURN) and it was skipping required stmt cleanup
at the end of the function.
  • Loading branch information
vuvova committed May 15, 2017
1 parent a65623b commit a8773ef
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libmysql/libmysql.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4713,8 +4713,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
{ {
uchar buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */ uchar buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */


if ((rc= reset_stmt_handle(stmt, RESET_ALL_BUFFERS | RESET_CLEAR_ERROR))) reset_stmt_handle(stmt, RESET_ALL_BUFFERS | RESET_CLEAR_ERROR);
return rc;


int4store(buff, stmt->stmt_id); int4store(buff, stmt->stmt_id);
if ((rc= stmt_command(mysql, COM_STMT_CLOSE, buff, 4, stmt))) if ((rc= stmt_command(mysql, COM_STMT_CLOSE, buff, 4, stmt)))
Expand Down

0 comments on commit a8773ef

Please sign in to comment.