Bug #34883 ft_boolean_syntax cant be assigned from user variable to global var.
Submitted: 27 Feb 2008 11:14 Modified: 16 Mar 2010 0:07
Reporter: Salman Rawala Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.1.23 OS:Any
Assigned to: CPU Architecture:Any
Tags: ft_boolean_syntax

[27 Feb 2008 11:14] Salman Rawala
Description:
When you finally assign temporary initial variable's value to session value, an error occurs that '' value cannot be set to variable

How to repeat:
Sample Code: 
SELECT @global_start_value;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.ft_boolean_syntax = @global_start_value;

Actual Result: 
SELECT @global_start_value;
@global_start_value
+ -><()~*:""&|
SET @@global.ft_boolean_syntax = @global_start_value;
ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of ''
[27 Feb 2008 11:28] Valeriy Kravchuk
Thank you for a bug report. Other variables, e.g. @@global.key_buffer_size, can be set this way, so it looks like inconsistency.
[27 Feb 2008 15:23] Sergei Golubchik
The manual specifies what values are allowed for ft_boolean_syntax. Empty string is not one of them.

And this has nothing to do with temporary variables.
[12 Mar 2008 11:33] Salman Rawala
So it means that we can not assign temporary variable to ft_boolean_syntax even if the variable contains the valid value.

SET @global_start_value = @@global.ft_boolean_syntax;
SELECT @global_start_value;
@global_start_value
+ -><()~*:""&|
SET @@global.ft_boolean_syntax = @global_start_value;
ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of ''

As we can see that @global_start_value contains valid value but assigning this  variable is causing the problem.
[13 Mar 2008 10:46] Sergei Golubchik
You're right, sorry for confusion.

Hint: the code uses var->value->str_value.c_ptr(), it should use var->value->val_str() for an obvious reason. this was copy-pasted all over set_var.cc, all places should be fixed.
[13 Mar 2008 21:05] Omer Barnir
workaround: set the value of the via program code
[10 Aug 2009 10:45] Sergei Golubchik
will be fixed in WL#4738
[6 Mar 2010 11:08] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:vvaintroub@fedora12-20091225154921-x25a5pyw1pxiwobv) (merge vers: 5.5.99) (pib:16)
[16 Mar 2010 0:07] Paul DuBois
Noted in 5.5.3 changelog.

String-valued system variables could be assigned literal values, but
could not be assigned values using expressions. Now expressions are
legal.