Skip to content

Commit

Permalink
12956584 followup fix for mysqltest
Browse files Browse the repository at this point in the history
  run_query_stmt() might use disable_xxx vars after calling handle_no_error
  But handle_no_error() hes reverted any ONCE settings
  Fix is to take revert_properties() out of handle_no_error()

--BZR--
revision-id: [email protected]
property-branch-nick: main-55
testament3-sha1: 64b9dda5b201510b9d66e1359d96f39023260198
  • Loading branch information
bjornmu committed Sep 30, 2011
1 parent 858017f commit 1b267c8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5364,6 +5364,7 @@ int connect_n_handle_errors(struct st_command *command,

var_set_errno(0);
handle_no_error(command);
revert_properties();
return 1; /* Connected */
}

Expand Down Expand Up @@ -7319,6 +7320,7 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,

/* If we come here the query is both executed and read successfully */
handle_no_error(command);
revert_properties();

end:

Expand Down Expand Up @@ -7514,8 +7516,6 @@ void handle_no_error(struct st_command *command)
die("query '%s' succeeded - should have failed with sqlstate %s...",
command->query, command->expected_errors.err[0].code.sqlstate);
}

revert_properties();
DBUG_VOID_RETURN;
}

Expand Down Expand Up @@ -7546,9 +7546,6 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
DBUG_ENTER("run_query_stmt");
DBUG_PRINT("query", ("'%-.60s'", query));

/* Remember disable_result_log since handle_no_error() may reset it */
my_bool dis_res= disable_result_log;

/*
Init a new stmt if it's not already one created for this connection
*/
Expand Down Expand Up @@ -7644,7 +7641,7 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,

/* If we got here the statement was both executed and read successfully */
handle_no_error(command);
if (!dis_res)
if (!disable_result_log)
{
/*
Not all statements creates a result set. If there is one we can
Expand Down Expand Up @@ -7720,7 +7717,7 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
dynstr_free(&ds_prepare_warnings);
dynstr_free(&ds_execute_warnings);
}

revert_properties();

/* Close the statement if - no reconnect, need new prepare */
if (mysql->reconnect)
Expand Down

0 comments on commit 1b267c8

Please sign in to comment.