Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 10.0.15, 10.0.16
-
Fix Version/s: 10.0.18
-
Component/s: Storage Engine - Connect
-
Labels:None
-
Environment:CentOS, MariaDB 10.0.16, Connect Engine 1.3
Description
I am trying to replicate example how to create pivot table like from MariaDB documentation: https://mariadb.com/kb/en/mariadb/documentation/storage-engines/connect/connect-table-types/connect-table-types-pivot-table-type/
Everything works as fine as explained.
However, if I replace in source table fields 'Beer' with '啤酒‘ and 'Car' with 'машина‘, I get the following CREATE TABLE statement:
CREATE TABLE `pivex_cn`
(
`who` varchar(135) NOT NULL,
`week` int(11) NOT NULL,
`啤酒` decimal(6,2) NOT NULL `FLAG`=1,
`Food` decimal(6,2) NOT NULL `FLAG`=1,
`машина` decimal(6,2) NOT NULL `FLAG`=1
)
ENGINE=CONNECT DEFAULT CHARSET=utf8 `TABLE_TYPE`='pivot' `TABNAME`='topivot_cn'
Which then in SELECT * FROM pivex_cn; gives the following error: "Error Code: 1296. Got error 122 'Cannot find matching column' from CONNECT"
All tables are using utf8 as default. I also tried uft8mb4, the same result ![]()
Bug was discovered first at 10.0.15 MariaDB version, but reproduced in 10.0.16 as well..
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
When you say that in the original data file you replaced 'Car' with 'машина‘ I suppose it is coded in UTF8 in the data file.
The problem is that MariaDB unconditionally converts column names into UTF8. Therefore the corresponding column should be named literally, not by its UTF8 representation to avoid a double conversion. Unfortunately trying to create the pivot table by:
CREATE TABLE `pivex_cn` ( `who` varchar(135) NOT NULL, `week` int(11) NOT NULL, `Beer` decimal(6,2) NOT NULL `FLAG`=1, `Food` decimal(6,2) NOT NULL `FLAG`=1, `машина` decimal(6,2) NOT NULL `FLAG`=1 ) ENGINE=CONNECT DEFAULT CHARSET=utf8 `TABLE_TYPE`='pivot' `TABNAME`='topivot_cn';fails with the MariaDB message (1166) Incorrect column name ''.
That's unfortunate because for instance, replacing Beer with UTF8 Bière in the data file I can create the table:
CREATE TABLE `pivex_fr` ( `who` varchar(135) NOT NULL, `week` int(11) NOT NULL, `Bière` decimal(6,2) NOT NULL `FLAG`=1, `Food` decimal(6,2) NOT NULL `FLAG`=1, `Car` decimal(6,2) NOT NULL `FLAG`=1 ) ENGINE=CONNECT TABLE_TYPE='pivot' `TABNAME`='topivot_fr';It is accepted and works perfectly.
The issue is why is MariaDB refusing the create table with a quoted Cyrillic column name.