[MDEV-30086] Character set 'utf8' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file Created: 2022-11-24  Updated: 2023-04-07  Resolved: 2023-01-22

Status: Closed
Project: MariaDB Server
Component/s: Character Sets
Affects Version/s: 10.6.11
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Mircea Brincovean Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: None
Environment:

Ubuntu 22.04


Issue Links:
Blocks
is blocked by MDEV-31021 Character set 'utf8' is not a compile... Closed
Relates
relates to MDEV-8334 Rename utf8 to utf8mb3 Closed

 Description   

From the change log for 10.6.11 :

The utf8 character set (and related collations) is now by default an alias for utf8mb3 rather than the other way around. It can be set to imply utf8mb4 by changing the value of the old_mode system variable (MDEV-8334)

The alias for charset utf8mb3 is set to utf-8 but the old charset name was utf8 (without -)

From /usr/share/mysql/charsets/Index.xml
<charset name="utf8mb3">
<family>Unicode</family>
<description>UTF-8 Unicode</description>
<alias>utf-8</alias>
<alias>utf8</alias> #missing after the update



 Comments   
Comment by Sergei Golubchik [ 2022-11-27 ]

do you get an error? where? how?

Comment by Neven Ivanov [ 2023-03-14 ]

Hi,
Simple perl script to test the problem is as follows:

#!/usr/bin/perl
 
use DBI;
 
 
### prior to upgrade to mariadb 106 both lines worked fine because charset utf8 has alias utf-8 in /usr/share/mysql/charsets/Index.xml 
### now ( after upgrade to 10.6 ) the charset is named utf8mb3 and has alias utf-8 in /usr/share/mysql/charsets/Index.xml so utf8 charset used in legacy code will not work 
print "TEST WITH utf8 charset:\n\n"; 
my $dbh = DBI->connect("dbi:mysql:database=testdb;host=127.0.0.1", testuser, testpw,{ mysql_enable_utf8 => 1}) || $! ;
print "\nTEST WITH utf-8 charset:\n\n"; 
my $dbh = DBI->connect("dbi:mysql:database=testdb;host=127.0.0.1", testuser, testpw,{ mysql_enable_utf-8 => 1}) || $! ;

usage: put code in test_utf8_charset.pl and run:

perl test_utf8_charset.pl

Credentials are fake and non working ( error for utf8 is present before error for wrong credentials ).

The credentials used in example are not actual so no security risk is present.

Tested on Centos 7 with MariaDB 10.6.12
Regards
Neven Ivanov

Generated at Thu Feb 08 10:13:33 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.