diff options
author | Michael Widenius <monty@askmonty.org> | 2012-08-07 07:25:15 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2012-08-07 07:25:15 +0300 |
commit | b39e6e3d093b45f792959ef06fea1c175263ae1a (patch) | |
tree | b642aba6ff438e50d67a884f4cb5d9c6c3287644 /storage | |
parent | 0a70eb33d159036c5d3f6929df57c2f18bda8471 (diff) | |
download | mariadb-git-b39e6e3d093b45f792959ef06fea1c175263ae1a.tar.gz |
Added support of thd->tx_read_only
Moved timestamp handling from all handler::write() methods in the storage engines to handler::ha_write
sql/handler.cc:
Added PSI_CALL's
Diffstat (limited to 'storage')
-rw-r--r-- | storage/archive/ha_archive.cc | 5 | ||||
-rw-r--r-- | storage/csv/ha_tina.cc | 14 | ||||
-rw-r--r-- | storage/example/ha_example.cc | 2 | ||||
-rw-r--r-- | storage/federated/ha_federated.cc | 7 | ||||
-rw-r--r-- | storage/federatedx/ha_federatedx.cc | 2 | ||||
-rw-r--r-- | storage/heap/ha_heap.cc | 4 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 19 | ||||
-rw-r--r-- | storage/maria/ha_maria.cc | 6 | ||||
-rw-r--r-- | storage/myisam/ha_myisam.cc | 6 | ||||
-rw-r--r-- | storage/myisammrg/ha_myisammrg.cc | 17 | ||||
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 19 |
11 files changed, 0 insertions, 101 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 6b29c6d9d53..430f0373919 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -889,9 +889,6 @@ int ha_archive::write_row(uchar *buf) if (share->crashed) DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); - ha_statistic_increment(&SSV::ha_write_count); - if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) - table->timestamp_field->set_time(); mysql_mutex_lock(&share->mutex); if (!share->archive_write_open) @@ -1315,7 +1312,6 @@ int ha_archive::rnd_next(uchar *buf) } scan_rows--; - ha_statistic_increment(&SSV::ha_read_rnd_next_count); current_position= aztell(&archive); rc= get_row(&archive, buf); @@ -1351,7 +1347,6 @@ int ha_archive::rnd_pos(uchar * buf, uchar *pos) { int rc; DBUG_ENTER("ha_archive::rnd_pos"); - 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)) { diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index d31e5ee8d89..1d3bb76e913 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -997,11 +997,6 @@ int ha_tina::write_row(uchar * buf) if (share->crashed) DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); - ha_statistic_increment(&SSV::ha_write_count); - - if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) - table->timestamp_field->set_time(); - size= encode_quote(buf); if (!share->tina_write_opened) @@ -1062,11 +1057,6 @@ int ha_tina::update_row(const uchar * old_data, uchar * new_data) int rc= -1; DBUG_ENTER("ha_tina::update_row"); - ha_statistic_increment(&SSV::ha_update_count); - - if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) - table->timestamp_field->set_time(); - size= encode_quote(new_data); /* @@ -1109,7 +1099,6 @@ err: int ha_tina::delete_row(const uchar * buf) { DBUG_ENTER("ha_tina::delete_row"); - ha_statistic_increment(&SSV::ha_delete_count); if (chain_append()) DBUG_RETURN(-1); @@ -1231,8 +1220,6 @@ int ha_tina::rnd_next(uchar *buf) goto end; } - ha_statistic_increment(&SSV::ha_read_rnd_next_count); - current_position= next_position; /* don't scan an empty file */ @@ -1281,7 +1268,6 @@ int ha_tina::rnd_pos(uchar * buf, uchar *pos) DBUG_ENTER("ha_tina::rnd_pos"); MYSQL_READ_ROW_START(table_share->db.str, table_share->table_name.str, FALSE); - ha_statistic_increment(&SSV::ha_read_rnd_count); current_position= my_get_ptr(pos,ref_length); rc= find_current_row(buf); MYSQL_READ_ROW_DONE(rc); diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index 2c65fd657a9..91ead36fcea 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -495,8 +495,6 @@ int ha_example::write_row(uchar *buf) Currently new_data will not have an updated auto_increament record, or and updated timestamp field. You can do these for example by doing: @code - if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) - table->timestamp_field->set_time(); if (table->next_number_field && record == table->record[0]) update_auto_increment(); @endcode diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index 549001ab08b..fcd8370f969 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -1848,9 +1848,6 @@ int ha_federated::write_row(uchar *buf) values_string.length(0); insert_field_value_string.length(0); - ha_statistic_increment(&SSV::ha_write_count); - if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) - table->timestamp_field->set_time(); /* start both our field and field values strings @@ -2434,7 +2431,6 @@ int ha_federated::index_read_idx_with_result_set(uchar *buf, uint index, *result= 0; // In case of errors index_string.length(0); sql_query.length(0); - ha_statistic_increment(&SSV::ha_read_key_count); sql_query.append(share->select_query); @@ -2562,7 +2558,6 @@ int ha_federated::index_next(uchar *buf) { int retval; DBUG_ENTER("ha_federated::index_next"); - ha_statistic_increment(&SSV::ha_read_next_count); retval= read_next(buf, stored_result); DBUG_RETURN(retval); } @@ -2772,8 +2767,6 @@ int ha_federated::rnd_pos(uchar *buf, uchar *pos) int ret_val; DBUG_ENTER("ha_federated::rnd_pos"); - ha_statistic_increment(&SSV::ha_read_rnd_count); - /* Get stored result set. */ memcpy(&result, pos, sizeof(MYSQL_RES *)); DBUG_ASSERT(result); diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index a10285a81aa..7f095a9b96e 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -1993,8 +1993,6 @@ int ha_federatedx::write_row(uchar *buf) values_string.length(0); insert_field_value_string.length(0); - if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) - table->timestamp_field->set_time(); /* start both our field and field values strings diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index 305a8cae720..b9eef0d155b 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -241,8 +241,6 @@ void ha_heap::update_key_stats() int ha_heap::write_row(uchar * buf) { int res; - if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) - table->timestamp_field->set_time(); if (table->next_number_field && buf == table->record[0]) { if ((res= update_auto_increment())) @@ -264,8 +262,6 @@ int ha_heap::write_row(uchar * buf) int ha_heap::update_row(const uchar * old_data, uchar * new_data) { int res; - if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) - table->timestamp_field->set_time(); res= heap_update(file,old_data,new_data); if (!res && ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 65b42ed4d3b..9d8658e861c 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -6107,8 +6107,6 @@ ha_innobase::write_row( ++trx->will_lock; } - ha_statistic_increment(&SSV::ha_write_count); - sql_command = thd_sql_command(user_thd); if ((sql_command == SQLCOM_ALTER_TABLE @@ -6648,8 +6646,6 @@ ha_innobase::update_row( } } - ha_statistic_increment(&SSV::ha_update_count); - if (prebuilt->upd_node) { uvect = prebuilt->upd_node->update; } else { @@ -6760,8 +6756,6 @@ ha_innobase::delete_row( ++trx->will_lock; } - ha_statistic_increment(&SSV::ha_delete_count); - if (!prebuilt->upd_node) { row_get_prebuilt_update_vector(prebuilt); } @@ -7023,8 +7017,6 @@ ha_innobase::index_read( ut_a(prebuilt->trx == thd_to_trx(user_thd)); - ha_statistic_increment(&SSV::ha_read_key_count); - index = prebuilt->index; if (UNIV_UNLIKELY(index == NULL) || dict_index_is_corrupted(index)) { @@ -7367,8 +7359,6 @@ ha_innobase::index_next( uchar* buf) /*!< in/out: buffer for next row in MySQL format */ { - ha_statistic_increment(&SSV::ha_read_next_count); - return(general_fetch(buf, ROW_SEL_NEXT, 0)); } @@ -7383,8 +7373,6 @@ ha_innobase::index_next_same( const uchar* key, /*!< in: key value */ uint keylen) /*!< in: key value length */ { - ha_statistic_increment(&SSV::ha_read_next_count); - return(general_fetch(buf, ROW_SEL_NEXT, last_match_mode)); } @@ -7398,8 +7386,6 @@ ha_innobase::index_prev( /*====================*/ uchar* buf) /*!< in/out: buffer for previous row in MySQL format */ { - ha_statistic_increment(&SSV::ha_read_prev_count); - return(general_fetch(buf, ROW_SEL_PREV, 0)); } @@ -7416,7 +7402,6 @@ ha_innobase::index_first( int error; DBUG_ENTER("index_first"); - ha_statistic_increment(&SSV::ha_read_first_count); error = index_read(buf, NULL, 0, HA_READ_AFTER_KEY); @@ -7442,7 +7427,6 @@ ha_innobase::index_last( int error; DBUG_ENTER("index_last"); - ha_statistic_increment(&SSV::ha_read_last_count); error = index_read(buf, NULL, 0, HA_READ_BEFORE_KEY); @@ -7512,7 +7496,6 @@ ha_innobase::rnd_next( int error; DBUG_ENTER("rnd_next"); - ha_statistic_increment(&SSV::ha_read_rnd_next_count); if (start_of_scan) { error = index_first(buf); @@ -7546,8 +7529,6 @@ ha_innobase::rnd_pos( DBUG_ENTER("rnd_pos"); DBUG_DUMP("key", pos, ref_length); - ha_statistic_increment(&SSV::ha_read_rnd_count); - ut_a(prebuilt->trx == thd_to_trx(ha_thd())); /* Note that we assume the length of the row reference is fixed diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 1f0c7644035..876a8bf47ce 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -1226,10 +1226,6 @@ int ha_maria::close(void) int ha_maria::write_row(uchar * buf) { - /* If we have a timestamp column, update it to the current time */ - if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) - table->timestamp_field->set_time(); - /* If we have an auto_increment column and we are writing a changed row or a new row, then update the auto_increment value in the record. @@ -2223,8 +2219,6 @@ bool ha_maria::is_crashed() const int ha_maria::update_row(const uchar * old_data, uchar * new_data) { CHECK_UNTIL_WE_FULLY_IMPLEMENTED_VERSIONING("UPDATE in WRITE CONCURRENT"); - if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) - table->timestamp_field->set_time(); return maria_update(file, old_data, new_data); } diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index bf341d29d0b..4ddaf520f7b 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -810,10 +810,6 @@ int ha_myisam::close(void) int ha_myisam::write_row(uchar *buf) { - /* If we have a timestamp column, update it to the current time */ - if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) - table->timestamp_field->set_time(); - /* If we have an auto_increment column and we are writing a changed row or a new row, then update the auto_increment value in the record. @@ -1634,8 +1630,6 @@ bool ha_myisam::is_crashed() const int ha_myisam::update_row(const uchar *old_data, uchar *new_data) { - if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) - table->timestamp_field->set_time(); return mi_update(file,old_data,new_data); } diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index e6bece5b7ff..1fbdfe12d3d 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -1073,13 +1073,10 @@ int ha_myisammrg::write_row(uchar * buf) { DBUG_ENTER("ha_myisammrg::write_row"); DBUG_ASSERT(this->file->children_attached); - ha_statistic_increment(&SSV::ha_write_count); if (file->merge_insert_method == MERGE_INSERT_DISABLED || !file->tables) DBUG_RETURN(HA_ERR_TABLE_READONLY); - if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) - table->timestamp_field->set_time(); if (table->next_number_field && buf == table->record[0]) { int error; @@ -1092,16 +1089,12 @@ int ha_myisammrg::write_row(uchar * buf) int ha_myisammrg::update_row(const uchar * old_data, uchar * new_data) { DBUG_ASSERT(this->file->children_attached); - ha_statistic_increment(&SSV::ha_update_count); - if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) - table->timestamp_field->set_time(); return myrg_update(file,old_data,new_data); } int ha_myisammrg::delete_row(const uchar * buf) { DBUG_ASSERT(this->file->children_attached); - ha_statistic_increment(&SSV::ha_delete_count); return myrg_delete(file,buf); } @@ -1110,7 +1103,6 @@ int ha_myisammrg::index_read_map(uchar * buf, const uchar * key, enum ha_rkey_function find_flag) { DBUG_ASSERT(this->file->children_attached); - ha_statistic_increment(&SSV::ha_read_key_count); int error=myrg_rkey(file,buf,active_index, key, keypart_map, find_flag); table->status=error ? STATUS_NOT_FOUND: 0; return error; @@ -1121,7 +1113,6 @@ int ha_myisammrg::index_read_idx_map(uchar * buf, uint index, const uchar * key, enum ha_rkey_function find_flag) { DBUG_ASSERT(this->file->children_attached); - ha_statistic_increment(&SSV::ha_read_key_count); int error=myrg_rkey(file,buf,index, key, keypart_map, find_flag); table->status=error ? STATUS_NOT_FOUND: 0; return error; @@ -1131,7 +1122,6 @@ int ha_myisammrg::index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map) { DBUG_ASSERT(this->file->children_attached); - ha_statistic_increment(&SSV::ha_read_key_count); int error=myrg_rkey(file,buf,active_index, key, keypart_map, HA_READ_PREFIX_LAST); table->status=error ? STATUS_NOT_FOUND: 0; @@ -1141,7 +1131,6 @@ int ha_myisammrg::index_read_last_map(uchar *buf, const uchar *key, int ha_myisammrg::index_next(uchar * buf) { DBUG_ASSERT(this->file->children_attached); - ha_statistic_increment(&SSV::ha_read_next_count); int error=myrg_rnext(file,buf,active_index); table->status=error ? STATUS_NOT_FOUND: 0; return error; @@ -1150,7 +1139,6 @@ int ha_myisammrg::index_next(uchar * buf) int ha_myisammrg::index_prev(uchar * buf) { DBUG_ASSERT(this->file->children_attached); - ha_statistic_increment(&SSV::ha_read_prev_count); int error=myrg_rprev(file,buf, active_index); table->status=error ? STATUS_NOT_FOUND: 0; return error; @@ -1159,7 +1147,6 @@ int ha_myisammrg::index_prev(uchar * buf) int ha_myisammrg::index_first(uchar * buf) { DBUG_ASSERT(this->file->children_attached); - ha_statistic_increment(&SSV::ha_read_first_count); int error=myrg_rfirst(file, buf, active_index); table->status=error ? STATUS_NOT_FOUND: 0; return error; @@ -1168,7 +1155,6 @@ int ha_myisammrg::index_first(uchar * buf) int ha_myisammrg::index_last(uchar * buf) { DBUG_ASSERT(this->file->children_attached); - ha_statistic_increment(&SSV::ha_read_last_count); int error=myrg_rlast(file, buf, active_index); table->status=error ? STATUS_NOT_FOUND: 0; return error; @@ -1180,7 +1166,6 @@ int ha_myisammrg::index_next_same(uchar * buf, { int error; DBUG_ASSERT(this->file->children_attached); - ha_statistic_increment(&SSV::ha_read_next_count); do { error= myrg_rnext_same(file,buf); @@ -1200,7 +1185,6 @@ int ha_myisammrg::rnd_init(bool scan) int ha_myisammrg::rnd_next(uchar *buf) { DBUG_ASSERT(this->file->children_attached); - ha_statistic_increment(&SSV::ha_read_rnd_next_count); int error=myrg_rrnd(file, buf, HA_OFFSET_ERROR); table->status=error ? STATUS_NOT_FOUND: 0; return error; @@ -1210,7 +1194,6 @@ int ha_myisammrg::rnd_next(uchar *buf) int ha_myisammrg::rnd_pos(uchar * buf, uchar *pos) { DBUG_ASSERT(this->file->children_attached); - ha_statistic_increment(&SSV::ha_read_rnd_count); int error=myrg_rrnd(file, buf, my_get_ptr(pos,ref_length)); table->status=error ? STATUS_NOT_FOUND: 0; return error; diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 0a33fcdad8f..cd11e46358b 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -5856,8 +5856,6 @@ ha_innobase::write_row( ut_error; } - ha_statistic_increment(&SSV::ha_write_count); - if (share->ib_table->is_corrupt) { DBUG_RETURN(HA_ERR_CRASHED); } @@ -6279,8 +6277,6 @@ ha_innobase::update_row( } } - ha_statistic_increment(&SSV::ha_update_count); - if (share->ib_table->is_corrupt) { DBUG_RETURN(HA_ERR_CRASHED); } @@ -6395,8 +6391,6 @@ ha_innobase::delete_row( ut_a(prebuilt->trx == trx); - ha_statistic_increment(&SSV::ha_delete_count); - if (share->ib_table->is_corrupt) { DBUG_RETURN(HA_ERR_CRASHED); } @@ -6671,8 +6665,6 @@ ha_innobase::index_read( ut_a(prebuilt->trx == thd_to_trx(user_thd)); ut_ad(key_len != 0 || find_flag != HA_READ_KEY_EXACT); - ha_statistic_increment(&SSV::ha_read_key_count); - if (srv_pass_corrupt_table <= 1 && share->ib_table->is_corrupt) { DBUG_RETURN(HA_ERR_CRASHED); } @@ -7036,8 +7028,6 @@ ha_innobase::index_next( uchar* buf) /*!< in/out: buffer for next row in MySQL format */ { - ha_statistic_increment(&SSV::ha_read_next_count); - return(general_fetch(buf, ROW_SEL_NEXT, 0)); } @@ -7052,8 +7042,6 @@ ha_innobase::index_next_same( const uchar* key, /*!< in: key value */ uint keylen) /*!< in: key value length */ { - ha_statistic_increment(&SSV::ha_read_next_count); - return(general_fetch(buf, ROW_SEL_NEXT, last_match_mode)); } @@ -7067,8 +7055,6 @@ ha_innobase::index_prev( /*====================*/ uchar* buf) /*!< in/out: buffer for previous row in MySQL format */ { - ha_statistic_increment(&SSV::ha_read_prev_count); - return(general_fetch(buf, ROW_SEL_PREV, 0)); } @@ -7085,7 +7071,6 @@ ha_innobase::index_first( int error; DBUG_ENTER("index_first"); - ha_statistic_increment(&SSV::ha_read_first_count); error = index_read(buf, NULL, 0, HA_READ_AFTER_KEY); @@ -7111,7 +7096,6 @@ ha_innobase::index_last( int error; DBUG_ENTER("index_last"); - ha_statistic_increment(&SSV::ha_read_last_count); error = index_read(buf, NULL, 0, HA_READ_BEFORE_KEY); @@ -7181,7 +7165,6 @@ ha_innobase::rnd_next( int error; DBUG_ENTER("rnd_next"); - ha_statistic_increment(&SSV::ha_read_rnd_next_count); if (start_of_scan) { error = index_first(buf); @@ -7216,8 +7199,6 @@ ha_innobase::rnd_pos( DBUG_ENTER("rnd_pos"); DBUG_DUMP("key", pos, ref_length); - ha_statistic_increment(&SSV::ha_read_rnd_count); - ut_a(prebuilt->trx == thd_to_trx(ha_thd())); if (prebuilt->clust_index_was_generated) { |