diff options
author | unknown <pappa@c-5c0be253.1238-1-64736c10.cust.bredbandsbolaget.se> | 2006-01-27 12:44:33 -0500 |
---|---|---|
committer | unknown <pappa@c-5c0be253.1238-1-64736c10.cust.bredbandsbolaget.se> | 2006-01-27 12:44:33 -0500 |
commit | 95d91ff2d8d523442c4d007b8bdfe7dc277e7399 (patch) | |
tree | 4b6e4665837d9c08f369728dc1309ab140fe8b5b /sql/ha_heap.cc | |
parent | aa3f756b9d7025312ade65fc8b631370b066751e (diff) | |
download | mariadb-git-95d91ff2d8d523442c4d007b8bdfe7dc277e7399.tar.gz |
Added comments to specify why no much mutex is needed.
Diffstat (limited to 'sql/ha_heap.cc')
-rw-r--r-- | sql/ha_heap.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 61e5ce89693..ab0ab5d8b64 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -142,7 +142,13 @@ int ha_heap::write_row(byte * buf) res= heap_write(file,buf); if (!res && ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records) + { + /* + We can perform this safely since only one writer at the time is + allowed on the table. + */ file->s->key_stat_version++; + } return res; } @@ -155,7 +161,13 @@ int ha_heap::update_row(const byte * old_data, byte * new_data) res= heap_update(file,old_data,new_data); if (!res && ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records) + { + /* + We can perform this safely since only one writer at the time is + allowed on the table. + */ file->s->key_stat_version++; + } return res; } @@ -166,7 +178,13 @@ int ha_heap::delete_row(const byte * buf) res= heap_delete(file,buf); if (!res && table->tmp_table == NO_TMP_TABLE && ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records) + { + /* + We can perform this safely since only one writer at the time is + allowed on the table. + */ file->s->key_stat_version++; + } return res; } @@ -297,7 +315,13 @@ int ha_heap::delete_all_rows() { heap_clear(file); if (table->tmp_table == NO_TMP_TABLE) + { + /* + We can perform this safely since only one writer at the time is + allowed on the table. + */ file->s->key_stat_version++; + } return 0; } |