Bug #73924 MySql innodb_ft_max_token_size is not changing
Submitted: 16 Sep 2014 5:56 Modified: 16 Sep 2014 7:40
Reporter: Vikram Gharge Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: FULLTEXT search Severity:S2 (Serious)
Version:5.6.15, 5.6.17 OS:Windows
Assigned to: CPU Architecture:Any

[16 Sep 2014 5:56] Vikram Gharge
Description:
[9 Sep 13:01] Vikram Gharge

Description:
Unable to change innodb_ft_max_token_size variable value.

I have set that innodb_ft_max_token_size variable value to 512 in my.ini but it’s not changing in MySQL even after restarting MySQL service. Its giving default value as 84 (On Production Database Server).

In my local MySQL (Local Testing Server) if I am trying to change innodb_ft_max_token_size in my.ini then this variable value is getting reflected. 

Only change between local and production server is that local mysql version is 5.6.10 and production database server mysql version is 5.6.17

Please help me for this issue.

How to repeat:
Unable to change innodb_ft_max_token_size variable value.

I have set that innodb_ft_max_token_size variable value to 512 in my.ini but it’s not changing in MySQL even after restarting MySQL service. Its giving default value as 84 (On Production Database Server).

In my local MySQL (Local Testing Server) if I am trying to change innodb_ft_max_token_size in my.ini then this variable value is getting reflected. 

Only change between local and production server is that local mysql version is 5.6.10 and production database server mysql version is 5.6.17

Please help me for this issue.

[10 Sep 12:33] Umesh Umesh

Hello Vikram,

Thank you for the report.

# 5.6.22/5.7.6

// As per manual
Introduced	5.6.4
Command-Line Format	--innodb_ft_max_token_size=#
Option-File Format	innodb_ft_max_token_size
System Variable Name	innodb_ft_max_token_size
Variable Scope	Global
Dynamic Variable	No
Permitted Values
Type	        numeric
Default	        84
Min Value	10
Max Value	252

// Pass value at the commandline

[root@cluster-repo mysql-advanced-5.7.6]# bin/mysql_install_db --basedir=/data/ushastry/server/mysql-advanced-5.7.6 --datadir=/tmp/576
[root@cluster-repo mysql-advanced-5.7.6]# bin/mysqld --basedir=/data/ushastry/server/mysql-advanced-5.7.6 --datadir=/tmp/576 --innodb_ft_max_token_size=100 --user=root &
[1] 28475
[root@cluster-repo mysql-advanced-5.7.6]# 2014-09-12T02:31:29.334163Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-09-12T02:31:29.334396Z 0 [Note] bin/mysqld (mysqld 5.7.6-m16-enterprise-commercial-advanced) starting as process 28475 ...
2014-09-12T02:31:29.340620Z 0 [Warning] option 'innodb-ft-max-token-size': unsigned value 100 adjusted to 84

^^ Adjusted to 84

mysql> show variables like 'innodb_ft_max_token_size';
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| innodb_ft_max_token_size | 84    |
+--------------------------+-------+
1 row in set (0.00 sec)

mysql> show variables like '%version%';
+-------------------------+---------------------------------------------------------+
| Variable_name           | Value                                                   |
+-------------------------+---------------------------------------------------------+
| innodb_version          | 5.7.6                                                   |
| protocol_version        | 10                                                      |
| slave_type_conversions  |                                                         |
| version                 | 5.7.6-m16-enterprise-commercial-advanced                |
| version_comment         | MySQL Enterprise Server - Advanced Edition (Commercial) |
| version_compile_machine | x86_64                                                  |
| version_compile_os      | Linux                                                   |
+-------------------------+---------------------------------------------------------+
7 rows in set (0.00 sec)

 
Thanks,
Umesh

[10 Sep 12:34] Umesh Umesh

Looking at the src:

  // 5.6.20
  
  /home/ushastry/bzr/mysql/server/mysql-5.6/storage/innobase/include/fts0fts.h:
    368  
    369  /** Maximum possible Fulltext word length (in characters) */
    370  #define FTS_MAX_WORD_LEN_IN_CHAR	HA_FT_MAXCHARLEN
    
  /home/ushastry/bzr/mysql/server/mysql-5.6/include/ft_global.h:
       27  
       28  #define HA_FT_MAXBYTELEN 254
       29  #define HA_FT_MAXCHARLEN (HA_FT_MAXBYTELEN/3)
       
  /home/ushastry/bzr/mysql/server/mysql-5.6/storage/innobase/handler/ha_innodb.cc:
 16067    NULL, NULL, 3, 0, 16, 0);
 16068  
 16069  static MYSQL_SYSVAR_ULONG(ft_max_token_size, fts_max_token_size,
 16070    PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
 16071    "InnoDB Fulltext search maximum token size in characters",     
 
 So, may be doc need correction?

[11 Sep 5:49] Vikram Gharge

Hi Umesh,

My local version is 5.6.10 and here I able to change the size of innodb_ft_max_token_size upto 252, but when I tried the same in version 5.6.15 on my production server its not get changing.

 If I try to change this variable value as 80 then its getting changed in production server mysql version 5.6.15 (means below of 84), but when I tried to set the value as 100 or more than 84 then its not getting changed and bydefault value get reset to 84.

[12 Sep 7:56] Vikram Gharge

Hi Umesh,

Thanks for the reply sent on [10 Sep 12:33]

As per comments given by you on [10 Sep 12:33], Do I understand correctly that as per the code and configurations, the maximum value of this parameter can be 84 only and it is the documentation 
that is wrong in saying that it can be upto 252. 

Is there any way to change this maximum value by say making a change in the files(fts0fts.h,ft_global.h) you have mentioned to increase it beyond 84? 
Would that need us to recompile the entire codebase or is it just a change in those configuration files that is picked up at runtime. 

Also since we are able to change this parameter to more than 84 in 5.6.10, can you tell us in which version this change happened. 

Thank you so much for all your help.

How to repeat:
Install 5.6.15 on windows. try to change innodb_ft_max_token_size in my.ini file. restart server. and check is this parameter value has been changed or not? value is not changing.

Above bug already reported but didn't get any final solution. Please look in the comments and already discussion happened with MySQL support guy in description area (His Name is Umesh)
[16 Sep 2014 7:40] MySQL Verification Team
Hello Vikram,

Please do not submit the same bug more than once. An existing bug report Bug #73859 already describes this very problem. This bug has been verified and is currently being evaluated by the respective teams and once they are done then would surely respond to the original bug with more details. 

We hope you add your comments to the original bug instead.

Thank you for your interest in MySQL.

Thanks,
Umesh
[16 Sep 2014 7:42] MySQL Verification Team
This is duplicate of Bug #73859