Bug #28234 global/session scope - documentation vs implementation
Submitted: 4 May 2007 10:45 Modified: 8 Dec 2008 23:16
Reporter: Martin Friebe (Gold Quality Contributor) (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: FULLTEXT search Severity:S3 (Non-critical)
Version:5.0.42 OS:Any
Assigned to: Ingo Strüwing CPU Architecture:Any
Tags: global, qc, session, variable

[4 May 2007 10:45] Martin Friebe
Description:
Looking at http://dev.mysql.com/doc/refman/5.0/en/mysqld-option-tables.html

There are some global/session specification, that differ to the implementation. Part of them seem to be a documentation-bug. Others could be either end, as imho they would make sense as documented, but could be restricted too.

variable - scope (global/session) - dynamic

ft_boolean_syntax 	  	both 	yes
ft_max_word_len 		both 	yes
ft_min_word_len 	  	global 	yes
ft_query_expansion_limit  	both 	yes
ft_stopword_file 		both 	yes

1) it makes no sense for ft_min_word_len and ft_max_word_len to have different scope. Neither should ft_stopword_file be both.
All 3 should be global only, as they need a rebuild of the index.

I can not tell if this is a documentation issue, as even "set global ft_max_word_len=100;" results in "unknown system variable" (Bug #25430 ?). (same for min_len and stop_word.

This is even so they are declared dynamyc=yes
(if dynamic does not stand for "changeable at runtime" then make this a request to clarify the doc, please)

If they are not dynamic (not changeable at runtime) the returned error msg is misleading. They are not "unknown", they would simply be "not writeable"

2)
ft_query_expansion_limit appears to be non-dynamic too. I believe this is an implementation issue, and it should be dynamic

3)
ft_boolean_syntax is global only. At least according to the error you get, if you try to "set session ft_boolean_syntax ..."
This may be considered implementation or documentation. I don't see a reason for it not to allow session scope.

How to repeat:
see documentation.

set global ft_max_word_len=100;
set global ft_min_word_len=1;
set global ft_stopword_file='x';

set global ft_query_expansion_limit=1;
set session ft_query_expansion_limit=1;

set global ft_boolean_syntax  = '+ -><()~*:""&|'; #works
set session ft_boolean_syntax  = '+ -><()~*:""&|'; #error, only global

Suggested fix:
this may be partly related to Bug #25430

assuming dynamic means "changeable at runtime" (otherwise please document the meaning of "dynamic"

1) ft_boolean_syntax  ft_max_word_len  ft_min_word_len
- should be documented global
- should either be documented "non-dynamic" or implemented dynamic

ft_query_expansion_limit, ft_stopword_file
- decide and document or implement the value for scope and dynamic
[4 May 2007 12:21] MySQL Verification Team
Thank you for the bug report.
[8 Jan 2008 19:10] Paul DuBois
All of the ft_xxx system variables are global-only, and only
ft_boolean_syntax is dynamic (can be changed at runtime).

The manual is incorrect in saying that all are dynamic. I will
fix that part of this bug report, but leave it open per any
decision about error messages, etc.
[1 Oct 2008 9:50] Ingo Strüwing
Problem forwarded to the architects:

In the array set_var.cc:fixed_vars[] (5.1, 6.0) we have listed "variables", which can not be set not selected. The error messages is "unknown system variable". So we can see them as command-line options.

OTOH, SHOW VARIABLES lists them, which seems confusing.

A user complaint is in Bug#28234 (global/session scope - documentation vs implementation) for example.

One possible fix could be to allow selecting them and fail with "read only" on set.

OTOH, there is a comment of "TODO: remove this list completely" before the array initialization. This may mean that these "variables" should no longer show up in SHOW VARIABLES.

Or it means that they shall be integrated into the normal system variables list as read-only variables.

Please advice, how to fix.
[4 Oct 2008 19:22] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/55343

2751 Ingo Struewing	2008-10-04
      Bug#28234 - global/session scope - documentation vs implementation
      
      Several system variables did not behave like system variables should do.
      When trying to SET them or use them in SELECT, they were reported as
      "unknown system variable". But they appeared in SHOW VARIABLES.
      
      This has been fixed by removing the "fixed_vars" array of variables
      and integrating the variables into the normal system variables chain.
      All of these variables do now behave as read-only global-only
      variables. Trying to SET them tells they are read-only, trying to
      SELECT the session value tells they are global only. Selecting the
      global value works. It delivers the same value as SHOW VARIABLES.
[20 Nov 2008 15:58] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/59410

2751 Ingo Struewing	2008-11-20
      Bug#28234 - global/session scope - documentation vs implementation
            
      Several system variables did not behave like system variables should do.
      When trying to SET them or use them in SELECT, they were reported as
      "unknown system variable". But they appeared in SHOW VARIABLES.
            
      This has been fixed by removing the "fixed_vars" array of variables
      and integrating the variables into the normal system variables chain.
      All of these variables do now behave as read-only global-only
      variables. Trying to SET them tells they are read-only, trying to
      SELECT the session value tells they are global only. Selecting the
      global value works. It delivers the same value as SHOW VARIABLES.
[21 Nov 2008 23:22] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/59596

2723 Ingo Struewing	2008-11-22
      Bug#28234 - global/session scope - documentation vs implementation
      
      Several system variables did not behave like system variables should do.
      When trying to SET them or use them in SELECT, they were reported as
      "unknown system variable". But they appeared in SHOW VARIABLES.
      
      This has been fixed by removing the "fixed_vars" array of variables
      and integrating the variables into the normal system variables chain.
      All of these variables do now behave as read-only global-only
      variables. Trying to SET them tells they are read-only, trying to
      SELECT the session value tells they are global only. Selecting the
      global value works. It delivers the same value as SHOW VARIABLES.
[24 Nov 2008 20:46] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/59718

2744 Ingo Struewing	2008-11-24 [merge]
      Bug#28234 - global/session scope - documentation vs implementation
      
      Several system variables did not behave like system variables should do.
      When trying to SET them or use them in SELECT, they were reported as
      "unknown system variable". But they appeared in SHOW VARIABLES.
      
      This has been fixed by removing the "fixed_vars" array of variables
      and integrating the variables into the normal system variables chain.
      All of these variables do now behave as read-only global-only
      variables. Trying to SET them tells they are read-only, trying to
      SELECT the session value tells they are global only. Selecting the
      global value works. It delivers the same value as SHOW VARIABLES.
[25 Nov 2008 15:34] Ingo Strüwing
Queued to 6.0-bugteam and 5.1-bugteam.
[27 Nov 2008 10:50] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/60016

2713 Ingo Struewing	2008-11-27
      Bug#28234 - global/session scope - documentation vs implementation
      
      Post-pushbuild fix.
      
      - Windows does not have 'socket' system variable.
      - Compiler warning in sql/slave.cc
[8 Dec 2008 10:20] Bugs System
Pushed into 5.1.31  (revid:ingo.struewing@sun.com-20081127105028-o4baujzdupcj1um2) (version source revid:ingo.struewing@sun.com-20081127105028-o4baujzdupcj1um2) (pib:5)
[8 Dec 2008 11:31] Bugs System
Pushed into 6.0.9-alpha  (revid:ingo.struewing@sun.com-20081127105028-o4baujzdupcj1um2) (version source revid:ingo.struewing@sun.com-20081127110159-tmxj06271gtq0hu3) (pib:5)
[8 Dec 2008 23:16] Paul DuBois
Noted in 5.1.31, 6.0.9 changelog.

For several read only system variables that were viewable with SHOW
VARIABLES, attempting to view them with SELECT @@var_name or set
their values with SET resulted in an unknown system variable error.
Now they can be viewed with SELECT @@var_name and attempting to set
their values results in a message indicating that they are read only.
[19 Jan 2009 11:24] Bugs System
Pushed into 5.1.31-ndb-6.2.17 (revid:tomas.ulin@sun.com-20090119095303-uwwvxiibtr38djii) (version source revid:tomas.ulin@sun.com-20090108105244-8opp3i85jw0uj5ib) (merge vers: 5.1.31-ndb-6.2.17) (pib:6)
[19 Jan 2009 13:02] Bugs System
Pushed into 5.1.31-ndb-6.3.21 (revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl) (version source revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl) (merge vers: 5.1.31-ndb-6.3.21) (pib:6)
[19 Jan 2009 16:08] Bugs System
Pushed into 5.1.31-ndb-6.4.1 (revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5) (version source revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5) (merge vers: 5.1.31-ndb-6.4.1) (pib:6)