diff options
Diffstat (limited to 'storage/archive/ha_archive.cc')
-rw-r--r-- | storage/archive/ha_archive.cc | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 967e315d4a4..7dc02e95c62 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -18,6 +18,7 @@ #endif #include "mysql_priv.h" +#include "probes_mysql.h" #include <myisam.h> #include "ha_archive.h" @@ -917,7 +918,9 @@ int ha_archive::index_read(uchar *buf, const uchar *key, { int rc; DBUG_ENTER("ha_archive::index_read"); + MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str); rc= index_read_idx(buf, active_index, key, key_len, find_flag); + MYSQL_INDEX_READ_ROW_DONE(rc); DBUG_RETURN(rc); } @@ -960,8 +963,10 @@ error: int ha_archive::index_next(uchar * buf) { bool found= 0; + int rc; DBUG_ENTER("ha_archive::index_next"); + MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str); while (!(get_row(&archive, buf))) { @@ -972,7 +977,9 @@ int ha_archive::index_next(uchar * buf) } } - DBUG_RETURN(found ? 0 : HA_ERR_END_OF_FILE); + rc= found ? 0 : HA_ERR_END_OF_FILE; + MYSQL_INDEX_READ_ROW_DONE(rc); + DBUG_RETURN(rc); } /* @@ -1196,12 +1203,17 @@ int ha_archive::rnd_next(uchar *buf) { int rc; DBUG_ENTER("ha_archive::rnd_next"); + MYSQL_READ_ROW_START(table_share->db.str, + table_share->table_name.str, TRUE); if (share->crashed) DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); if (!scan_rows) - DBUG_RETURN(HA_ERR_END_OF_FILE); + { + rc= HA_ERR_END_OF_FILE; + goto end; + } scan_rows--; ha_statistic_increment(&SSV::ha_read_rnd_next_count); @@ -1210,6 +1222,8 @@ int ha_archive::rnd_next(uchar *buf) table->status=rc ? STATUS_NOT_FOUND: 0; +end: + MYSQL_READ_ROW_DONE(rc); DBUG_RETURN(rc); } @@ -1237,12 +1251,21 @@ void ha_archive::position(const uchar *record) int ha_archive::rnd_pos(uchar * buf, uchar *pos) { + int rc; DBUG_ENTER("ha_archive::rnd_pos"); + MYSQL_READ_ROW_START(table_share->db.str, + table_share->table_name.str, FALSE); ha_statistic_increment(&SSV::ha_read_rnd_next_count); current_position= (my_off_t)my_get_ptr(pos, ref_length); if (azseek(&archive, current_position, SEEK_SET) == (my_off_t)(-1L)) - DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); - DBUG_RETURN(get_row(&archive, buf)); + { + rc= HA_ERR_CRASHED_ON_USAGE; + goto end; + } + rc= get_row(&archive, buf); +end: + MYSQL_READ_ROW_DONE(rc); + DBUG_RETURN(rc); } /* |