summaryrefslogtreecommitdiff
path: root/storage/heap
diff options
context:
space:
mode:
Diffstat (limited to 'storage/heap')
-rw-r--r--storage/heap/ha_heap.cc12
-rw-r--r--storage/heap/hp_create.c10
-rw-r--r--storage/heap/hp_test2.c4
3 files changed, 13 insertions, 13 deletions
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 916abaa60ea..b9ff9d28159 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -211,14 +211,14 @@ void ha_heap::update_key_stats()
if (key->algorithm != HA_KEY_ALG_BTREE)
{
if (key->flags & HA_NOSAME)
- key->rec_per_key[key->key_parts-1]= 1;
+ key->rec_per_key[key->user_defined_key_parts-1]= 1;
else
{
ha_rows hash_buckets= file->s->keydef[i].hash_buckets;
uint no_records= hash_buckets ? (uint) (file->s->records/hash_buckets) : 2;
if (no_records < 2)
no_records= 2;
- key->rec_per_key[key->key_parts-1]= no_records;
+ key->rec_per_key[key->user_defined_key_parts-1]= no_records;
}
}
}
@@ -601,7 +601,7 @@ ha_rows ha_heap::records_in_range(uint inx, key_range *min_key,
/* Assert that info() did run. We need current statistics here. */
DBUG_ASSERT(key_stat_version == file->s->key_stat_version);
- return key->rec_per_key[key->key_parts-1];
+ return key->rec_per_key[key->user_defined_key_parts-1];
}
@@ -620,7 +620,7 @@ heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table,
bzero(hp_create_info, sizeof(*hp_create_info));
for (key= parts= 0; key < keys; key++)
- parts+= table_arg->key_info[key].key_parts;
+ parts+= table_arg->key_info[key].user_defined_key_parts;
if (!(keydef= (HP_KEYDEF*) my_malloc(keys * sizeof(HP_KEYDEF) +
parts * sizeof(HA_KEYSEG),
@@ -631,9 +631,9 @@ heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table,
{
KEY *pos= table_arg->key_info+key;
KEY_PART_INFO *key_part= pos->key_part;
- KEY_PART_INFO *key_part_end= key_part + pos->key_parts;
+ KEY_PART_INFO *key_part_end= key_part + pos->user_defined_key_parts;
- keydef[key].keysegs= (uint) pos->key_parts;
+ keydef[key].keysegs= (uint) pos->user_defined_key_parts;
keydef[key].flag= (pos->flags & (HA_NOSAME | HA_NULL_ARE_EQUAL));
keydef[key].seg= seg;
diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c
index a8bc8e63810..e286ff69e61 100644
--- a/storage/heap/hp_create.c
+++ b/storage/heap/hp_create.c
@@ -254,18 +254,18 @@ static void init_block(HP_BLOCK *block, uint reclength, ulong min_records,
If not min_records and max_records are given, optimize for 1000 rows
*/
if (!min_records)
- min_records= min(1000, max_records);
+ min_records= MY_MIN(1000, max_records);
if (!max_records)
- max_records= max(min_records, 1000);
+ max_records= MY_MAX(min_records, 1000);
/*
We don't want too few records_in_block as otherwise the overhead of
of the HP_PTRS block will be too notable
*/
- records_in_block= max(1000, min_records);
- records_in_block= min(records_in_block, max_records);
+ records_in_block= MY_MAX(1000, min_records);
+ records_in_block= MY_MIN(records_in_block, max_records);
/* If big max_records is given, allocate bigger blocks */
- records_in_block= max(records_in_block, max_records / 10);
+ records_in_block= MY_MAX(records_in_block, max_records / 10);
/* We don't want too few blocks per row either */
if (records_in_block < 10)
records_in_block= 10;
diff --git a/storage/heap/hp_test2.c b/storage/heap/hp_test2.c
index 058a2904697..13b49fbb7ec 100644
--- a/storage/heap/hp_test2.c
+++ b/storage/heap/hp_test2.c
@@ -132,7 +132,7 @@ int main(int argc, char *argv[])
for (i=0 ; i < recant ; i++)
{
- n1=rnd(1000); n2=rnd(100); n3=rnd(min(recant*5,MAX_RECORDS));
+ n1=rnd(1000); n2=rnd(100); n3=rnd(MY_MIN(recant*5,MAX_RECORDS));
make_record(record,n1,n2,n3,"Pos",write_count);
if (heap_write(file,record))
@@ -208,7 +208,7 @@ int main(int argc, char *argv[])
printf("- Update\n");
for (i=0 ; i < write_count/10 ; i++)
{
- n1=rnd(1000); n2=rnd(100); n3=rnd(min(recant*2,MAX_RECORDS));
+ n1=rnd(1000); n2=rnd(100); n3=rnd(MY_MIN(recant*2,MAX_RECORDS));
make_record(record2, n1, n2, n3, "XXX", update);
if (rnd(2) == 1)
{