mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge 10.2 into 10.3
This commit is contained in:
@ -2106,8 +2106,8 @@ int alloc_statistics_for_table(THD* thd, TABLE *table)
|
||||
sizeof(Index_statistics) * keys);
|
||||
|
||||
uint key_parts= table->s->ext_key_parts;
|
||||
ulong *idx_avg_frequency= (ulong*) alloc_root(&table->mem_root,
|
||||
sizeof(ulong) * key_parts);
|
||||
ulonglong *idx_avg_frequency= (ulonglong*) alloc_root(&table->mem_root,
|
||||
sizeof(ulonglong) * key_parts);
|
||||
|
||||
uint columns= 0;
|
||||
for (field_ptr= table->field; *field_ptr; field_ptr++)
|
||||
@ -2152,7 +2152,7 @@ int alloc_statistics_for_table(THD* thd, TABLE *table)
|
||||
}
|
||||
}
|
||||
|
||||
memset(idx_avg_frequency, 0, sizeof(ulong) * key_parts);
|
||||
memset(idx_avg_frequency, 0, sizeof(ulonglong) * key_parts);
|
||||
|
||||
KEY *key_info, *end;
|
||||
for (key_info= table->key_info, end= key_info + table->s->keys;
|
||||
@ -2268,14 +2268,14 @@ static int alloc_statistics_for_table_share(THD* thd, TABLE_SHARE *table_share)
|
||||
}
|
||||
|
||||
uint key_parts= table_share->ext_key_parts;
|
||||
ulong *idx_avg_frequency= table_stats->idx_avg_frequency;
|
||||
ulonglong *idx_avg_frequency= table_stats->idx_avg_frequency;
|
||||
if (!idx_avg_frequency)
|
||||
{
|
||||
idx_avg_frequency= (ulong*) alloc_root(&stats_cb->mem_root,
|
||||
sizeof(ulong) * key_parts);
|
||||
idx_avg_frequency= (ulonglong*) alloc_root(&stats_cb->mem_root,
|
||||
sizeof(ulonglong) * key_parts);
|
||||
if (idx_avg_frequency)
|
||||
{
|
||||
memset(idx_avg_frequency, 0, sizeof(ulong) * key_parts);
|
||||
memset(idx_avg_frequency, 0, sizeof(ulonglong) * key_parts);
|
||||
table_stats->idx_avg_frequency= idx_avg_frequency;
|
||||
for (key_info= table_share->key_info, end= key_info + keys;
|
||||
key_info < end;
|
||||
|
Reference in New Issue
Block a user