1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2021-10-13 12:33:56 +03:00
70 changed files with 1087 additions and 331 deletions

View File

@@ -79,18 +79,25 @@ FT_WORD * ft_linearize(TREE *wtree, MEM_ROOT *mem_root)
DBUG_RETURN(wlist);
}
my_bool ft_boolean_check_syntax_string(const uchar *str)
my_bool ft_boolean_check_syntax_string(const uchar *str, size_t length,
CHARSET_INFO *cs)
{
uint i, j;
if (cs->mbminlen != 1)
{
DBUG_ASSERT(0);
return 1;
}
if (!str ||
(strlen((char*) str)+1 != sizeof(DEFAULT_FTB_SYNTAX)) ||
(length + 1 != sizeof(DEFAULT_FTB_SYNTAX)) ||
(str[0] != ' ' && str[1] != ' '))
return 1;
for (i=0; i<sizeof(DEFAULT_FTB_SYNTAX); i++)
{
/* limiting to 7-bit ascii only */
if ((unsigned char)(str[i]) > 127 || my_isalnum(default_charset_info, str[i]))
if ((unsigned char)(str[i]) > 127 || my_isalnum(cs, str[i]))
return 1;
for (j=0; j<i; j++)
if (str[i] == str[j] && (i != 11 || j != 10))