[MDEV-33102] incorrect charsetnr for utf8mb4 Created: 2023-12-21 Updated: 2024-01-10 Resolved: 2024-01-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Character Sets, Protocol |
| Affects Version/s: | 10.11.5, 10.11.6 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Kjell Rilbe | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows Server 2019 |
||
| Description |
|
We're using a software that supports MySQL via its C connector library, version 5.7.25. We are using MariaDB version 10.11.6 but saw the problem also on 10.11.5. We have a table with several columns of type utf8mb4. The software retrieves column information using the C connector function mysql_fetch_field. For the utf8mb4 columns it returns MYSQL_FIELD.charsetnr == 33. This is apparently supposed to be the collation id, which they then lookup in INFORMATION_SCHEMA.COLLATIONS. The problem is that 33 is the id for collation utf8mb3_general_ci, i.e. charset utf8mb3, which is incorrect. Correct value would, in their tests with ci collation, be id 45, collation utf8mb4_general_ci. I'm afraid I know too little to be able to determine if this is even supposed to work, but I was under the impression that MariaDB is intended to be a fully compatible replacement to MySQL at the API level. I also know too little to be able to determine exactly where the problem lies (which component), but inspection the information in the information_schema tables, everything looks correct there, so I assume there's some problem at the api level. |
| Comments |
| Comment by Sergei Golubchik [ 2024-01-03 ] |
|
can you produce a small program that demonstrates the problem? Just mysql_real_connect() / mysql_real_query() / mysql_use_result() (or mysql_store_result()) / check metadata, e.g. printf(charsetnr). |
| Comment by Thomas Almqvist [ 2024-01-10 ] |
|
The problem turned out to be due to other reasons, so this case ( |
| Comment by Sergei Golubchik [ 2024-01-10 ] |
|
Thanks! |