Bug #95620 Upgrade of help tables failed on 8.0.16
Submitted: 3 Jun 2019 17:12 Modified: 19 Jun 2019 1:50
Reporter: Andrey Shcherbakov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:8.0.16 OS:FreeBSD (11.2-RELEASE-p4)
Assigned to: CPU Architecture:x86 (amd64)

[3 Jun 2019 17:12] Andrey Shcherbakov
Description:
After upgrade from 8.0.14 to 8.0.16 with disabled autocommit get error "Upgrade of help tables failed" during server startup.

How to repeat:
Add to my.cnf lines:
autocommit = OFF 
completion_type = CHAIN 

Upgraded from 8.0.14 to 8.0.16 

Start mysql server and get error in log: 
2019-05-31T21:04:59.441262Z 4 [ERROR] [MY-013400] [Server] Upgrade of help tables failed. 
2019-05-31T21:04:59.446022Z 0 [ERROR] [MY-013380] [Server] Failed to upgrade server. 
2019-05-31T21:04:59.446471Z 0 [ERROR] [MY-010119] [Server] Aborting 

Disabling this rows from my.cnf fixes problem.

Suggested fix:
I think it will be best to make 2 fixes:
1. Allow to upgrade even if autocommiit is off
2. Add to log more verbose information (sql code & message) about error instead of common "Upgrade of help tables failed".
[4 Jun 2019 6:42] MySQL Verification Team
Hello Andrey Shcherbakov,

Thank you for the report.

regards,
Umesh
[4 Jun 2019 10:00] Sivert Sørumgård
Posted by developer:
 
The combination of autocommit=0 and completion_type=CHAIN makes a new transaction be started implicitly on commit. Before upgrading help tables, the last action during upgrade from 8.0.14 to 8.0.16, before upgrading the help tables, is to commit the updates to the SRS meta data. Thus, a new transaction is active while the statements for upgrading the help tables are executed. The second statement is 'SET sql_log_bin = 0', which fails since this is not allowed in the scope of an active transaction.
[19 Jun 2019 1:50] Paul DuBois
Posted by developer:
 
Fixed in 8.0.18.

During upgrade operations, upgrades of the help tables failed if
autocommit was disabled.
[19 Jun 2019 13:24] Paul DuBois
Posted by developer:
 
Fixed in 8.0.17.