1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Changed KEY names to use LEX_CSTRING

This commit is contained in:
Michael Widenius
2017-06-18 12:28:40 +03:00
committed by Sergei Golubchik
parent 874e4e473a
commit cc77f9882d
31 changed files with 180 additions and 162 deletions

View File

@ -2129,18 +2129,18 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
for (uint key=0 ; key < keys ; key++,keyinfo++)
{
uint usable_parts= 0;
keyinfo->name=(char*) share->keynames.type_names[key];
keyinfo->name_length= strlen(keyinfo->name);
keyinfo->name.str= share->keynames.type_names[key];
keyinfo->name.length= strlen(keyinfo->name.str);
keyinfo->cache_name=
(uchar*) alloc_root(&share->mem_root,
share->table_cache_key.length+
keyinfo->name_length + 1);
keyinfo->name.length + 1);
if (keyinfo->cache_name) // If not out of memory
{
uchar *pos= keyinfo->cache_name;
memcpy(pos, share->table_cache_key.str, share->table_cache_key.length);
memcpy(pos + share->table_cache_key.length, keyinfo->name,
keyinfo->name_length+1);
memcpy(pos + share->table_cache_key.length, keyinfo->name.str,
keyinfo->name.length+1);
}
if (!key)
@ -6896,7 +6896,8 @@ bool TABLE::add_tmp_key(uint key, uint key_parts,
if (unique)
keyinfo->flags|= HA_NOSAME;
sprintf(buf, "key%i", key);
if (!(keyinfo->name= strdup_root(&mem_root, buf)))
keyinfo->name.length= strlen(buf);
if (!(keyinfo->name.str= strmake_root(&mem_root, buf, keyinfo->name.length)))
return TRUE;
keyinfo->rec_per_key= (ulong*) alloc_root(&mem_root,
sizeof(ulong)*key_parts);