summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-01-04 15:29:42 +0100
committerAleksey Midenkov <midenok@gmail.com>2018-01-09 15:31:30 +0300
commitc92bf28b5f33103ccf34e8e4c4d20b6013a239b4 (patch)
treef70be81c1d749849b60e5f45e301ddd723b2bc83 /sql
parentd20d7a92c0c0ff33f892746b3cc40e324c13b5ba (diff)
downloadmariadb-git-c92bf28b5f33103ccf34e8e4c4d20b6013a239b4.tar.gz
cleanup: don't use thd->set_current_time() directly
Diffstat (limited to 'sql')
-rw-r--r--sql/event_queue.cc2
-rw-r--r--sql/log_event.cc15
-rw-r--r--sql/sql_class.h5
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--sql/table.cc2
5 files changed, 9 insertions, 17 deletions
diff --git a/sql/event_queue.cc b/sql/event_queue.cc
index e46326afe18..9e30534dd14 100644
--- a/sql/event_queue.cc
+++ b/sql/event_queue.cc
@@ -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())
diff --git a/sql/log_event.cc b/sql/log_event.cc
index abc979f1b58..e13037388f8 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -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;
diff --git a/sql/sql_class.h b/sql/sql_class.h
index e9add6af2da..8b3861567f6 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -3376,6 +3376,7 @@ public:
{ 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 @@ public:
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 @@ public:
}
PSI_CALL_set_thread_start_time(start_time);
}
+
+public:
inline void set_start_time()
{
if (user_time.val)
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 5e4c51c36c6..203838dac10 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -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);
diff --git a/sql/table.cc b/sql/table.cc
index e0435ccf2ca..a6f58440396 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -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);