mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge maria-5.3-mwl248 -> 5.5 = maria-5.5-mwl248.
This commit is contained in:
22
sql/table.cc
22
sql/table.cc
@@ -544,6 +544,12 @@ inline bool is_system_table_name(const char *name, uint length)
|
||||
my_tolower(ci, name[2]) == 'm' &&
|
||||
my_tolower(ci, name[3]) == 'e') ||
|
||||
|
||||
/* one of mysql.*_stat tables */
|
||||
(my_tolower(ci, name[length-4]) == 's' &&
|
||||
my_tolower(ci, name[length-3]) == 't' &&
|
||||
my_tolower(ci, name[length-2]) == 'a' &&
|
||||
my_tolower(ci, name[length-1]) == 't') ||
|
||||
|
||||
/* mysql.event table */
|
||||
(my_tolower(ci, name[0]) == 'e' &&
|
||||
my_tolower(ci, name[1]) == 'v' &&
|
||||
@@ -753,9 +759,11 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
|
||||
uchar forminfo[288];
|
||||
uchar *record;
|
||||
uchar *disk_buff, *strpos, *null_flags, *null_pos;
|
||||
ulong pos, record_offset;
|
||||
ulong pos, record_offset;
|
||||
ulong *rec_per_key= NULL;
|
||||
ulong rec_buff_length;
|
||||
double *read_avg_frequency= 0;
|
||||
double *write_avg_frequency= 0;
|
||||
handler *handler_file= 0;
|
||||
KEY *keyinfo;
|
||||
KEY_PART_INFO *key_part= NULL;
|
||||
@@ -938,6 +946,14 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
|
||||
if (!(rec_per_key= (ulong*) alloc_root(&share->mem_root,
|
||||
sizeof(ulong) * ext_key_parts)))
|
||||
goto err;
|
||||
if (!(read_avg_frequency= (double*) alloc_root(&share->mem_root,
|
||||
sizeof(double) *
|
||||
ext_key_parts)))
|
||||
goto err;
|
||||
if (!(write_avg_frequency= (double*) alloc_root(&share->mem_root,
|
||||
sizeof(double) *
|
||||
ext_key_parts)))
|
||||
goto err;
|
||||
first_key_part= key_part;
|
||||
first_key_parts= first_keyinfo.key_parts;
|
||||
keyinfo->flags= first_keyinfo.flags;
|
||||
@@ -950,9 +966,13 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
|
||||
|
||||
keyinfo->key_part= key_part;
|
||||
keyinfo->rec_per_key= rec_per_key;
|
||||
keyinfo->read_stat.avg_frequency= read_avg_frequency;
|
||||
keyinfo->write_stat.avg_frequency= write_avg_frequency;
|
||||
for (j=keyinfo->key_parts ; j-- ; key_part++)
|
||||
{
|
||||
*rec_per_key++=0;
|
||||
*read_avg_frequency++= 0;
|
||||
*write_avg_frequency++= 0;
|
||||
key_part->fieldnr= (uint16) (uint2korr(strpos) & FIELD_NR_MASK);
|
||||
key_part->offset= (uint) uint2korr(strpos+2)-1;
|
||||
key_part->key_type= (uint) uint2korr(strpos+5);
|
||||
|
Reference in New Issue
Block a user