summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2014-03-26 21:58:27 +0200
committerMichael Widenius <monty@mariadb.org>2014-03-26 21:58:27 +0200
commitded448d1d035d211c8146141546a08126bb728b6 (patch)
tree0ebba8935193517995519651885a34e46ff53515 /include
parent99316b51b6e78191eca303dc35ae5a204f8b5c4f (diff)
downloadmariadb-git-ded448d1d035d211c8146141546a08126bb728b6.tar.gz
MDEV-5905: Creating tmp. memory table kills the server
The reason was that a couple of variables that hold number of rows that was used to calculate buffers was uint and caused an overflow. Fixed by changing variables that could hold number of rows from uint to ulong and also added a cast for this test. include/heap.h: Reorder to get better alignment. Changed variables that could hold number of rows from uint to ulong mysql-test/suite/heap/heap.result: Added test case mysql-test/suite/heap/heap.test: Added test case mysql-test/suite/plugins/t/server_audit.test: Added sleep as we want to have disconnect logged before we try a new connect storage/heap/ha_heap.cc: Changed variables that could hold number of rows from uint to ulong Limit number of rows to 4G (as most of the variables that holds rows are ulong anyway) reset records_changed when key_stat_version is changed to not cause increments for every row changed storage/heap/ha_heap.h: changed records_changed to ulong as this can get big storage/heap/hp_create.c: Changed variables that could hold number of rows from uint to ulong Added cast (fixed the original bug) storage/heap/hp_delete.c: Changed variables that could hold number of rows from uint to ulong storage/heap/hp_open.c: Removed not needed cast storage/heap/hp_write.c: Changed variables that could hold number of rows from uint to ulong support-files/compiler_warnings.supp: Removed extra : from supression
Diffstat (limited to 'include')
-rw-r--r--include/heap.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/heap.h b/include/heap.h
index 10b165d89c6..2b7fd28699d 100644
--- a/include/heap.h
+++ b/include/heap.h
@@ -102,8 +102,8 @@ typedef struct st_heap_block
HP_PTRS *root; /* Top-level block */
struct st_level_info level_info[HP_MAX_LEVELS+1];
uint levels; /* number of used levels */
- uint records_in_block; /* Records in one heap-block */
uint recbuffer; /* Length of one saved record */
+ ulong records_in_block; /* Records in one heap-block */
ulong last_allocated; /* number of records there is allocated space for */
} HP_BLOCK;
@@ -134,14 +134,15 @@ typedef struct st_heap_share
{
HP_BLOCK block;
HP_KEYDEF *keydef;
- ulong min_records,max_records; /* Params to open */
ulonglong data_length,index_length,max_table_size;
+ ulonglong auto_increment;
+ ulong min_records,max_records; /* Params to open */
+ ulong records; /* records */
+ ulong blength; /* records rounded up to 2^n */
+ ulong deleted; /* Deleted records in database */
uint key_stat_version; /* version to indicate insert/delete */
uint key_version; /* Updated on key change */
uint file_version; /* Update on clear */
- uint records; /* records */
- uint blength; /* records rounded up to 2^n */
- uint deleted; /* Deleted records in database */
uint reclength; /* Length of one record */
uint changed;
uint keys,max_key_length;
@@ -156,7 +157,6 @@ typedef struct st_heap_share
LIST open_list;
uint auto_key;
uint auto_key_type; /* real type of the auto key segment */
- ulonglong auto_increment;
} HP_SHARE;
struct st_hp_hash_info;
@@ -187,12 +187,12 @@ typedef struct st_heap_info
typedef struct st_heap_create_info
{
HP_KEYDEF *keydef;
- ulong max_records;
- ulong min_records;
uint auto_key; /* keynr [1 - maxkey] for auto key */
uint auto_key_type;
uint keys;
uint reclength;
+ ulong max_records;
+ ulong min_records;
ulonglong max_table_size;
ulonglong auto_increment;
my_bool with_auto_increment;