SET STATEMENT character_set_client, character_set_connection, character_set_filesystem have no effect

Bug #1388555 reported by Elena Stepanova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.6
Triaged
Medium
Unassigned
5.7
Triaged
Medium
Unassigned

Bug Description

MySQL [test]> set names utf8;
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> select 'фи';
+------+
| фи |
+------+
| фи |
+------+
1 row in set (0.00 sec)

MySQL [test]> set statement character_set_client = latin5 for select 'фи';
+------+
| фи |
+------+
| фи |
+------+
1 row in set (0.00 sec)

# Compare with:

MySQL [test]> set character_set_client = latin5;
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> select 'фи';
+----------+
| фи |
+----------+
| фи |
+----------+
1 row in set (0.00 sec)

#---------------------------------------------------------------

MySQL [test]> set names utf8;
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> select 'фи';
+------+
| фи |
+------+
| фи |
+------+
1 row in set (0.01 sec)

MySQL [test]> set statement CHARACTER_SET_CONNECTION = latin5 for select 'фи';
+------+
| фи |
+------+
| фи |
+------+
1 row in set (0.00 sec)

# Compare with:

MySQL [test]> set character_set_connection = latin5;
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> select 'фи';
+----+
| ?? |
+----+
| ?? |
+----+
1 row in set (0.00 sec)

#---------------------------------------------------------------

MySQL [test]> set names utf8;
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> system touch 'файл';
MySQL [test]> create table tmp (i int);
Query OK, 0 rows affected (0.64 sec)

MySQL [test]> set statement CHARACTER_SET_FILESYSTEM = latin5 for load data local infile 'файл' into table tmp;
Query OK, 0 rows affected (0.00 sec)
Records: 0 Deleted: 0 Skipped: 0 Warnings: 0

# Compare with:

MySQL [test]> set character_set_filesystem = latin5;
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> load data local infile 'файл' into table tmp;
ERROR 2 (HY000): File '????' not found (Errcode: 2)

Elena Stepanova (elenst)
summary: - SET STATEMENT character_set_client has no effect
+ SET STATEMENT character_set_client, character_set_connection have no
+ effect
description: updated
Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote : Re: SET STATEMENT character_set_client, character_set_connection have no effect

This is easy to confirm:

[openxs@centos ~]$ mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.21-70.0 Percona Server (GPL), Release 70.0, Revision 688

Copyright (c) 2009-2014 Percona LLC and/or its affiliates
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> set names utf8;
Query OK, 0 rows affected (0.00 sec)

mysql> select 'фи';
+------+
| фи |
+------+
| фи |
+------+
1 row in set (0.00 sec)

mysql> set statement character_set_client = latin5 for select 'фи';
+------+
| фи |
+------+
| фи |
+------+
1 row in set (0.00 sec)

mysql> set character_set_client = latin5;
Query OK, 0 rows affected (0.00 sec)

mysql> select 'фи';
+----------+
| �и |
+----------+
| �и |
+----------+
1 row in set (0.00 sec)

Elena Stepanova (elenst)
summary: - SET STATEMENT character_set_client, character_set_connection have no
- effect
+ SET STATEMENT character_set_client, character_set_connection,
+ character_set_filesystem have no effect
description: updated
Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

This is easy to confirm:

[openxs@centos ~]$ mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.21-70.0 Percona Server (GPL), Release 70.0, Revision 688

Copyright (c) 2009-2014 Percona LLC and/or its affiliates
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> set names utf8;
Query OK, 0 rows affected (0.00 sec)

mysql> select 'фи';
+------+
| фи |
+------+
| фи |
+------+
1 row in set (0.00 sec)

mysql> set statement character_set_client = latin5 for select 'фи';
+------+
| фи |
+------+
| фи |
+------+
1 row in set (0.00 sec)

mysql> set character_set_client = latin5;
Query OK, 0 rows affected (0.00 sec)

mysql> select 'фи';
+----------+
| �и |
+----------+
| �и |
+----------+
1 row in set (0.00 sec)

Changed in percona-server:
status: New → Confirmed
Revision history for this message
Elena Stepanova (elenst) wrote :

I'm going to reduce entropy and put all charset-related stuff here.

Same for COLLATION_CONNECTION:

MySQL [test]> set names utf8;
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> set statement collation_connection = utf8_bin for select 'a' union select 'b' union select 'A' order by 1;
+---+
| a |
+---+
| a |
| b |
+---+
2 rows in set (0.10 sec)

MySQL [test]> set collation_connection = utf8_bin;
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> select 'a' union select 'b' union select 'A' order by 1;
+---+
| a |
+---+
| A |
| a |
| b |
+---+
3 rows in set (0.00 sec)

tags: added: set-statement
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1577

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.