Commit 4b70fc0c authored by Sergei Golubchik's avatar Sergei Golubchik

less boilerplate code - move common operations to wrappers

parent a8446356
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "log.h" #include "log.h"
#include "rpl_tblmap.h" #include "rpl_tblmap.h"
#include "mdl.h" #include "mdl.h"
#include "probes_mysql.h"
#include "sql_locale.h" /* my_locale_st */ #include "sql_locale.h" /* my_locale_st */
#include "sql_profile.h" /* PROFILING */ #include "sql_profile.h" /* PROFILING */
#include "scheduler.h" /* thd_scheduler */ #include "scheduler.h" /* thd_scheduler */
...@@ -3921,11 +3922,13 @@ inline int handler::ha_index_read_map(uchar * buf, const uchar * key, ...@@ -3921,11 +3922,13 @@ inline int handler::ha_index_read_map(uchar * buf, const uchar * key,
enum ha_rkey_function find_flag) enum ha_rkey_function find_flag)
{ {
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
increment_statistics(&SSV::ha_read_key_count); increment_statistics(&SSV::ha_read_key_count);
int error= index_read_map(buf, key, keypart_map, find_flag); int error= index_read_map(buf, key, keypart_map, find_flag);
if (!error) if (!error)
update_index_statistics(); update_index_statistics();
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -3934,6 +3937,7 @@ inline int handler::ha_index_read_idx_map(uchar * buf, uint index, ...@@ -3934,6 +3937,7 @@ inline int handler::ha_index_read_idx_map(uchar * buf, uint index,
key_part_map keypart_map, key_part_map keypart_map,
enum ha_rkey_function find_flag) enum ha_rkey_function find_flag)
{ {
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
increment_statistics(&SSV::ha_read_key_count); increment_statistics(&SSV::ha_read_key_count);
int error= index_read_idx_map(buf, index, key, keypart_map, find_flag); int error= index_read_idx_map(buf, index, key, keypart_map, find_flag);
if (!error) if (!error)
...@@ -3942,50 +3946,59 @@ inline int handler::ha_index_read_idx_map(uchar * buf, uint index, ...@@ -3942,50 +3946,59 @@ inline int handler::ha_index_read_idx_map(uchar * buf, uint index,
index_rows_read[index]++; index_rows_read[index]++;
} }
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
inline int handler::ha_index_next(uchar * buf) inline int handler::ha_index_next(uchar * buf)
{ {
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
increment_statistics(&SSV::ha_read_next_count); increment_statistics(&SSV::ha_read_next_count);
int error= index_next(buf); int error= index_next(buf);
if (!error) if (!error)
update_index_statistics(); update_index_statistics();
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
inline int handler::ha_index_prev(uchar * buf) inline int handler::ha_index_prev(uchar * buf)
{ {
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
increment_statistics(&SSV::ha_read_prev_count); increment_statistics(&SSV::ha_read_prev_count);
int error= index_prev(buf); int error= index_prev(buf);
if (!error) if (!error)
update_index_statistics(); update_index_statistics();
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
inline int handler::ha_index_first(uchar * buf) inline int handler::ha_index_first(uchar * buf)
{ {
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
increment_statistics(&SSV::ha_read_first_count); increment_statistics(&SSV::ha_read_first_count);
int error= index_first(buf); int error= index_first(buf);
if (!error) if (!error)
update_index_statistics(); update_index_statistics();
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
inline int handler::ha_index_last(uchar * buf) inline int handler::ha_index_last(uchar * buf)
{ {
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
increment_statistics(&SSV::ha_read_last_count); increment_statistics(&SSV::ha_read_last_count);
int error= index_last(buf); int error= index_last(buf);
if (!error) if (!error)
update_index_statistics(); update_index_statistics();
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -3993,11 +4006,13 @@ inline int handler::ha_index_next_same(uchar *buf, const uchar *key, ...@@ -3993,11 +4006,13 @@ inline int handler::ha_index_next_same(uchar *buf, const uchar *key,
uint keylen) uint keylen)
{ {
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
increment_statistics(&SSV::ha_read_next_count); increment_statistics(&SSV::ha_read_next_count);
int error= index_next_same(buf, key, keylen); int error= index_next_same(buf, key, keylen);
if (!error) if (!error)
update_index_statistics(); update_index_statistics();
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -4012,21 +4027,25 @@ inline int handler::ha_ft_read(uchar *buf) ...@@ -4012,21 +4027,25 @@ inline int handler::ha_ft_read(uchar *buf)
inline int handler::ha_rnd_next(uchar *buf) inline int handler::ha_rnd_next(uchar *buf)
{ {
MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str, TRUE);
increment_statistics(&SSV::ha_read_rnd_next_count); increment_statistics(&SSV::ha_read_rnd_next_count);
int error= rnd_next(buf); int error= rnd_next(buf);
if (!error) if (!error)
rows_read++; rows_read++;
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_READ_ROW_DONE(error);
return error; return error;
} }
inline int handler::ha_rnd_pos(uchar *buf, uchar *pos) inline int handler::ha_rnd_pos(uchar *buf, uchar *pos)
{ {
MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str, FALSE);
increment_statistics(&SSV::ha_read_rnd_count); increment_statistics(&SSV::ha_read_rnd_count);
int error= rnd_pos(buf, pos); int error= rnd_pos(buf, pos);
if (!error) if (!error)
rows_read++; rows_read++;
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -4050,18 +4069,4 @@ inline int handler::ha_read_first_row(uchar *buf, uint primary_key) ...@@ -4050,18 +4069,4 @@ inline int handler::ha_read_first_row(uchar *buf, uint primary_key)
#endif /* MYSQL_SERVER */ #endif /* MYSQL_SERVER */
#if 0
/**
The meat of thd_proc_info(THD*, char*), a macro that packs the last
three calling-info parameters.
*/
extern "C"
const char *set_thd_proc_info(void *thd_arg, const char *info,
const char *calling_func,
const char *calling_file,
const unsigned int calling_line);
#define thd_proc_info(thd, msg) \
set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__)
#endif
#endif /* SQL_CLASS_INCLUDED */ #endif /* SQL_CLASS_INCLUDED */
...@@ -19,11 +19,9 @@ ...@@ -19,11 +19,9 @@
#pragma implementation // gcc: Class implementation #pragma implementation // gcc: Class implementation
#endif #endif
#include "sql_priv.h"
#include "probes_mysql.h"
#include "sql_class.h" // SSV #include "sql_class.h" // SSV
#include "sql_table.h" #include "sql_table.h" // build_table_filename
#include <myisam.h> #include <myisam.h> // T_EXTEND
#include "ha_archive.h" #include "ha_archive.h"
#include <my_dir.h> #include <my_dir.h>
...@@ -1008,9 +1006,7 @@ int ha_archive::index_read(uchar *buf, const uchar *key, ...@@ -1008,9 +1006,7 @@ int ha_archive::index_read(uchar *buf, const uchar *key,
{ {
int rc; int rc;
DBUG_ENTER("ha_archive::index_read"); 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); rc= index_read_idx(buf, active_index, key, key_len, find_flag);
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -1060,7 +1056,6 @@ int ha_archive::index_next(uchar * buf) ...@@ -1060,7 +1056,6 @@ int ha_archive::index_next(uchar * buf)
int rc; int rc;
DBUG_ENTER("ha_archive::index_next"); 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))) while (!(get_row(&archive, buf)))
{ {
...@@ -1072,7 +1067,6 @@ int ha_archive::index_next(uchar * buf) ...@@ -1072,7 +1067,6 @@ int ha_archive::index_next(uchar * buf)
} }
rc= found ? 0 : HA_ERR_END_OF_FILE; rc= found ? 0 : HA_ERR_END_OF_FILE;
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -1300,8 +1294,6 @@ int ha_archive::rnd_next(uchar *buf) ...@@ -1300,8 +1294,6 @@ int ha_archive::rnd_next(uchar *buf)
{ {
int rc; int rc;
DBUG_ENTER("ha_archive::rnd_next"); DBUG_ENTER("ha_archive::rnd_next");
MYSQL_READ_ROW_START(table_share->db.str,
table_share->table_name.str, TRUE);
if (share->crashed) if (share->crashed)
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
...@@ -1320,7 +1312,6 @@ int ha_archive::rnd_next(uchar *buf) ...@@ -1320,7 +1312,6 @@ int ha_archive::rnd_next(uchar *buf)
table->status=rc ? STATUS_NOT_FOUND: 0; table->status=rc ? STATUS_NOT_FOUND: 0;
end: end:
MYSQL_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -1350,8 +1341,6 @@ int ha_archive::rnd_pos(uchar * buf, uchar *pos) ...@@ -1350,8 +1341,6 @@ int ha_archive::rnd_pos(uchar * buf, uchar *pos)
{ {
int rc; int rc;
DBUG_ENTER("ha_archive::rnd_pos"); 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); ha_statistic_increment(&SSV::ha_read_rnd_next_count);
current_position= (my_off_t)my_get_ptr(pos, ref_length); current_position= (my_off_t)my_get_ptr(pos, ref_length);
if (azseek(&archive, current_position, SEEK_SET) == (my_off_t)(-1L)) if (azseek(&archive, current_position, SEEK_SET) == (my_off_t)(-1L))
...@@ -1361,7 +1350,6 @@ int ha_archive::rnd_pos(uchar * buf, uchar *pos) ...@@ -1361,7 +1350,6 @@ int ha_archive::rnd_pos(uchar * buf, uchar *pos)
} }
rc= get_row(&archive, buf); rc= get_row(&archive, buf);
end: end:
MYSQL_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#define MYSQL_SERVER 1 #define MYSQL_SERVER 1
#include "sql_priv.h" #include "sql_priv.h"
#include "unireg.h" #include "unireg.h"
#include "probes_mysql.h"
#include "ha_blackhole.h" #include "ha_blackhole.h"
#include "sql_class.h" // THD, SYSTEM_THREAD_SLAVE_SQL #include "sql_class.h" // THD, SYSTEM_THREAD_SLAVE_SQL
...@@ -143,14 +142,11 @@ int ha_blackhole::rnd_next(uchar *buf) ...@@ -143,14 +142,11 @@ int ha_blackhole::rnd_next(uchar *buf)
{ {
int rc; int rc;
DBUG_ENTER("ha_blackhole::rnd_next"); DBUG_ENTER("ha_blackhole::rnd_next");
MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
TRUE);
THD *thd= ha_thd(); THD *thd= ha_thd();
if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL && thd->query() == NULL) if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL && thd->query() == NULL)
rc= 0; rc= 0;
else else
rc= HA_ERR_END_OF_FILE; rc= HA_ERR_END_OF_FILE;
MYSQL_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -158,10 +154,7 @@ int ha_blackhole::rnd_next(uchar *buf) ...@@ -158,10 +154,7 @@ int ha_blackhole::rnd_next(uchar *buf)
int ha_blackhole::rnd_pos(uchar * buf, uchar *pos) int ha_blackhole::rnd_pos(uchar * buf, uchar *pos)
{ {
DBUG_ENTER("ha_blackhole::rnd_pos"); DBUG_ENTER("ha_blackhole::rnd_pos");
MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
FALSE);
DBUG_ASSERT(0); DBUG_ASSERT(0);
MYSQL_READ_ROW_DONE(0);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
...@@ -234,13 +227,11 @@ int ha_blackhole::index_read_map(uchar * buf, const uchar * key, ...@@ -234,13 +227,11 @@ int ha_blackhole::index_read_map(uchar * buf, const uchar * key,
{ {
int rc; int rc;
DBUG_ENTER("ha_blackhole::index_read"); DBUG_ENTER("ha_blackhole::index_read");
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
THD *thd= ha_thd(); THD *thd= ha_thd();
if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL && thd->query() == NULL) if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL && thd->query() == NULL)
rc= 0; rc= 0;
else else
rc= HA_ERR_END_OF_FILE; rc= HA_ERR_END_OF_FILE;
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -251,13 +242,11 @@ int ha_blackhole::index_read_idx_map(uchar * buf, uint idx, const uchar * key, ...@@ -251,13 +242,11 @@ int ha_blackhole::index_read_idx_map(uchar * buf, uint idx, const uchar * key,
{ {
int rc; int rc;
DBUG_ENTER("ha_blackhole::index_read_idx"); DBUG_ENTER("ha_blackhole::index_read_idx");
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
THD *thd= ha_thd(); THD *thd= ha_thd();
if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL && thd->query() == NULL) if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL && thd->query() == NULL)
rc= 0; rc= 0;
else else
rc= HA_ERR_END_OF_FILE; rc= HA_ERR_END_OF_FILE;
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -267,13 +256,11 @@ int ha_blackhole::index_read_last_map(uchar * buf, const uchar * key, ...@@ -267,13 +256,11 @@ int ha_blackhole::index_read_last_map(uchar * buf, const uchar * key,
{ {
int rc; int rc;
DBUG_ENTER("ha_blackhole::index_read_last"); DBUG_ENTER("ha_blackhole::index_read_last");
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
THD *thd= ha_thd(); THD *thd= ha_thd();
if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL && thd->query() == NULL) if (thd->system_thread == SYSTEM_THREAD_SLAVE_SQL && thd->query() == NULL)
rc= 0; rc= 0;
else else
rc= HA_ERR_END_OF_FILE; rc= HA_ERR_END_OF_FILE;
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -282,9 +269,7 @@ int ha_blackhole::index_next(uchar * buf) ...@@ -282,9 +269,7 @@ int ha_blackhole::index_next(uchar * buf)
{ {
int rc; int rc;
DBUG_ENTER("ha_blackhole::index_next"); DBUG_ENTER("ha_blackhole::index_next");
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
rc= HA_ERR_END_OF_FILE; rc= HA_ERR_END_OF_FILE;
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -293,9 +278,7 @@ int ha_blackhole::index_prev(uchar * buf) ...@@ -293,9 +278,7 @@ int ha_blackhole::index_prev(uchar * buf)
{ {
int rc; int rc;
DBUG_ENTER("ha_blackhole::index_prev"); DBUG_ENTER("ha_blackhole::index_prev");
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
rc= HA_ERR_END_OF_FILE; rc= HA_ERR_END_OF_FILE;
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -304,9 +287,7 @@ int ha_blackhole::index_first(uchar * buf) ...@@ -304,9 +287,7 @@ int ha_blackhole::index_first(uchar * buf)
{ {
int rc; int rc;
DBUG_ENTER("ha_blackhole::index_first"); DBUG_ENTER("ha_blackhole::index_first");
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
rc= HA_ERR_END_OF_FILE; rc= HA_ERR_END_OF_FILE;
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
DBUG_RETURN(HA_ERR_END_OF_FILE); DBUG_RETURN(HA_ERR_END_OF_FILE);
} }
...@@ -316,9 +297,7 @@ int ha_blackhole::index_last(uchar * buf) ...@@ -316,9 +297,7 @@ int ha_blackhole::index_last(uchar * buf)
{ {
int rc; int rc;
DBUG_ENTER("ha_blackhole::index_last"); DBUG_ENTER("ha_blackhole::index_last");
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
rc= HA_ERR_END_OF_FILE; rc= HA_ERR_END_OF_FILE;
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
......
...@@ -91,11 +91,9 @@ ...@@ -91,11 +91,9 @@
#pragma implementation // gcc: Class implementation #pragma implementation // gcc: Class implementation
#endif #endif
#include "sql_priv.h" #include <mysql/plugin.h>
#include "sql_class.h" // MYSQL_HANDLERTON_INTERFACE_VERSION
#include "ha_example.h" #include "ha_example.h"
#include "probes_mysql.h" #include "sql_class.h"
#include "sql_plugin.h"
static handler *example_create_handler(handlerton *hton, static handler *example_create_handler(handlerton *hton,
TABLE_SHARE *table, TABLE_SHARE *table,
...@@ -547,9 +545,7 @@ int ha_example::index_read_map(uchar *buf, const uchar *key, ...@@ -547,9 +545,7 @@ int ha_example::index_read_map(uchar *buf, const uchar *key,
{ {
int rc; int rc;
DBUG_ENTER("ha_example::index_read"); DBUG_ENTER("ha_example::index_read");
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
rc= HA_ERR_WRONG_COMMAND; rc= HA_ERR_WRONG_COMMAND;
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -563,9 +559,7 @@ int ha_example::index_next(uchar *buf) ...@@ -563,9 +559,7 @@ int ha_example::index_next(uchar *buf)
{ {
int rc; int rc;
DBUG_ENTER("ha_example::index_next"); DBUG_ENTER("ha_example::index_next");
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
rc= HA_ERR_WRONG_COMMAND; rc= HA_ERR_WRONG_COMMAND;
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -579,9 +573,7 @@ int ha_example::index_prev(uchar *buf) ...@@ -579,9 +573,7 @@ int ha_example::index_prev(uchar *buf)
{ {
int rc; int rc;
DBUG_ENTER("ha_example::index_prev"); DBUG_ENTER("ha_example::index_prev");
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
rc= HA_ERR_WRONG_COMMAND; rc= HA_ERR_WRONG_COMMAND;
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -600,9 +592,7 @@ int ha_example::index_first(uchar *buf) ...@@ -600,9 +592,7 @@ int ha_example::index_first(uchar *buf)
{ {
int rc; int rc;
DBUG_ENTER("ha_example::index_first"); DBUG_ENTER("ha_example::index_first");
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
rc= HA_ERR_WRONG_COMMAND; rc= HA_ERR_WRONG_COMMAND;
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -621,9 +611,7 @@ int ha_example::index_last(uchar *buf) ...@@ -621,9 +611,7 @@ int ha_example::index_last(uchar *buf)
{ {
int rc; int rc;
DBUG_ENTER("ha_example::index_last"); DBUG_ENTER("ha_example::index_last");
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
rc= HA_ERR_WRONG_COMMAND; rc= HA_ERR_WRONG_COMMAND;
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -672,10 +660,7 @@ int ha_example::rnd_next(uchar *buf) ...@@ -672,10 +660,7 @@ int ha_example::rnd_next(uchar *buf)
{ {
int rc; int rc;
DBUG_ENTER("ha_example::rnd_next"); DBUG_ENTER("ha_example::rnd_next");
MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
TRUE);
rc= HA_ERR_END_OF_FILE; rc= HA_ERR_END_OF_FILE;
MYSQL_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -725,10 +710,7 @@ int ha_example::rnd_pos(uchar *buf, uchar *pos) ...@@ -725,10 +710,7 @@ int ha_example::rnd_pos(uchar *buf, uchar *pos)
{ {
int rc; int rc;
DBUG_ENTER("ha_example::rnd_pos"); DBUG_ENTER("ha_example::rnd_pos");
MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
TRUE);
rc= HA_ERR_WRONG_COMMAND; rc= HA_ERR_WRONG_COMMAND;
MYSQL_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
......
...@@ -383,7 +383,6 @@ ...@@ -383,7 +383,6 @@
#endif #endif
#include "ha_federated.h" #include "ha_federated.h"
#include "probes_mysql.h"
#include "m_string.h" #include "m_string.h"
#include "key.h" // key_copy #include "key.h" // key_copy
...@@ -2355,12 +2354,10 @@ int ha_federated::index_read(uchar *buf, const uchar *key, ...@@ -2355,12 +2354,10 @@ int ha_federated::index_read(uchar *buf, const uchar *key,
int rc; int rc;
DBUG_ENTER("ha_federated::index_read"); DBUG_ENTER("ha_federated::index_read");
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
free_result(); free_result();
rc= index_read_idx_with_result_set(buf, active_index, key, rc= index_read_idx_with_result_set(buf, active_index, key,
key_len, find_flag, key_len, find_flag,
&stored_result); &stored_result);
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -2512,7 +2509,6 @@ int ha_federated::read_range_first(const key_range *start_key, ...@@ -2512,7 +2509,6 @@ int ha_federated::read_range_first(const key_range *start_key,
sizeof(sql_query_buffer), sizeof(sql_query_buffer),
&my_charset_bin); &my_charset_bin);
DBUG_ENTER("ha_federated::read_range_first"); 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)); DBUG_ASSERT(!(start_key == NULL && end_key == NULL));
...@@ -2535,12 +2531,10 @@ int ha_federated::read_range_first(const key_range *start_key, ...@@ -2535,12 +2531,10 @@ int ha_federated::read_range_first(const key_range *start_key,
} }
retval= read_next(table->record[0], stored_result); retval= read_next(table->record[0], stored_result);
MYSQL_INDEX_READ_ROW_DONE(retval);
DBUG_RETURN(retval); DBUG_RETURN(retval);
error: error:
table->status= STATUS_NOT_FOUND; table->status= STATUS_NOT_FOUND;
MYSQL_INDEX_READ_ROW_DONE(retval);
DBUG_RETURN(retval); DBUG_RETURN(retval);
} }
...@@ -2549,9 +2543,7 @@ int ha_federated::read_range_next() ...@@ -2549,9 +2543,7 @@ int ha_federated::read_range_next()
{ {
int retval; int retval;
DBUG_ENTER("ha_federated::read_range_next"); DBUG_ENTER("ha_federated::read_range_next");
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
retval= rnd_next_int(table->record[0]); retval= rnd_next_int(table->record[0]);
MYSQL_INDEX_READ_ROW_DONE(retval);
DBUG_RETURN(retval); DBUG_RETURN(retval);
} }
...@@ -2561,10 +2553,8 @@ int ha_federated::index_next(uchar *buf) ...@@ -2561,10 +2553,8 @@ int ha_federated::index_next(uchar *buf)
{ {
int retval; int retval;
DBUG_ENTER("ha_federated::index_next"); 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); ha_statistic_increment(&SSV::ha_read_next_count);
retval= read_next(buf, stored_result); retval= read_next(buf, stored_result);
MYSQL_INDEX_READ_ROW_DONE(retval);
DBUG_RETURN(retval); DBUG_RETURN(retval);
} }
...@@ -2660,10 +2650,7 @@ int ha_federated::rnd_next(uchar *buf) ...@@ -2660,10 +2650,7 @@ int ha_federated::rnd_next(uchar *buf)
{ {
int rc; int rc;
DBUG_ENTER("ha_federated::rnd_next"); 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); rc= rnd_next_int(buf);
MYSQL_READ_ROW_DONE(rc);
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -2777,8 +2764,6 @@ int ha_federated::rnd_pos(uchar *buf, uchar *pos) ...@@ -2777,8 +2764,6 @@ int ha_federated::rnd_pos(uchar *buf, uchar *pos)
int ret_val; int ret_val;
DBUG_ENTER("ha_federated::rnd_pos"); 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); ha_statistic_increment(&SSV::ha_read_rnd_count);
/* Get stored result set. */ /* Get stored result set. */
...@@ -2789,7 +2774,6 @@ int ha_federated::rnd_pos(uchar *buf, uchar *pos) ...@@ -2789,7 +2774,6 @@ int ha_federated::rnd_pos(uchar *buf, uchar *pos)
sizeof(MYSQL_ROW_OFFSET)); sizeof(MYSQL_ROW_OFFSET));
/* Read a row. */ /* Read a row. */
ret_val= read_next(buf, result); ret_val= read_next(buf, result);
MYSQL_READ_ROW_DONE(ret_val);
DBUG_RETURN(ret_val); DBUG_RETURN(ret_val);
} }
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#define MYSQL_SERVER 1 #define MYSQL_SERVER 1
#include "sql_priv.h" #include "sql_priv.h"
#include "probes_mysql.h"
#include "sql_plugin.h" #include "sql_plugin.h"
#include "ha_heap.h" #include "ha_heap.h"
#include "heapdef.h" #include "heapdef.h"
...@@ -289,25 +288,21 @@ int ha_heap::index_read_map(uchar *buf, const uchar *key, ...@@ -289,25 +288,21 @@ int ha_heap::index_read_map(uchar *buf, const uchar *key,
key_part_map keypart_map, key_part_map keypart_map,
enum ha_rkey_function find_flag) enum ha_rkey_function find_flag)
{ {
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
ha_statistic_increment(&SSV::ha_read_key_count); ha_statistic_increment(&SSV::ha_read_key_count);
int error = heap_rkey(file,buf,active_index, key, keypart_map, find_flag); int error = heap_rkey(file,buf,active_index, key, keypart_map, find_flag);
table->status = error ? STATUS_NOT_FOUND : 0; table->status = error ? STATUS_NOT_FOUND : 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
int ha_heap::index_read_last_map(uchar *buf, const uchar *key, int ha_heap::index_read_last_map(uchar *buf, const uchar *key,
key_part_map keypart_map) key_part_map keypart_map)
{ {
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
ha_statistic_increment(&SSV::ha_read_key_count); ha_statistic_increment(&SSV::ha_read_key_count);
int error= heap_rkey(file, buf, active_index, key, keypart_map, int error= heap_rkey(file, buf, active_index, key, keypart_map,
HA_READ_PREFIX_LAST); HA_READ_PREFIX_LAST);
table->status= error ? STATUS_NOT_FOUND : 0; table->status= error ? STATUS_NOT_FOUND : 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -315,55 +310,45 @@ int ha_heap::index_read_idx_map(uchar *buf, uint index, const uchar *key, ...@@ -315,55 +310,45 @@ int ha_heap::index_read_idx_map(uchar *buf, uint index, const uchar *key,
key_part_map keypart_map, key_part_map keypart_map,
enum ha_rkey_function find_flag) enum ha_rkey_function find_flag)
{ {
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
ha_statistic_increment(&SSV::ha_read_key_count); ha_statistic_increment(&SSV::ha_read_key_count);
int error = heap_rkey(file, buf, index, key, keypart_map, find_flag); int error = heap_rkey(file, buf, index, key, keypart_map, find_flag);
table->status = error ? STATUS_NOT_FOUND : 0; table->status = error ? STATUS_NOT_FOUND : 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
int ha_heap::index_next(uchar * buf) int ha_heap::index_next(uchar * buf)
{ {
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
ha_statistic_increment(&SSV::ha_read_next_count); ha_statistic_increment(&SSV::ha_read_next_count);
int error=heap_rnext(file,buf); int error=heap_rnext(file,buf);
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
int ha_heap::index_prev(uchar * buf) int ha_heap::index_prev(uchar * buf)
{ {
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
ha_statistic_increment(&SSV::ha_read_prev_count); ha_statistic_increment(&SSV::ha_read_prev_count);
int error=heap_rprev(file,buf); int error=heap_rprev(file,buf);
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
int ha_heap::index_first(uchar * buf) int ha_heap::index_first(uchar * buf)
{ {
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
ha_statistic_increment(&SSV::ha_read_first_count); ha_statistic_increment(&SSV::ha_read_first_count);
int error=heap_rfirst(file, buf, active_index); int error=heap_rfirst(file, buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
int ha_heap::index_last(uchar * buf) int ha_heap::index_last(uchar * buf)
{ {
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
ha_statistic_increment(&SSV::ha_read_last_count); ha_statistic_increment(&SSV::ha_read_last_count);
int error=heap_rlast(file, buf, active_index); int error=heap_rlast(file, buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -374,12 +359,9 @@ int ha_heap::rnd_init(bool scan) ...@@ -374,12 +359,9 @@ int ha_heap::rnd_init(bool scan)
int ha_heap::rnd_next(uchar *buf) int ha_heap::rnd_next(uchar *buf)
{ {
MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
TRUE);
ha_statistic_increment(&SSV::ha_read_rnd_next_count); ha_statistic_increment(&SSV::ha_read_rnd_next_count);
int error=heap_scan(file, buf); int error=heap_scan(file, buf);
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -387,13 +369,10 @@ int ha_heap::rnd_pos(uchar * buf, uchar *pos) ...@@ -387,13 +369,10 @@ int ha_heap::rnd_pos(uchar * buf, uchar *pos)
{ {
int error; int error;
HEAP_PTR heap_position; HEAP_PTR heap_position;
MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
FALSE);
ha_statistic_increment(&SSV::ha_read_rnd_count); ha_statistic_increment(&SSV::ha_read_rnd_count);
memcpy(&heap_position, pos, sizeof(HEAP_PTR)); memcpy(&heap_position, pos, sizeof(HEAP_PTR));
error=heap_rrnd(file, buf, heap_position); error=heap_rrnd(file, buf, heap_position);
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_READ_ROW_DONE(error);
return error; return error;
} }
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#define MYSQL_SERVER 1 #define MYSQL_SERVER 1
#include "sql_priv.h" #include "sql_priv.h"
#include "probes_mysql.h"
#include "key.h" // key_copy #include "key.h" // key_copy
#include "sql_plugin.h" #include "sql_plugin.h"
#include <m_ctype.h> #include <m_ctype.h>
...@@ -1625,10 +1624,8 @@ int ha_myisam::index_read_map(uchar *buf, const uchar *key, ...@@ -1625,10 +1624,8 @@ int ha_myisam::index_read_map(uchar *buf, const uchar *key,
key_part_map keypart_map, key_part_map keypart_map,
enum ha_rkey_function find_flag) enum ha_rkey_function find_flag)
{ {
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
int error=mi_rkey(file, buf, active_index, key, keypart_map, find_flag); int error=mi_rkey(file, buf, active_index, key, keypart_map, find_flag);
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -1636,45 +1633,35 @@ int ha_myisam::index_read_idx_map(uchar *buf, uint index, const uchar *key, ...@@ -1636,45 +1633,35 @@ int ha_myisam::index_read_idx_map(uchar *buf, uint index, const uchar *key,
key_part_map keypart_map, key_part_map keypart_map,
enum ha_rkey_function find_flag) enum ha_rkey_function find_flag)
{ {
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
int error=mi_rkey(file, buf, index, key, keypart_map, find_flag); int error=mi_rkey(file, buf, index, key, keypart_map, find_flag);
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
int ha_myisam::index_next(uchar *buf) int ha_myisam::index_next(uchar *buf)
{ {
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
int error=mi_rnext(file,buf,active_index); int error=mi_rnext(file,buf,active_index);
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
int ha_myisam::index_prev(uchar *buf) int ha_myisam::index_prev(uchar *buf)
{ {
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
int error=mi_rprev(file,buf, active_index); int error=mi_rprev(file,buf, active_index);
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
int ha_myisam::index_first(uchar *buf) int ha_myisam::index_first(uchar *buf)
{ {
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
int error=mi_rfirst(file, buf, active_index); int error=mi_rfirst(file, buf, active_index);
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
int ha_myisam::index_last(uchar *buf) int ha_myisam::index_last(uchar *buf)
{ {
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
int error=mi_rlast(file, buf, active_index); int error=mi_rlast(file, buf, active_index);
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -1684,12 +1671,10 @@ int ha_myisam::index_next_same(uchar *buf, ...@@ -1684,12 +1671,10 @@ int ha_myisam::index_next_same(uchar *buf,
{ {
int error; int error;
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
do do
{ {
error= mi_rnext_same(file,buf); error= mi_rnext_same(file,buf);
} while (error == HA_ERR_RECORD_DELETED); } while (error == HA_ERR_RECORD_DELETED);
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -1703,10 +1688,7 @@ int ha_myisam::rnd_init(bool scan) ...@@ -1703,10 +1688,7 @@ int ha_myisam::rnd_init(bool scan)
int ha_myisam::rnd_next(uchar *buf) int ha_myisam::rnd_next(uchar *buf)
{ {
MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
TRUE);
int error=mi_scan(file, buf); int error=mi_scan(file, buf);
MYSQL_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -1723,10 +1705,7 @@ int ha_myisam::restart_rnd_next(uchar *buf) ...@@ -1723,10 +1705,7 @@ int ha_myisam::restart_rnd_next(uchar *buf)
int ha_myisam::rnd_pos(uchar *buf, uchar *pos) int ha_myisam::rnd_pos(uchar *buf, uchar *pos)
{ {
MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
FALSE);
int error=mi_rrnd(file, buf, my_get_ptr(pos,ref_length)); int error=mi_rrnd(file, buf, my_get_ptr(pos,ref_length));
MYSQL_READ_ROW_DONE(error);
return error; return error;
} }
......
...@@ -95,7 +95,6 @@ ...@@ -95,7 +95,6 @@
#include "sql_cache.h" // query_cache_* #include "sql_cache.h" // query_cache_*
#include "sql_show.h" // append_identifier #include "sql_show.h" // append_identifier
#include "sql_table.h" // build_table_filename #include "sql_table.h" // build_table_filename
#include "probes_mysql.h"
#include <mysql/plugin.h> #include <mysql/plugin.h>
#include <m_ctype.h> #include <m_ctype.h>
#include "../myisam/ha_myisam.h" #include "../myisam/ha_myisam.h"
...@@ -1083,11 +1082,9 @@ int ha_myisammrg::index_read_map(uchar * buf, const uchar * key, ...@@ -1083,11 +1082,9 @@ int ha_myisammrg::index_read_map(uchar * buf, const uchar * key,
enum ha_rkey_function find_flag) enum ha_rkey_function find_flag)
{ {
DBUG_ASSERT(this->file->children_attached); DBUG_ASSERT(this->file->children_attached);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
ha_statistic_increment(&SSV::ha_read_key_count); ha_statistic_increment(&SSV::ha_read_key_count);
int error=myrg_rkey(file,buf,active_index, key, keypart_map, find_flag); int error=myrg_rkey(file,buf,active_index, key, keypart_map, find_flag);
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -1096,11 +1093,9 @@ int ha_myisammrg::index_read_idx_map(uchar * buf, uint index, const uchar * key, ...@@ -1096,11 +1093,9 @@ int ha_myisammrg::index_read_idx_map(uchar * buf, uint index, const uchar * key,
enum ha_rkey_function find_flag) enum ha_rkey_function find_flag)
{ {
DBUG_ASSERT(this->file->children_attached); DBUG_ASSERT(this->file->children_attached);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
ha_statistic_increment(&SSV::ha_read_key_count); ha_statistic_increment(&SSV::ha_read_key_count);
int error=myrg_rkey(file,buf,index, key, keypart_map, find_flag); int error=myrg_rkey(file,buf,index, key, keypart_map, find_flag);
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -1108,56 +1103,46 @@ int ha_myisammrg::index_read_last_map(uchar *buf, const uchar *key, ...@@ -1108,56 +1103,46 @@ int ha_myisammrg::index_read_last_map(uchar *buf, const uchar *key,
key_part_map keypart_map) key_part_map keypart_map)
{ {
DBUG_ASSERT(this->file->children_attached); DBUG_ASSERT(this->file->children_attached);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
ha_statistic_increment(&SSV::ha_read_key_count); ha_statistic_increment(&SSV::ha_read_key_count);
int error=myrg_rkey(file,buf,active_index, key, keypart_map, int error=myrg_rkey(file,buf,active_index, key, keypart_map,
HA_READ_PREFIX_LAST); HA_READ_PREFIX_LAST);
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
int ha_myisammrg::index_next(uchar * buf) int ha_myisammrg::index_next(uchar * buf)
{ {
DBUG_ASSERT(this->file->children_attached); DBUG_ASSERT(this->file->children_attached);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
ha_statistic_increment(&SSV::ha_read_next_count); ha_statistic_increment(&SSV::ha_read_next_count);
int error=myrg_rnext(file,buf,active_index); int error=myrg_rnext(file,buf,active_index);
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
int ha_myisammrg::index_prev(uchar * buf) int ha_myisammrg::index_prev(uchar * buf)
{ {
DBUG_ASSERT(this->file->children_attached); DBUG_ASSERT(this->file->children_attached);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
ha_statistic_increment(&SSV::ha_read_prev_count); ha_statistic_increment(&SSV::ha_read_prev_count);
int error=myrg_rprev(file,buf, active_index); int error=myrg_rprev(file,buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
int ha_myisammrg::index_first(uchar * buf) int ha_myisammrg::index_first(uchar * buf)
{ {
DBUG_ASSERT(this->file->children_attached); DBUG_ASSERT(this->file->children_attached);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
ha_statistic_increment(&SSV::ha_read_first_count); ha_statistic_increment(&SSV::ha_read_first_count);
int error=myrg_rfirst(file, buf, active_index); int error=myrg_rfirst(file, buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
int ha_myisammrg::index_last(uchar * buf) int ha_myisammrg::index_last(uchar * buf)
{ {
DBUG_ASSERT(this->file->children_attached); DBUG_ASSERT(this->file->children_attached);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
ha_statistic_increment(&SSV::ha_read_last_count); ha_statistic_increment(&SSV::ha_read_last_count);
int error=myrg_rlast(file, buf, active_index); int error=myrg_rlast(file, buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -1167,14 +1152,12 @@ int ha_myisammrg::index_next_same(uchar * buf, ...@@ -1167,14 +1152,12 @@ int ha_myisammrg::index_next_same(uchar * buf,
{ {
int error; int error;
DBUG_ASSERT(this->file->children_attached); DBUG_ASSERT(this->file->children_attached);
MYSQL_INDEX_READ_ROW_START(table_share->db.str, table_share->table_name.str);
ha_statistic_increment(&SSV::ha_read_next_count); ha_statistic_increment(&SSV::ha_read_next_count);
do do
{ {
error= myrg_rnext_same(file,buf); error= myrg_rnext_same(file,buf);
} while (error == HA_ERR_RECORD_DELETED); } while (error == HA_ERR_RECORD_DELETED);
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_INDEX_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -1189,12 +1172,9 @@ int ha_myisammrg::rnd_init(bool scan) ...@@ -1189,12 +1172,9 @@ int ha_myisammrg::rnd_init(bool scan)
int ha_myisammrg::rnd_next(uchar *buf) int ha_myisammrg::rnd_next(uchar *buf)
{ {
DBUG_ASSERT(this->file->children_attached); DBUG_ASSERT(this->file->children_attached);
MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
TRUE);
ha_statistic_increment(&SSV::ha_read_rnd_next_count); ha_statistic_increment(&SSV::ha_read_rnd_next_count);
int error=myrg_rrnd(file, buf, HA_OFFSET_ERROR); int error=myrg_rrnd(file, buf, HA_OFFSET_ERROR);
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_READ_ROW_DONE(error);
return error; return error;
} }
...@@ -1202,12 +1182,9 @@ int ha_myisammrg::rnd_next(uchar *buf) ...@@ -1202,12 +1182,9 @@ int ha_myisammrg::rnd_next(uchar *buf)
int ha_myisammrg::rnd_pos(uchar * buf, uchar *pos) int ha_myisammrg::rnd_pos(uchar * buf, uchar *pos)
{ {
DBUG_ASSERT(this->file->children_attached); DBUG_ASSERT(this->file->children_attached);
MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str,
TRUE);
ha_statistic_increment(&SSV::ha_read_rnd_count); ha_statistic_increment(&SSV::ha_read_rnd_count);
int error=myrg_rrnd(file, buf, my_get_ptr(pos,ref_length)); int error=myrg_rrnd(file, buf, my_get_ptr(pos,ref_length));
table->status=error ? STATUS_NOT_FOUND: 0; table->status=error ? STATUS_NOT_FOUND: 0;
MYSQL_READ_ROW_DONE(error);
return error; return error;
} }
......
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