diff options
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index d12f94c6967..a2ca0c8047d 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2628,7 +2628,7 @@ int ha_ndbcluster::write_row(byte *record) DBUG_RETURN(peek_res); } - statistic_increment(thd->status_var.ha_write_count, &LOCK_status); + ha_statistic_increment(&SSV::ha_write_count); if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) table->timestamp_field->set_time(); @@ -2853,7 +2853,7 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) DBUG_RETURN(peek_res); } - statistic_increment(thd->status_var.ha_update_count, &LOCK_status); + ha_statistic_increment(&SSV::ha_update_count); if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) { table->timestamp_field->set_time(); @@ -3029,7 +3029,7 @@ int ha_ndbcluster::delete_row(const byte *record) DBUG_ENTER("delete_row"); m_write_op= TRUE; - statistic_increment(thd->status_var.ha_delete_count,&LOCK_status); + ha_statistic_increment(&SSV::ha_delete_count); m_rows_changed++; if (m_use_partition_function && @@ -3412,8 +3412,7 @@ int ha_ndbcluster::index_read(byte *buf, int ha_ndbcluster::index_next(byte *buf) { DBUG_ENTER("ha_ndbcluster::index_next"); - statistic_increment(current_thd->status_var.ha_read_next_count, - &LOCK_status); + ha_statistic_increment(&SSV::ha_read_next_count); DBUG_RETURN(next_result(buf)); } @@ -3421,8 +3420,7 @@ int ha_ndbcluster::index_next(byte *buf) int ha_ndbcluster::index_prev(byte *buf) { DBUG_ENTER("ha_ndbcluster::index_prev"); - statistic_increment(current_thd->status_var.ha_read_prev_count, - &LOCK_status); + ha_statistic_increment(&SSV::ha_read_prev_count); DBUG_RETURN(next_result(buf)); } @@ -3430,8 +3428,7 @@ int ha_ndbcluster::index_prev(byte *buf) int ha_ndbcluster::index_first(byte *buf) { DBUG_ENTER("ha_ndbcluster::index_first"); - statistic_increment(current_thd->status_var.ha_read_first_count, - &LOCK_status); + ha_statistic_increment(&SSV::ha_read_first_count); // Start the ordered index scan and fetch the first row // Only HA_READ_ORDER indexes get called by index_first @@ -3442,7 +3439,7 @@ int ha_ndbcluster::index_first(byte *buf) int ha_ndbcluster::index_last(byte *buf) { DBUG_ENTER("ha_ndbcluster::index_last"); - statistic_increment(current_thd->status_var.ha_read_last_count,&LOCK_status); + ha_statistic_increment(&SSV::ha_read_last_count); DBUG_RETURN(ordered_index_scan(0, 0, TRUE, TRUE, buf, NULL)); } @@ -3628,8 +3625,7 @@ int ha_ndbcluster::rnd_end() int ha_ndbcluster::rnd_next(byte *buf) { DBUG_ENTER("rnd_next"); - statistic_increment(current_thd->status_var.ha_read_rnd_next_count, - &LOCK_status); + ha_statistic_increment(&SSV::ha_read_rnd_next_count); if (!m_active_cursor) DBUG_RETURN(full_table_scan(buf)); @@ -3647,8 +3643,7 @@ int ha_ndbcluster::rnd_next(byte *buf) int ha_ndbcluster::rnd_pos(byte *buf, byte *pos) { DBUG_ENTER("rnd_pos"); - statistic_increment(current_thd->status_var.ha_read_rnd_count, - &LOCK_status); + ha_statistic_increment(&SSV::ha_read_rnd_count); // The primary key for the record is stored in pos // Perform a pk_read using primary key "index" { @@ -6876,7 +6871,7 @@ static int ndbcluster_init(void *p) { handlerton *h= ndbcluster_hton; - h->state= have_ndbcluster; + h->state= SHOW_OPTION_YES; h->db_type= DB_TYPE_NDBCLUSTER; h->close_connection= ndbcluster_close_connection; h->commit= ndbcluster_commit; @@ -6898,9 +6893,6 @@ static int ndbcluster_init(void *p) h->table_exists_in_engine= ndbcluster_table_exists_in_engine; } - if (have_ndbcluster != SHOW_OPTION_YES) - DBUG_RETURN(0); // nothing else to do - // Initialize ndb interface ndb_init_internal(); @@ -7016,7 +7008,6 @@ ndbcluster_init_error: if (g_ndb_cluster_connection) delete g_ndb_cluster_connection; g_ndb_cluster_connection= NULL; - have_ndbcluster= SHOW_OPTION_DISABLED; // If we couldn't use handler ndbcluster_hton->state= SHOW_OPTION_DISABLED; // If we couldn't use handler DBUG_RETURN(TRUE); @@ -10380,10 +10371,6 @@ ndbcluster_show_status(handlerton *hton, THD* thd, stat_print_fn *stat_print, uint buflen; DBUG_ENTER("ndbcluster_show_status"); - if (have_ndbcluster != SHOW_OPTION_YES) - { - DBUG_RETURN(FALSE); - } if (stat_type != HA_ENGINE_STATUS) { DBUG_RETURN(FALSE); |