Commit c92bf28b authored by Sergei Golubchik's avatar Sergei Golubchik Committed by Aleksey Midenkov

cleanup: don't use thd->set_current_time() directly

parent d20d7a92
...@@ -617,7 +617,7 @@ Event_queue::get_top_for_execution_if_time(THD *thd, ...@@ -617,7 +617,7 @@ Event_queue::get_top_for_execution_if_time(THD *thd,
top= (Event_queue_element*) queue_top(&queue); top= (Event_queue_element*) queue_top(&queue);
thd->set_current_time(); /* Get current time */ thd->set_start_time(); /* Get current time */
next_activation_at= top->execute_at; next_activation_at= top->execute_at;
if (next_activation_at > thd->query_start()) if (next_activation_at > thd->query_start())
......
...@@ -12507,13 +12507,7 @@ Rows_log_event::write_row(rpl_group_info *rgi, ...@@ -12507,13 +12507,7 @@ Rows_log_event::write_row(rpl_group_info *rgi,
bitmap_set_bit(table->read_set, table->vers_start_field()->field_index); bitmap_set_bit(table->read_set, table->vers_start_field()->field_index);
// Check whether a row came from unversioned table and fix vers fields. // Check whether a row came from unversioned table and fix vers fields.
if (table->vers_start_field()->get_timestamp(&sec_part) == 0 && sec_part == 0) if (table->vers_start_field()->get_timestamp(&sec_part) == 0 && sec_part == 0)
{ table->vers_update_fields();
bitmap_set_bit(table->write_set, table->vers_start_field()->field_index);
bitmap_set_bit(table->write_set, table->vers_end_field()->field_index);
thd->set_current_time();
table->vers_start_field()->set_time();
table->vers_end_field()->set_max();
}
} }
/* /*
...@@ -13706,12 +13700,7 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi) ...@@ -13706,12 +13700,7 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
m_table->mark_columns_per_binlog_row_image(); m_table->mark_columns_per_binlog_row_image();
if (m_vers_from_plain && m_table->versioned(VERS_TIMESTAMP)) if (m_vers_from_plain && m_table->versioned(VERS_TIMESTAMP))
{ m_table->vers_update_fields();
bitmap_set_bit(m_table->write_set,
m_table->vers_start_field()->field_index);
thd->set_current_time();
m_table->vers_start_field()->set_time();
}
error= m_table->file->ha_update_row(m_table->record[1], m_table->record[0]); error= m_table->file->ha_update_row(m_table->record[1], m_table->record[0]);
if (error == HA_ERR_RECORD_IS_THE_SAME) if (error == HA_ERR_RECORD_IS_THE_SAME)
error= 0; error= 0;
......
...@@ -3376,6 +3376,7 @@ class THD :public Statement, ...@@ -3376,6 +3376,7 @@ class THD :public Statement,
{ query_start_sec_part_used=1; return start_time_sec_part; } { query_start_sec_part_used=1; return start_time_sec_part; }
MYSQL_TIME query_start_TIME(); MYSQL_TIME query_start_TIME();
private:
void start_time_inc() void start_time_inc()
{ {
++start_time_sec_part; ++start_time_sec_part;
...@@ -3392,7 +3393,7 @@ class THD :public Statement, ...@@ -3392,7 +3393,7 @@ class THD :public Statement,
start_time > secs; start_time > secs;
} }
inline void set_current_time() void set_current_time()
{ {
my_hrtime_t hrtime= my_hrtime(); my_hrtime_t hrtime= my_hrtime();
my_time_t secs= hrtime_to_my_time(hrtime); my_time_t secs= hrtime_to_my_time(hrtime);
...@@ -3408,6 +3409,8 @@ class THD :public Statement, ...@@ -3408,6 +3409,8 @@ class THD :public Statement,
} }
PSI_CALL_set_thread_start_time(start_time); PSI_CALL_set_thread_start_time(start_time);
} }
public:
inline void set_start_time() inline void set_start_time()
{ {
if (user_time.val) if (user_time.val)
......
...@@ -2938,7 +2938,7 @@ pthread_handler_t handle_delayed_insert(void *arg) ...@@ -2938,7 +2938,7 @@ pthread_handler_t handle_delayed_insert(void *arg)
pthread_detach_this_thread(); pthread_detach_this_thread();
/* Add thread to THD list so that's it's visible in 'show processlist' */ /* Add thread to THD list so that's it's visible in 'show processlist' */
thd->set_current_time(); thd->set_start_time();
add_to_active_threads(thd); add_to_active_threads(thd);
if (abort_loop) if (abort_loop)
thd->set_killed(KILL_CONNECTION); thd->set_killed(KILL_CONNECTION);
......
...@@ -8621,7 +8621,7 @@ bool TR_table::update(ulonglong start_id, ulonglong end_id) ...@@ -8621,7 +8621,7 @@ bool TR_table::update(ulonglong start_id, ulonglong end_id)
return true; return true;
timeval start_time= {thd->start_time, long(thd->start_time_sec_part)}; timeval start_time= {thd->start_time, long(thd->start_time_sec_part)};
thd->set_current_time(); thd->set_start_time();
timeval end_time= {thd->start_time, long(thd->start_time_sec_part)}; timeval end_time= {thd->start_time, long(thd->start_time_sec_part)};
store(FLD_TRX_ID, start_id); store(FLD_TRX_ID, start_id);
store(FLD_COMMIT_ID, end_id); store(FLD_COMMIT_ID, end_id);
......
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