diff options
author | unknown <pappa@c-5608e253.1238-1-64736c10.cust.bredbandsbolaget.se> | 2005-11-08 00:26:37 -0500 |
---|---|---|
committer | unknown <pappa@c-5608e253.1238-1-64736c10.cust.bredbandsbolaget.se> | 2005-11-08 00:26:37 -0500 |
commit | bba73a091031e9c324fedd6ad1bb26bcd4e635f9 (patch) | |
tree | c9d5aa727d72266be0ab83ff53f139f4209b6e51 /sql/ha_heap.h | |
parent | 0e878d7e541983757bc0b31e7caa8a16a5fd2896 (diff) | |
download | mariadb-git-bba73a091031e9c324fedd6ad1bb26bcd4e635f9.tar.gz |
Bug #12796: Record lost in HEAP table
Two handler objects were present, one was used for an insert and the other for a select
The state of the statistics was local to the handler object and thus the other handler
object didn't notice the insert.
Fix included:
1) Add a new variable key_stat_version added to whenever statistics was considered in need
of update (previously key_stats_ok= FALSE in those places)
2) Add a new handler variable key_stat_version assigned whenever key_stats_ok= TRUE was set
previously
3) Fix records_in_range to return records if records <= 1
4) Fix records_in_range to add 2 to rec_per_key to ensure we don't specify 0 or 1 when it isn't
and thus invoking incorrect optimisations.
5) Fix unique key handling for HEAP table in records_in_range
Diffstat (limited to 'sql/ha_heap.h')
-rw-r--r-- | sql/ha_heap.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/ha_heap.h b/sql/ha_heap.h index cbe2474492d..0a087fde1b0 100644 --- a/sql/ha_heap.h +++ b/sql/ha_heap.h @@ -29,10 +29,10 @@ class ha_heap: public handler key_map btree_keys; /* number of records changed since last statistics update */ uint records_changed; - bool key_stats_ok; + uint key_stat_version; public: ha_heap(TABLE *table): handler(table), file(0), records_changed(0), - key_stats_ok(0) {} + key_stat_version(0) {} ~ha_heap() {} const char *table_type() const { return "HEAP"; } const char *index_type(uint inx) |