Bug #27570 Russian lowcase 'ya' (cp1251) breaks SET or ENUM type
Submitted: 1 Apr 2007 10:44 Modified: 30 Sep 2007 10:27
Reporter: Alexander Bechkov Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Charsets Severity:S2 (Serious)
Version:3-5, 5.0.44 OS:Linux
Assigned to: CPU Architecture:Any

[1 Apr 2007 10:44] Alexander Bechkov
Description:
Russian lowcase 'ya' breaks arguments of SET or ENUM field.
Affected CREATE and ALTER queries
See below:

How to repeat:
CREATE TABLE `testtbl` (
  `section` enum('a','b','аяа','e') collate cp1251_bin NOT NULL default 'a'
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_bin;

mysql> show fields from testtbl;
+---------+---------------------------+------+-----+---------+-------+
| Field   | Type                      | Null | Key | Default | Extra |
+---------+---------------------------+------+-----+---------+-------+
| section | enum('a','b','а','а','e') | NO   |     | a       |       |
+---------+---------------------------+------+-----+---------+-------+
1 row in set (0.00 sec)

mysql> show variables;
+---------------------------------+-------------------------------------------+
| Variable_name                   | Value                                     |
+---------------------------------+-------------------------------------------+
| auto_increment_increment        | 1                                         |
| auto_increment_offset           | 1                                         |
| automatic_sp_privileges         | ON                                        |
| back_log                        | 50                                        |
| basedir                         | /usr/                                     |
| bdb_cache_size                  | 8388600                                   |
| bdb_home                        | /var/lib/mysql-cp1251/                    |
| bdb_log_buffer_size             | 32768                                     |
| bdb_logdir                      |                                           |
| bdb_max_lock                    | 10000                                     |
| bdb_shared_data                 | OFF                                       |
| bdb_tmpdir                      | /tmp/                                     |
| binlog_cache_size               | 32768                                     |
| bulk_insert_buffer_size         | 8388608                                   |
| character_set_client            | cp1251                                    |
| character_set_connection        | cp1251                                    |
| character_set_database          | cp1251                                    |
| character_set_filesystem        | binary                                    |
| character_set_results           | cp1251                                    |
| character_set_server            | cp1251                                    |
| character_set_system            | utf8                                      |
| character_sets_dir              | /usr/share/mysql/charsets/                |
| collation_connection            | cp1251_general_ci                         |
| collation_database              | cp1251_bin                                |
| collation_server                | cp1251_general_ci                         |
| completion_type                 | 0                                         |
| concurrent_insert               | 1                                         |
| connect_timeout                 | 5                                         |
| datadir                         | /var/lib/mysql-cp1251/                    |
| date_format                     | %Y-%m-%d                                  |
| datetime_format                 | %Y-%m-%d %H:%i:%s                         |
| default_week_format             | 0                                         |
| delay_key_write                 | ON                                        |
| delayed_insert_limit            | 100                                       |
| delayed_insert_timeout          | 300                                       |
| delayed_queue_size              | 1000                                      |
| div_precision_increment         | 4                                         |
| engine_condition_pushdown       | OFF                                       |
| expire_logs_days                | 0                                         |
| flush                           | OFF                                       |
| flush_time                      | 0                                         |
| ft_boolean_syntax               | + -><()~*:""&|                            |
| ft_max_word_len                 | 84                                        |
| ft_min_word_len                 | 4                                         |
| ft_query_expansion_limit        | 20                                        |
| ft_stopword_file                | (built-in)                                |
| group_concat_max_len            | 1024                                      |
| have_archive                    | NO                                        |
| have_bdb                        | YES                                       |
| have_blackhole_engine           | NO                                        |
| have_compress                   | YES                                       |
| have_crypt                      | YES                                       |
| have_csv                        | NO                                        |
| have_dynamic_loading            | YES                                       |
| have_example_engine             | NO                                        |
| have_federated_engine           | NO                                        |
| have_geometry                   | YES                                       |
| have_innodb                     | YES                                       |
| have_isam                       | NO                                        |
| have_merge_engine               | YES                                       |
| have_ndbcluster                 | NO                                        |
| have_openssl                    | DISABLED                                  |
| have_query_cache                | YES                                       |
| have_raid                       | NO                                        |
| have_rtree_keys                 | YES                                       |
| have_symlink                    | YES                                       |
| init_connect                    | SET NAMES cp1251                          |

....
                   |
| transaction_alloc_block_size    | 8192                                      |
| transaction_prealloc_size       | 4096                                      |
| tx_isolation                    | REPEATABLE-READ                           |
| updatable_views_with_limit      | YES                                       |
| version                         | 5.0.26-log                                |
| version_bdb                     | Sleepycat Software: Berkeley DB 4.1.24: ( |
| version_comment                 | Gentoo Linux mysql-5.0.26-r2              |
| version_compile_machine         | i686                                      |
| version_compile_os              | pc-linux-gnu                              |
| wait_timeout                    | 28800                                     |
+---------------------------------+-------------------------------------------+
228 rows in set (0.01 sec)
[1 Apr 2007 16:35] Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with a newer version,  5.0.37, and inform about the results. In case of the same problem, please, send the results of SHOW VARIABLES LIKE 'cha%' from the same environment.
[1 May 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[2 May 2007 7:24] Valeriy Kravchuk
Feedback is still needed.
[23 May 2007 11:48] Valeriy Kravchuk
Please, check with a newer version, 5.0.41.
[23 Jun 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[17 Aug 2007 17:05] Alexander Bechkov
Using default utf8 all is OK, but when cp1251 database created(with same connection-collation charset) lowcase 'ya' breaks SET or ENUM type
Old versions of mysql has the same "feature":

 CREATE TABLE `testtbl2` ( `section` enum('a','b','аяа','e') NOT NULL default 'a');
Query OK, 0 rows affected (0.00 sec)

mysql> show fields from testtbl2;
+---------+---------------------------+------+-----+---------+-------+
| Field   | Type                      | Null | Key | Default | Extra |
+---------+---------------------------+------+-----+---------+-------+
| section | enum('a','b','а','а','e') |      |     | a       |       |
+---------+---------------------------+------+-----+---------+-------+
1 row in set (0.00 sec)
mysql> show variables like 'character_set%';
+----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Variable_name  | Value                                                                                                                                                                                                   |
+----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| character_set  | latin1                                                                                                                                                                                                  |
| character_sets | latin1 big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin2 latin5 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620 |
+----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> show variables like 'version';
+---------------+---------+
| Variable_name | Value   |
+---------------+---------+
| version       | 3.23.58 |
+---------------+---------+
1 row in set (0.00 sec)
[21 Aug 2007 10:41] Alexander Bechkov
I'd investigated the problem.  It's occured when mysql compiled with latin1 option(version 5.0.44). With utf8 all is ok. Should i change the category to "compiling"?
[30 Aug 2007 10:27] Sveta Smirnova
Thank you for the feedback.

Please provide configure string you used to compile 5.0.44
[30 Sep 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".