Bug #83925 DB collation changed to default after upgrade
Submitted: 23 Nov 2016 7:40 Modified: 5 Jan 2017 18:23
Reporter: Abhishek Ranjan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Data Dictionary Severity:S3 (Non-critical)
Version:8.0.1 OS:Any
Assigned to: CPU Architecture:Any

[23 Nov 2016 7:40] Abhishek Ranjan
Description:
The character set and collation mentioned in db.opt file is NOT used and
default character set is always used while upgrading schema.

How to repeat:
i> Initialize a database using 5.7 server
ii> Start 5.7 server on the data directory and create
    a few databases using non default collation

    create database db_koi8 character set='koi8r' collate='koi8r_general_ci' ;
    create database db_big5 collate='big5_bin';

iii> Show shutdown 5.7 server
iv> Start 8.0 server on same data directory
v>  Execute
    show create database db_koi8r;
    SELECT * from information_schema.schemata;

Observe the default character set name and collation name.
    

Suggested fix:
Correct default character set and collation name should be
upgraded to dictionary from db.opt file.
[27 Nov 2016 9:20] Simon Mudd
Related to: bug#83461
[5 Jan 2017 18:23] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 8.0.1 release, and here's the changelog entry:

The default character set and collation were used instead of the
character set and collation defined in db.opt file when upgrading the
schema from MySQL 5.7 to MySQL 8.0.
[9 Jan 2017 7:19] Simon Mudd
Thanks. That's good to see this fix as it caused me a few breakages on some machines, and that should go away now.