[MDEV-18647] Computed column names are limited to ASCII. Bug or feature? Created: 2019-02-19  Updated: 2019-05-15  Resolved: 2019-03-12

Status: Closed
Project: MariaDB Server
Component/s: Character Sets, Scripts & Clients
Affects Version/s: 10.3.12
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: VL Incans Assignee: Alexander Barkov
Resolution: Duplicate Votes: 0
Labels: None
Environment:

Host: VMWare
OS: Windows 10 Enterprise 64 bit v1809
OS Build: 17763.253

Mariadb: mysql Ver 15.1 Distrib 10.3.12-MariaDB, for Win64 (AMD64), source revision faf206a848684bc0f87c93a2b47a55063bbccc6c


Issue Links:
Duplicate
duplicates MDEV-16221 Port WL#5331: Support Unicode for Win... Closed

 Description   

When column in a query is computed by a function and is not given an alias using "AS", the column name in the results is the text of the function invocation, as in-

select count(*) from npu_codelist;
+----------+
| count(*) |
+----------+
|    26712 |
+----------+
1 row in set (0.017 sec)

I have set my installation up (after many hours of trying) to be "unicode clean" top to bottom-

show variables where variable_name like '%char%' or variable_name like '%coll%';
+--------------------------+-----------------------------------------------+
| Variable_name            | Value                                         |
+--------------------------+-----------------------------------------------+
| character_set_client     | utf8mb4                                       |
| character_set_connection | utf8mb4                                       |
| character_set_database   | utf8mb4                                       |
| character_set_filesystem | binary                                        |
| character_set_results    | utf8mb4                                       |
| character_set_server     | utf8mb4                                       |
| character_set_system     | utf8                                          |
| character_sets_dir       | C:\Program Files\MariaDB 10.3\share\charsets\ |
| collation_connection     | utf8mb4_general_ci                            |
| collation_database       | utf8mb4_general_ci                            |
| collation_server         | utf8mb4_general_ci                            |
+--------------------------+-----------------------------------------------+
11 rows in set (0.001 sec)

However I note that computed column names seem to ignore the setting of character_set_results as regards column names, these are always transformed to ASCII-

select replace('µm', 'µ', 'm');
+-------------------------+
| replace('?m', '?', 'm') |
+-------------------------+
| mm                      |
+-------------------------+
 
MariaDB [uom]> select replace('µm', 'm', 'L');
+-------------------------+
| replace('?m', 'm', 'L') |
+-------------------------+
| µL                       |
+-------------------------+

This is not desirable behaviour, because it means the meaning of the results column is ambiguous. However is it expected behaviour?



 Comments   
Comment by Alexander Barkov [ 2019-03-12 ]

Hi, which client are you using? Is it command line "mysql.exe", or something else?

Comment by VL Incans [ 2019-03-12 ]

I'm using the standard mysql.exe client from the distribution.

Comment by Alexander Barkov [ 2019-03-12 ]

mysql.exe is currently not Unicode aware and is limited to the ANSI code page, which is cp850 on a Western machine.
Try "mysql.exe --default-character-set=cp850", or configure it in my.cnf.

Note, there is MDEV-16221 to make mysql.exe Unicode aware.

Comment by VL Incans [ 2019-03-12 ]

I spent quite a bit of time grappling with the setup to get it to work with UTF-8 for data and queries, so I'm running the client in a codepage 65001 (Unicode) cmdtool. An ASCII-only client tool is a problem.

I guess I need to vote-up MDEV-16221

Thanks for the reply.

Generated at Thu Feb 08 08:45:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.