[MDEV-7375] FEDERATED + DISCOVERY can make UTF8 columns to be corrupted Created: 2014-12-25 Updated: 2023-11-28 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Federated |
| Affects Version/s: | 10.0.15 |
| Fix Version/s: | 10.4, 10.5, 10.6 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Olivier Bertrand | Assignee: | Alexander Barkov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows 7 |
||
| Issue Links: |
|
||||||||
| Description |
|
Having done on the remote server:
returns:
On the local server, a FEDERATED table to access it can be created as:
returns:
and issues on warning saying:
Note: This can be corrected by specifying the default charset of the local FEDERATED table as DEFAULT CHARSET=UTF8 or by explicitely defining the local table column not specifying its character set. But this is not clearly documented. |
| Comments |
| Comment by Elena Stepanova [ 2014-12-26 ] |
|
bar, The behavior doesn't look right to me... |
| Comment by Olivier Bertrand [ 2014-12-26 ] |
|
The explanation is that FEDERATED (and now CONNECT) set the connection charset to the default local table charset before connecting. In this case the local table charset is latin1 by default and so is the connection charset. Thus the UTF8 column is translated to latin1 on the connection and this is why it should not be specified as UTF8 on the local table. If is must remain UTF8, the local default charset must be specified to UTF8 and then the connection charset will be UTF8 and the column contains will not be translated. Note that this does not occur with CONNECT because in the discovery process, CONNECT ignores the column charset specification of the remote table, which also can be wrong in some cases. However, this shows that the whole process could be reconsidered or at least properly documented. |