Bug #88040 upgrade to 8.0 fails when generated columns contained deprecated functions
Submitted: 10 Oct 2017 7:24 Modified: 26 Oct 2017 11:50
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Data Dictionary Severity:S3 (Non-critical)
Version:8.0.3 OS:Any
Assigned to: CPU Architecture:Any

[10 Oct 2017 7:24] Shane Bester
Description:
Starting up 8.0 on a 5.7 data directory failed with a 
mysterious "No database selected" error.

[Note] [003960] Created Data Dictionary for upgrade
[ERROR] [001046] mysqld-debug.exe: No database selected
[ERROR] [004387] Error in processing generated columns
[ERROR] [003636] Failed to Populate DD tables.
[ERROR] [003742] Aborting

Is failing to startup the best solution here?

How to repeat:
On 5.7:

drop table if exists t1;
create table t1(b char(255) not null, c blob as (des_encrypt(b)))engine=innodb;

Shutdown 5.7 and startup 8.0 on datadir.

Suggested fix:
This bug is going away in 8.0->Next versions because of the fix for:

https://bugs.mysql.com/bug.php?id=86712
(Virtual columns allow deprecated des_encrypt function to be used)

But that doesn't solve the current 5.7->8.0 problem.
[10 Oct 2017 7:40] MySQL Verification Team
IF you generated columns used the bitwise | operator, there have been some changes.  The error might look like:

[ERROR] [001210] E:\git\mysql-8.0\bld\runtime_output_directory\Debug\mysqld-debug.exe: Incorrect arguments to |
[ERROR] [004387] Error in processing generated columns
[ERROR] [003636] Failed to Populate DD tables.
[ERROR] [003742] Aborting
[26 Oct 2017 11:50] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 8.0.4, 9.0.0 release, and here's the changelog entry:

 A virtual column definition that included a function removed in MySQL 8.0
caused startup to fail with a No database selected error when starting the
MySQL 8.0 server on a MySQL 5.7 data directory.