mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 10:31:54 +01:00
use FT_MAX_WORD_LEN_FOR_SORT instead of HA_FT_MAXBYTELEN when calculating
preferred key block length for ft index
This commit is contained in:
parent
2ca5a0f2b1
commit
48e7c9abc6
1 changed files with 6 additions and 4 deletions
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
/* Create a MyISAM table */
|
/* Create a MyISAM table */
|
||||||
|
|
||||||
#include "fulltext.h"
|
#include "ftdefs.h"
|
||||||
#include "sp_defs.h"
|
#include "sp_defs.h"
|
||||||
|
|
||||||
#if defined(MSDOS) || defined(__WIN__)
|
#if defined(MSDOS) || defined(__WIN__)
|
||||||
|
@ -41,7 +41,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
|
||||||
File dfile,file;
|
File dfile,file;
|
||||||
int errpos,save_errno;
|
int errpos,save_errno;
|
||||||
myf create_flag;
|
myf create_flag;
|
||||||
uint fields,length,max_key_length,packed,pointer,
|
uint fields,length,max_key_length,packed,pointer,real_length_diff,
|
||||||
key_length,info_length,key_segs,options,min_key_length_skip,
|
key_length,info_length,key_segs,options,min_key_length_skip,
|
||||||
base_pos,varchar_count,long_varchar_count,varchar_length,
|
base_pos,varchar_count,long_varchar_count,varchar_length,
|
||||||
max_key_block_length,unique_key_parts,fulltext_keys,offset;
|
max_key_block_length,unique_key_parts,fulltext_keys,offset;
|
||||||
|
@ -238,7 +238,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
|
||||||
{
|
{
|
||||||
|
|
||||||
share.state.key_root[i]= HA_OFFSET_ERROR;
|
share.state.key_root[i]= HA_OFFSET_ERROR;
|
||||||
min_key_length_skip=length=0;
|
min_key_length_skip=length=real_length_diff=0;
|
||||||
key_length=pointer;
|
key_length=pointer;
|
||||||
if (keydef->flag & HA_SPATIAL)
|
if (keydef->flag & HA_SPATIAL)
|
||||||
{
|
{
|
||||||
|
@ -297,6 +297,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
|
||||||
key_length+= HA_FT_MAXBYTELEN+HA_FT_WLEN;
|
key_length+= HA_FT_MAXBYTELEN+HA_FT_WLEN;
|
||||||
length++; /* At least one length byte */
|
length++; /* At least one length byte */
|
||||||
min_key_length_skip+=HA_FT_MAXBYTELEN;
|
min_key_length_skip+=HA_FT_MAXBYTELEN;
|
||||||
|
real_length_diff=HA_FT_MAXBYTELEN-FT_MAX_WORD_LEN_FOR_SORT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -397,7 +398,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
|
||||||
key_segs)
|
key_segs)
|
||||||
share.state.rec_per_key_part[key_segs-1]=1L;
|
share.state.rec_per_key_part[key_segs-1]=1L;
|
||||||
length+=key_length;
|
length+=key_length;
|
||||||
keydef->block_length= MI_BLOCK_SIZE(length,pointer,MI_MAX_KEYPTR_SIZE);
|
keydef->block_length= MI_BLOCK_SIZE(length-real_length_diff,
|
||||||
|
pointer,MI_MAX_KEYPTR_SIZE);
|
||||||
if (keydef->block_length > MI_MAX_KEY_BLOCK_LENGTH ||
|
if (keydef->block_length > MI_MAX_KEY_BLOCK_LENGTH ||
|
||||||
length >= MI_MAX_KEY_BUFF)
|
length >= MI_MAX_KEY_BUFF)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue