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,
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;
if (next_activation_at > thd->query_start())
......
......@@ -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);
// 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)
{
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();
}
table->vers_update_fields();
}
/*
......@@ -13706,12 +13700,7 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
m_table->mark_columns_per_binlog_row_image();
if (m_vers_from_plain && m_table->versioned(VERS_TIMESTAMP))
{
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();
}
m_table->vers_update_fields();
error= m_table->file->ha_update_row(m_table->record[1], m_table->record[0]);
if (error == HA_ERR_RECORD_IS_THE_SAME)
error= 0;
......
......@@ -3376,6 +3376,7 @@ class THD :public Statement,
{ query_start_sec_part_used=1; return start_time_sec_part; }
MYSQL_TIME query_start_TIME();
private:
void start_time_inc()
{
++start_time_sec_part;
......@@ -3392,7 +3393,7 @@ class THD :public Statement,
start_time > secs;
}
inline void set_current_time()
void set_current_time()
{
my_hrtime_t hrtime= my_hrtime();
my_time_t secs= hrtime_to_my_time(hrtime);
......@@ -3408,6 +3409,8 @@ class THD :public Statement,
}
PSI_CALL_set_thread_start_time(start_time);
}
public:
inline void set_start_time()
{
if (user_time.val)
......
......@@ -2938,7 +2938,7 @@ pthread_handler_t handle_delayed_insert(void *arg)
pthread_detach_this_thread();
/* 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);
if (abort_loop)
thd->set_killed(KILL_CONNECTION);
......
......@@ -8621,7 +8621,7 @@ bool TR_table::update(ulonglong start_id, ulonglong end_id)
return true;
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)};
store(FLD_TRX_ID, start_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