Commit a3107c85 authored by unknown's avatar unknown

Don't reuse prepared statements if running with reconnect enabled

parent 7f30a1bf
...@@ -5061,6 +5061,14 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command, ...@@ -5061,6 +5061,14 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
dynstr_free(&ds_execute_warnings); dynstr_free(&ds_execute_warnings);
} }
/* Close the statement if - no reconnect, need new prepare */
if (mysql->reconnect)
{
mysql_stmt_close(stmt);
cur_con->stmt= NULL;
}
/* /*
We save the return code (mysql_stmt_errno(stmt)) from the last call sent We save the return code (mysql_stmt_errno(stmt)) from the last call sent
to the server into the mysqltest builtin variable $mysql_errno. This to the server into the mysqltest builtin variable $mysql_errno. This
...@@ -5864,6 +5872,8 @@ int main(int argc, char **argv) ...@@ -5864,6 +5872,8 @@ int main(int argc, char **argv)
break; break;
case Q_ENABLE_RECONNECT: case Q_ENABLE_RECONNECT:
set_reconnect(&cur_con->mysql, 1); set_reconnect(&cur_con->mysql, 1);
/* Close any open statements - no reconnect, need new prepare */
close_statements();
break; break;
case Q_DISABLE_PARSING: case Q_DISABLE_PARSING:
if (parsing_disabled == 0) if (parsing_disabled == 0)
......
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