From bba73a091031e9c324fedd6ad1bb26bcd4e635f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Nov 2005 00:26:37 -0500 Subject: 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 --- include/heap.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/heap.h') diff --git a/include/heap.h b/include/heap.h index badec9ce2ef..cfbb6113f86 100644 --- a/include/heap.h +++ b/include/heap.h @@ -136,6 +136,7 @@ typedef struct st_heap_share HP_KEYDEF *keydef; ulong min_records,max_records; /* Params to open */ ulong data_length,index_length,max_table_size; + uint key_stat_version; /* version to indicate insert/delete */ uint records; /* records */ uint blength; /* records rounded up to 2^n */ uint deleted; /* Deleted records in database */ -- cgit v1.2.1