diff options
-rw-r--r-- | sql/handler.cc | 35 | ||||
-rw-r--r-- | sql/handler.h | 15 | ||||
-rw-r--r-- | sql/sql_class.h | 23 | ||||
-rw-r--r-- | sql/sql_explain.h | 2 |
4 files changed, 37 insertions, 38 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index b47c9153e7c..2a963675813 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -43,8 +43,6 @@ #include "debug_sync.h" // DEBUG_SYNC #include "sql_audit.h" -#include "sql_analyze_stmt.h" // tracker in TABLE_IO_WAIT - #ifdef WITH_PARTITION_STORAGE_ENGINE #include "ha_partition.h" #endif @@ -56,17 +54,6 @@ #include "wsrep_mysqld.h" #include "wsrep.h" -#define TABLE_IO_WAIT(TRACKER, PSI, OP, INDEX, FLAGS, PAYLOAD) \ - { \ - if (unlikely(tracker)) \ - tracker->start_tracking(); \ - \ - MYSQL_TABLE_IO_WAIT(PSI, OP, INDEX, FLAGS, PAYLOAD); \ - \ - if (unlikely(tracker)) \ - tracker->stop_tracking(); \ - } - /* While we have legacy_db_type, we have this array to check for dups and to find handlerton from legacy_db_type. @@ -2588,28 +2575,6 @@ int handler::ha_close(void) DBUG_RETURN(close()); } -inline int handler::ha_write_tmp_row(uchar *buf) -{ - int error; - MYSQL_INSERT_ROW_START(table_share->db.str, table_share->table_name.str); - increment_statistics(&SSV::ha_tmp_write_count); - TABLE_IO_WAIT(tracker, m_psi, PSI_TABLE_WRITE_ROW, MAX_KEY, 0, - { error= write_row(buf); }) - MYSQL_INSERT_ROW_DONE(error); - return error; -} - -inline int handler::ha_update_tmp_row(const uchar *old_data, uchar *new_data) -{ - int error; - MYSQL_UPDATE_ROW_START(table_share->db.str, table_share->table_name.str); - increment_statistics(&SSV::ha_tmp_update_count); - TABLE_IO_WAIT(tracker, m_psi, PSI_TABLE_UPDATE_ROW, active_index, 0, - { error= update_row(old_data, new_data);}) - MYSQL_UPDATE_ROW_DONE(error); - return error; -} - int handler::ha_rnd_next(uchar *buf) { diff --git a/sql/handler.h b/sql/handler.h index d48be007522..f6f9bd15f18 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -34,6 +34,8 @@ #include "sql_array.h" /* Dynamic_array<> */ #include "mdl.h" +#include "sql_analyze_stmt.h" // for Exec_time_tracker + #include <my_compare.h> #include <ft_global.h> #include <keycache.h> @@ -1571,7 +1573,6 @@ typedef struct { #define UNDEF_NODEGROUP 65535 class Item; -class Exec_time_tracker; struct st_table_log_memory_entry; class partition_info; @@ -4206,6 +4207,18 @@ inline const char *table_case_name(HA_CREATE_INFO *info, const char *name) return ((lower_case_table_names == 2 && info->alias) ? info->alias : name); } + +#define TABLE_IO_WAIT(TRACKER, PSI, OP, INDEX, FLAGS, PAYLOAD) \ + { \ + if (unlikely(tracker)) \ + tracker->start_tracking(); \ + \ + MYSQL_TABLE_IO_WAIT(PSI, OP, INDEX, FLAGS, PAYLOAD); \ + \ + if (unlikely(tracker)) \ + tracker->stop_tracking(); \ + } + void print_keydup_error(TABLE *table, KEY *key, const char *msg, myf errflag); void print_keydup_error(TABLE *table, KEY *key, myf errflag); #endif diff --git a/sql/sql_class.h b/sql/sql_class.h index 1273b28cd0b..fcc7e80aafa 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -5271,6 +5271,29 @@ inline int handler::ha_read_first_row(uchar *buf, uint primary_key) return error; } +inline int handler::ha_write_tmp_row(uchar *buf) +{ + int error; + MYSQL_INSERT_ROW_START(table_share->db.str, table_share->table_name.str); + increment_statistics(&SSV::ha_tmp_write_count); + TABLE_IO_WAIT(tracker, m_psi, PSI_TABLE_WRITE_ROW, MAX_KEY, 0, + { error= write_row(buf); }) + MYSQL_INSERT_ROW_DONE(error); + return error; +} + +inline int handler::ha_update_tmp_row(const uchar *old_data, uchar *new_data) +{ + int error; + MYSQL_UPDATE_ROW_START(table_share->db.str, table_share->table_name.str); + increment_statistics(&SSV::ha_tmp_update_count); + TABLE_IO_WAIT(tracker, m_psi, PSI_TABLE_UPDATE_ROW, active_index, 0, + { error= update_row(old_data, new_data);}) + MYSQL_UPDATE_ROW_DONE(error); + return error; +} + + extern pthread_attr_t *get_connection_attrib(void); /** diff --git a/sql/sql_explain.h b/sql/sql_explain.h index 50b351cf619..e3b41eeb4f8 100644 --- a/sql/sql_explain.h +++ b/sql/sql_explain.h @@ -14,8 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "sql_analyze_stmt.h" - /* == EXPLAIN/ANALYZE architecture == |