Bug #22647 LC_TIME_NAMES: Only exact literals allowed
Submitted: 24 Sep 2006 19:48 Modified: 23 Jan 2007 20:54
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1BK OS:Linux (Suse 10)
Assigned to: Alexander Barkov CPU Architecture:Any

[24 Sep 2006 19:48] Peter Gulutzan
Description:
For other statements of the form "SET ... = value", value
can be a variable, or an expression. But for SET LC_TIME_NAMES
it must be a literal.

For other statements of the form "SET ... = value", value
can be upper case, lower case, or mixed. But for SET LC_TIME_NAMES
it must be exact.

How to repeat:
mysql> SET @A = 'MYISAM';
Query OK, 0 rows affected (0.00 sec)

mysql> SET STORAGE_ENGINE = @A;
Query OK, 0 rows affected (0.00 sec)

mysql> SET @A = LOWER('myisam');
Query OK, 0 rows affected (0.00 sec)

mysql> SET STORAGE_ENGINE = 'myisam';
Query OK, 0 rows affected (0.00 sec)

mysql> SET STORAGE_ENGINE = LOWER('MYISAM');
Query OK, 0 rows affected (0.00 sec)

mysql> SET LC_TIME_NAMES = 'ja_JP';
Query OK, 0 rows affected (0.00 sec)

mysql> SET LC_TIME_NAMES = 'JA_JP';
ERROR 1105 (HY000): Unknown locale: 'JA_JP'

mysql> SET @a = 'ja_JP';
Query OK, 0 rows affected (0.00 sec)

mysql> SET LC_TIME_NAMES = @a;
ERROR 1105 (HY000): Unknown locale: ''
[25 Sep 2006 0:01] Miguel Solorzano
Thank you for the bug report. Verified as described.
[22 Jan 2007 6:55] Alexander Barkov
This problem was fixed under terms of
bug#22645 LC_TIME_NAMES: Statement not replicated.

variables.test has got some enough coverage:

set lc_time_names=en_US;      -- identifier
set @@lc_time_names='ru_ru';  -- character string 
set lc_time_names=concat('de','_','DE'); -- function
set @lc='JA_JP';
set @@lc_time_names=@lc; -- user variable

Changing status to "documenting".
[23 Jan 2007 20:54] Paul Dubois
Noted in 4.1.23, 5.0.36, 5.1.15 changelogs.

SET lc_time_names = value allowed only exact literal values, not
expression values.