Commit 1135f5a4 authored by marko's avatar marko

class ha_innobase: Replace statistic_increment() with ha_statistic_increment().

ha_innobase::change_active_index(): Do not call current_thd unless
UNIV_DEBUG is defined.
parent 44d9bf67
...@@ -3368,8 +3368,7 @@ ha_innobase::write_row( ...@@ -3368,8 +3368,7 @@ ha_innobase::write_row(
ut_error; ut_error;
} }
statistic_increment(thd->status_var.ha_write_count, ha_statistic_increment(&SSV::ha_write_count);
&LOCK_status);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
table->timestamp_field->set_time(); table->timestamp_field->set_time();
...@@ -4056,8 +4055,7 @@ ha_innobase::index_read( ...@@ -4056,8 +4055,7 @@ ha_innobase::index_read(
ut_a(prebuilt->trx == thd_to_trx(current_thd, ht)); ut_a(prebuilt->trx == thd_to_trx(current_thd, ht));
statistic_increment(current_thd->status_var.ha_read_key_count, ha_statistic_increment(&SSV::ha_read_key_count);
&LOCK_status);
if (last_query_id != user_thd->query_id) { if (last_query_id != user_thd->query_id) {
prebuilt->sql_stat_start = TRUE; prebuilt->sql_stat_start = TRUE;
...@@ -4162,12 +4160,11 @@ ha_innobase::change_active_index( ...@@ -4162,12 +4160,11 @@ ha_innobase::change_active_index(
InnoDB */ InnoDB */
{ {
KEY* key=0; KEY* key=0;
THD* thd = current_thd; ha_statistic_increment(&SSV::ha_read_key_count);
statistic_increment(thd->status_var.ha_read_key_count, &LOCK_status);
DBUG_ENTER("change_active_index"); DBUG_ENTER("change_active_index");
ut_ad(user_thd == thd); ut_ad(user_thd == current_thd);
ut_a(prebuilt->trx == thd_to_trx(thd, ht)); ut_a(prebuilt->trx == thd_to_trx(user_thd, ht));
active_index = keynr; active_index = keynr;
...@@ -4294,8 +4291,7 @@ ha_innobase::index_next( ...@@ -4294,8 +4291,7 @@ ha_innobase::index_next(
mysql_byte* buf) /* in/out: buffer for next row in MySQL mysql_byte* buf) /* in/out: buffer for next row in MySQL
format */ format */
{ {
statistic_increment(current_thd->status_var.ha_read_next_count, ha_statistic_increment(&SSV::ha_read_next_count);
&LOCK_status);
return(general_fetch(buf, ROW_SEL_NEXT, 0)); return(general_fetch(buf, ROW_SEL_NEXT, 0));
} }
...@@ -4312,8 +4308,7 @@ ha_innobase::index_next_same( ...@@ -4312,8 +4308,7 @@ ha_innobase::index_next_same(
const mysql_byte* key, /* in: key value */ const mysql_byte* key, /* in: key value */
uint keylen) /* in: key value length */ uint keylen) /* in: key value length */
{ {
statistic_increment(current_thd->status_var.ha_read_next_count, ha_statistic_increment(&SSV::ha_read_next_count);
&LOCK_status);
return(general_fetch(buf, ROW_SEL_NEXT, last_match_mode)); return(general_fetch(buf, ROW_SEL_NEXT, last_match_mode));
} }
...@@ -4330,8 +4325,7 @@ ha_innobase::index_prev( ...@@ -4330,8 +4325,7 @@ ha_innobase::index_prev(
mysql_byte* buf) /* in/out: buffer for previous row in MySQL mysql_byte* buf) /* in/out: buffer for previous row in MySQL
format */ format */
{ {
statistic_increment(current_thd->status_var.ha_read_prev_count, ha_statistic_increment(&SSV::ha_read_prev_count);
&LOCK_status);
return(general_fetch(buf, ROW_SEL_PREV, 0)); return(general_fetch(buf, ROW_SEL_PREV, 0));
} }
...@@ -4350,8 +4344,7 @@ ha_innobase::index_first( ...@@ -4350,8 +4344,7 @@ ha_innobase::index_first(
int error; int error;
DBUG_ENTER("index_first"); DBUG_ENTER("index_first");
statistic_increment(current_thd->status_var.ha_read_first_count, ha_statistic_increment(&SSV::ha_read_first_count);
&LOCK_status);
error = index_read(buf, NULL, 0, HA_READ_AFTER_KEY); error = index_read(buf, NULL, 0, HA_READ_AFTER_KEY);
...@@ -4377,8 +4370,7 @@ ha_innobase::index_last( ...@@ -4377,8 +4370,7 @@ ha_innobase::index_last(
int error; int error;
DBUG_ENTER("index_last"); DBUG_ENTER("index_last");
statistic_increment(current_thd->status_var.ha_read_last_count, ha_statistic_increment(&SSV::ha_read_last_count);
&LOCK_status);
error = index_read(buf, NULL, 0, HA_READ_BEFORE_KEY); error = index_read(buf, NULL, 0, HA_READ_BEFORE_KEY);
...@@ -4448,8 +4440,7 @@ ha_innobase::rnd_next( ...@@ -4448,8 +4440,7 @@ ha_innobase::rnd_next(
int error; int error;
DBUG_ENTER("rnd_next"); DBUG_ENTER("rnd_next");
statistic_increment(current_thd->status_var.ha_read_rnd_next_count, ha_statistic_increment(&SSV::ha_read_rnd_next_count);
&LOCK_status);
if (start_of_scan) { if (start_of_scan) {
error = index_first(buf); error = index_first(buf);
...@@ -4484,8 +4475,7 @@ ha_innobase::rnd_pos( ...@@ -4484,8 +4475,7 @@ ha_innobase::rnd_pos(
DBUG_ENTER("rnd_pos"); DBUG_ENTER("rnd_pos");
DBUG_DUMP("key", (char*) pos, ref_length); DBUG_DUMP("key", (char*) pos, ref_length);
statistic_increment(current_thd->status_var.ha_read_rnd_count, ha_statistic_increment(&SSV::ha_read_rnd_count);
&LOCK_status);
ut_a(prebuilt->trx == thd_to_trx(current_thd, ht)); ut_a(prebuilt->trx == thd_to_trx(current_thd, ht));
......
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