summaryrefslogtreecommitdiff
path: root/storage/heap
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-03-26 22:25:38 +0100
committerSergei Golubchik <sergii@pisem.net>2014-03-26 22:25:38 +0100
commit10740939eb824bbd792352f654380e258edd7675 (patch)
treea4c68f331f0470b8bd30822de5938a6552f69738 /storage/heap
parenta91c59c2affdebb4b34c2c8000b0b1648d43046d (diff)
parent44002a34e680c79c01df879b540458c2885e97e8 (diff)
downloadmariadb-git-10740939eb824bbd792352f654380e258edd7675.tar.gz
5.5 merge
Diffstat (limited to 'storage/heap')
-rw-r--r--storage/heap/ha_heap.cc9
-rw-r--r--storage/heap/ha_heap.h2
-rw-r--r--storage/heap/hp_create.c4
-rw-r--r--storage/heap/hp_delete.c2
-rw-r--r--storage/heap/hp_open.c4
-rw-r--r--storage/heap/hp_write.c2
6 files changed, 13 insertions, 10 deletions
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 73dce174a09..5631d60a10a 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -215,7 +215,7 @@ void ha_heap::update_key_stats()
else
{
ha_rows hash_buckets= file->s->keydef[i].hash_buckets;
- uint no_records= hash_buckets ? (uint) (file->s->records/hash_buckets) : 2;
+ ha_rows no_records= hash_buckets ? (file->s->records/hash_buckets) : 2;
if (no_records < 2)
no_records= 2;
key->rec_per_key[key->user_defined_key_parts-1]= no_records;
@@ -244,6 +244,7 @@ int ha_heap::write_row(uchar * buf)
We can perform this safely since only one writer at the time is
allowed on the table.
*/
+ records_changed= 0;
file->s->key_stat_version++;
}
return res;
@@ -260,6 +261,7 @@ int ha_heap::update_row(const uchar * old_data, uchar * new_data)
We can perform this safely since only one writer at the time is
allowed on the table.
*/
+ records_changed= 0;
file->s->key_stat_version++;
}
return res;
@@ -276,6 +278,7 @@ int ha_heap::delete_row(const uchar * buf)
We can perform this safely since only one writer at the time is
allowed on the table.
*/
+ records_changed= 0;
file->s->key_stat_version++;
}
return res;
@@ -726,8 +729,8 @@ heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table,
if (share->max_rows && share->max_rows < max_rows)
max_rows= share->max_rows;
- hp_create_info->max_records= (ulong) max_rows;
- hp_create_info->min_records= (ulong) share->min_rows;
+ hp_create_info->max_records= (ulong) MY_MIN(max_rows, ULONG_MAX);
+ hp_create_info->min_records= (ulong) MY_MIN(share->min_rows, ULONG_MAX);
hp_create_info->keys= share->keys;
hp_create_info->reclength= share->reclength;
hp_create_info->keydef= keydef;
diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h
index 74824b66c42..503d3b896ac 100644
--- a/storage/heap/ha_heap.h
+++ b/storage/heap/ha_heap.h
@@ -31,7 +31,7 @@ class ha_heap: public handler
HP_SHARE *internal_share;
key_map btree_keys;
/* number of records changed since last statistics update */
- uint records_changed;
+ ulong records_changed;
uint key_stat_version;
my_bool internal_table;
public:
diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c
index e286ff69e61..30831f229ac 100644
--- a/storage/heap/hp_create.c
+++ b/storage/heap/hp_create.c
@@ -248,7 +248,7 @@ static int keys_compare(heap_rb_param *param, uchar *key1, uchar *key2)
static void init_block(HP_BLOCK *block, uint reclength, ulong min_records,
ulong max_records)
{
- uint i,recbuffer,records_in_block;
+ ulong i,recbuffer,records_in_block;
/*
If not min_records and max_records are given, optimize for 1000 rows
@@ -276,7 +276,7 @@ static void init_block(HP_BLOCK *block, uint reclength, ulong min_records,
The + 1 is there to ensure that we get at least 1 row per level (for
the exceptional case of very long rows)
*/
- if (records_in_block*recbuffer >
+ if ((ulonglong) records_in_block*recbuffer >
(my_default_record_cache_size-sizeof(HP_PTRS)*HP_MAX_LEVELS))
records_in_block= (my_default_record_cache_size - sizeof(HP_PTRS) *
HP_MAX_LEVELS) / recbuffer + 1;
diff --git a/storage/heap/hp_delete.c b/storage/heap/hp_delete.c
index fe71b14a30a..1cbfe7408d4 100644
--- a/storage/heap/hp_delete.c
+++ b/storage/heap/hp_delete.c
@@ -68,7 +68,7 @@ int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
const uchar *record, uchar *recpos, int flag)
{
heap_rb_param custom_arg;
- uint old_allocated;
+ ulong old_allocated;
int res;
if (flag)
diff --git a/storage/heap/hp_open.c b/storage/heap/hp_open.c
index fc7397989f2..43b366639bb 100644
--- a/storage/heap/hp_open.c
+++ b/storage/heap/hp_open.c
@@ -30,7 +30,7 @@ HP_INFO *heap_open_from_share(HP_SHARE *share, int mode)
HP_INFO *info;
DBUG_ENTER("heap_open_from_share");
- if (!(info= (HP_INFO*) my_malloc((uint) sizeof(HP_INFO) +
+ if (!(info= (HP_INFO*) my_malloc(sizeof(HP_INFO) +
2 * share->max_key_length,
MYF(MY_ZEROFILL +
(share->internal ?
@@ -49,7 +49,7 @@ HP_INFO *heap_open_from_share(HP_SHARE *share, int mode)
#ifndef DBUG_OFF
info->opt_flag= READ_CHECK_USED; /* Check when changing */
#endif
- DBUG_PRINT("exit",("heap: 0x%lx reclength: %d records_in_block: %d",
+ DBUG_PRINT("exit",("heap: 0x%lx reclength: %d records_in_block: %lu",
(long) info, share->reclength,
share->block.records_in_block));
DBUG_RETURN(info);
diff --git a/storage/heap/hp_write.c b/storage/heap/hp_write.c
index c84fc4b6104..b6ca97629ca 100644
--- a/storage/heap/hp_write.c
+++ b/storage/heap/hp_write.c
@@ -400,7 +400,7 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo,
static HASH_INFO *hp_find_free_hash(HP_SHARE *info,
HP_BLOCK *block, ulong records)
{
- uint block_pos;
+ ulong block_pos;
size_t length;
if (records < block->last_allocated)