Commit 38c5e2ca authored by Mattias Jonsson's avatar Mattias Jonsson

Bug#47902: partition_recover_myisam fails with --ps-protocol

The problem was that the warnings was never written out
when running with --ps-protocol. This was because the
warnings only appeared during the prepare phase, not
the execute phase.

Solved by not clearing the warnings from the prepare phase
if there was no other warnings.

If there are warnings from the execute phase, it is very
likely to be the same as from the prepare phase. My tests
show that if not clearing the warnings from the prepare
phase when there are warnings from the execute phase, there
will be duplicated warnings in the result.

client/mysqltest.cc:
  Only reset the prepare warnings if there are warnings from
  the execute phase. Otherwise these warnings will never be
  returned.
parent 28df6d6e
...@@ -7241,8 +7241,12 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command, ...@@ -7241,8 +7241,12 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
mysql_free_result(res); /* Free normal result set with meta data */ mysql_free_result(res); /* Free normal result set with meta data */
/* Clear prepare warnings */ /*
dynstr_set(&ds_prepare_warnings, NULL); Clear prepare warnings if there are execute warnings,
since they are probably duplicated.
*/
if (ds_execute_warnings.length || mysql->warning_count)
dynstr_set(&ds_prepare_warnings, NULL);
} }
else else
{ {
......
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