[MDEV-7012] SET STATEMENT character_set_client, character_set_connection, character_set_filesystem, collation_connection have no effect Created: 2014-11-02  Updated: 2015-04-07  Resolved: 2015-04-07

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: N/A
Fix Version/s: 10.1.4

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Won't Fix Votes: 0
Labels: None

Issue Links:
PartOf
is part of MDEV-6944 SQL_MODEs related to parsing are not ... Closed
Relates
relates to MDEV-5231 Per query variables from Percona Serv... Closed
relates to MDEV-6923 Testing for SET STATEMENT .. FOR (MDE... Closed

 Description   

MariaDB [test]> set names utf8;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> select 'фи';
+------+
| фи   |
+------+
| фи   |
+------+
1 row in set (0.00 sec)
 
MariaDB [test]> set statement character_set_client = latin5 for select 'фи';
+------+
| фи   |
+------+
| фи   |
+------+
1 row in set (0.00 sec)

Compare with:

MariaDB [test]> set character_set_client = latin5;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> select 'фи';
+----------+
| фи     |
+----------+
| фи     |
+----------+
1 row in set (0.00 sec)

Same for CHARACTER_SET_CONNECTION:

MariaDB [test]> set names utf8;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> select 'фи';
+------+
| фи   |
+------+
| фи   |
+------+
1 row in set (0.00 sec)
 
MariaDB [test]> set statement CHARACTER_SET_CONNECTION = latin5 for select 'фи';
+------+
| фи   |
+------+
| фи   |
+------+
1 row in set (0.01 sec)

MariaDB [test]> set character_set_connection = latin5;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> select 'фи';
+----+
| ?? |
+----+
| ?? |
+----+
1 row in set (0.00 sec)

Same for CHARACTER_SET_FILESYSTEM:

MariaDB [test]> set names utf8;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> system touch 'файл';
MariaDB [test]> create table tmp (i int);
Query OK, 0 rows affected (0.56 sec)
 
MariaDB [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

MariaDB [test]> set character_set_filesystem = latin5;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> load data local infile 'файл' into table tmp;
ERROR 2 (HY000): File '????' not found (Errcode: 2)ne

Same for COLLATION_CONNECTION:

MariaDB [test]> set names utf8;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [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.00 sec)

MariaDB [test]> set collation_connection = utf8_bin;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> select 'a' union select 'b' union select 'A' order by 1;
+---+
| a |
+---+
| A |
| a |
| b |
+---+
3 rows in set (0.00 sec)

All the same in Percona server.



 Comments   
Comment by Oleksandr Byelkin [ 2014-11-05 ]

The variables prohibited as a workaround.

Comment by Oleksandr Byelkin [ 2014-11-11 ]

Parameters set during parsing so changing variables has no effect.

Comment by Oleksandr Byelkin [ 2015-03-17 ]

revision-id: 622611bc6a9371803f349d8cf4de6538ebbcdb37
parent(s): a21ef88d2a358904f0cdf9cadc701cb263b5e317
committer: Oleksandr Byelkin
branch nick: server
timestamp: 2015-03-17 14:40:25 +0100
message:

MDEV-7012: SET STATEMENT character_set_client, character_set_connection, character_set_filesystem, collation_connection have no effect

Variables of simple SET STATEMENT set just after assigning

(changes in test suite result checked)

Comment by Oleksandr Byelkin [ 2015-04-07 ]

It is so tight connected with parser so we will not fix it (variables will be prohibited)

Generated at Thu Feb 08 07:16:17 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.