Skip to content

Commit

Permalink
Fix valgrind test failures for pre_exec_time
Browse files Browse the repository at this point in the history
Summary:
Valgrind tests were failing due to pre_exec_time not being initialized
on all code paths for execute. This is intended since we only track
times on the DML requests. Hence, initialize the variable before reading
it.

Squash with D14883715

Test Plan: mtr

Reviewers: mung, yzha

Differential Revision: https://phabricator.intern.facebook.com/D15319856

Tasks: T43167423

Tags: mysql80
  • Loading branch information
Herman Lee committed May 13, 2019
1 parent 8c7368f commit 5a455f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sql/sql_parse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4650,9 +4650,12 @@ int mysql_execute_command(THD *thd, bool first_level, ulonglong *last_timer) {
case SQLCOM_DROP_SRS:

DBUG_ASSERT(lex->m_sql_cmd != nullptr);

/* The appropriate sql_cmd will set thd->pre_exec_time */
thd->pre_exec_time = 0;
res = lex->m_sql_cmd->execute(thd);

if (last_timer) {
if (last_timer && thd->pre_exec_time != 0) {
thd->status_var.pre_exec_time +=
my_timer_difftime(*last_timer, thd->pre_exec_time);
*last_timer = thd->pre_exec_time;
Expand Down

0 comments on commit 5a455f2

Please sign in to comment.