diff options
Diffstat (limited to 'storage/federated/ha_federated.cc')
-rw-r--r-- | storage/federated/ha_federated.cc | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index 2f1c5e51caa..69cb2599740 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -380,6 +380,7 @@ #endif #include "ha_federated.h" +#include "probes_mysql.h" #include "m_string.h" @@ -2324,13 +2325,17 @@ int ha_federated::delete_row(const uchar *buf) int ha_federated::index_read(uchar *buf, const uchar *key, uint key_len, ha_rkey_function find_flag) { + int rc; DBUG_ENTER("ha_federated::index_read"); + MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str); if (stored_result) mysql_free_result(stored_result); - DBUG_RETURN(index_read_idx_with_result_set(buf, active_index, key, - key_len, find_flag, - &stored_result)); + rc= index_read_idx_with_result_set(buf, active_index, key, + key_len, find_flag, + &stored_result); + MYSQL_INDEX_READ_ROW_DONE(retval); + DBUG_RETURN(rc); } @@ -2478,6 +2483,7 @@ int ha_federated::read_range_first(const key_range *start_key, sizeof(sql_query_buffer), &my_charset_bin); DBUG_ENTER("ha_federated::read_range_first"); + MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str); DBUG_ASSERT(!(start_key == NULL && end_key == NULL)); @@ -2506,10 +2512,12 @@ int ha_federated::read_range_first(const key_range *start_key, } retval= read_next(table->record[0], stored_result); + MYSQL_INDEX_READ_ROW_DONE(retval); DBUG_RETURN(retval); error: table->status= STATUS_NOT_FOUND; + MYSQL_INDEX_READ_ROW_DONE(retval); DBUG_RETURN(retval); } @@ -2518,7 +2526,9 @@ int ha_federated::read_range_next() { int retval; DBUG_ENTER("ha_federated::read_range_next"); - retval= rnd_next(table->record[0]); + MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str); + retval= rnd_next_int(table->record[0]); + MYSQL_INDEX_READ_ROW_DONE(retval); DBUG_RETURN(retval); } @@ -2526,9 +2536,13 @@ int ha_federated::read_range_next() /* Used to read forward through the index. */ int ha_federated::index_next(uchar *buf) { + int retval; DBUG_ENTER("ha_federated::index_next"); + MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str); ha_statistic_increment(&SSV::ha_read_next_count); - DBUG_RETURN(read_next(buf, stored_result)); + retval= read_next(buf, stored_result); + MYSQL_INDEX_READ_ROW_DONE(retval); + DBUG_RETURN(retval); } @@ -2637,7 +2651,18 @@ int ha_federated::index_end(void) int ha_federated::rnd_next(uchar *buf) { + int rc; DBUG_ENTER("ha_federated::rnd_next"); + MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str, + TRUE); + rc= rnd_next_int(buf); + MYSQL_READ_ROW_DONE(rc); + DBUG_RETURN(rc); +} + +int ha_federated::rnd_next_int(uchar *buf) +{ + DBUG_ENTER("ha_federated::rnd_next_int"); if (stored_result == 0) { @@ -2726,6 +2751,8 @@ int ha_federated::rnd_pos(uchar *buf, uchar *pos) { int result; DBUG_ENTER("ha_federated::rnd_pos"); + MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str, + FALSE); ha_statistic_increment(&SSV::ha_read_rnd_count); if (table->s->primary_key != MAX_KEY) { @@ -2740,6 +2767,7 @@ int ha_federated::rnd_pos(uchar *buf, uchar *pos) result= 0; } table->status= result ? STATUS_NOT_FOUND : 0; + MYSQL_READ_ROW_DONE(result); DBUG_RETURN(result); } |