Bug #34879 Collations are mapped on numbers till 99 and after that mysql gives error
Submitted: 27 Feb 2008 11:02 Modified: 12 Mar 2008 22:14
Reporter: Salman Rawala Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any
Tags: collation

[27 Feb 2008 11:02] Salman Rawala
Description:
Collations are mapped on numbers till 99 in such a way that 100 onward numbers gives error. All other values are assigned till 99. This problem is seen on all collation variables.

How to repeat:
Sample Code:
SET @@collation_connection = 1;
SELECT @@collation_connection;
SET @@collation_connection = 2;
SELECT @@collation_connection;
SET @@collation_connection = 3;
SELECT @@collation_connection;
SET @@collation_connection = 99;
SELECT @@collation_connection;
--Error ER_UNKNOWN_COLLATION
SET @@collation_connection = 100;

Actual Output: 
SET @@collation_connection = 1;
SELECT @@collation_connection;
@@collation_connection
big5_chinese_ci
SET @@collation_connection = 2;
SELECT @@collation_connection;
@@collation_connection
latin2_czech_cs
SET @@collation_connection = 3;
SELECT @@collation_connection;
@@collation_connection
dec8_swedish_ci
SET @@collation_connection = 99;
SELECT @@collation_connection;
@@collation_connection
cp1250_polish_ci
SET @@collation_connection = 100;
ERROR HY000: Unknown collation: '100'
[27 Feb 2008 22:07] Sveta Smirnova
Thank you for the report.

But what is the problem with such behavior?
[11 Mar 2008 6:43] Rizwan Maredia
There are 127 collations shown in SHOW COLLATION where as we can only set numeric value from 1-99 which does not cover each value. Also there is an incorrect collation 'filename' at 17 which is not present in SHOW COLLATION listing. See also bug 34843.

Numeric access should be removed or at least discouraged.
[12 Mar 2008 22:14] Sveta Smirnova
Thank you for the feedback.

Syntax like "SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=33" is using for replication purpose, so it can not be discouraged.

As I see no reason except cosmetic in changing order of IDs of collations I close this report as "Not a Bug"