Bug #97855 Upgrade checker can't check removed system variable correctly
Submitted: 3 Dec 2019 2:05 Modified: 4 Mar 2020 16:35
Reporter: Yoshiaki Yamasaki Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Document Store: MySQL Shell Severity:S3 (Non-critical)
Version:8.0.18 OS:Any
Assigned to: CPU Architecture:Any

[3 Dec 2019 2:05] Yoshiaki Yamasaki
Description:
When we set system variable like 'query-cache-type' in my.cnf, upgrade checker can't check removed system variables.

How to repeat:
1. setting "query-cache-type=ON" in my.cnf with MySQL 5.7

2. executing upgrade checker with "configPath" option.

ex) 
---------------------------------------------------------------
$ cat my.cnf 
[mysqld]
<<snip>>
query-cache-type=ON

$ mysql -u root -p -h localhost
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.21-log MySQL Community Server (GPL)
<<snip>>
mysql> show variables like 'query_cache_type';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| query_cache_type | ON    |
+------------------+-------+
1 row in set (0.00 sec)

mysql> exit
Bye
$ mysqlsh
MySQL Shell 8.0.18

Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.

Type '\help' or '\?' for help; '\quit' to exit.
 MySQL  JS > util.checkForServerUpgrade("root@localhost:3306",{"targetVersion":"8.0.18", "configPath":"/usr/local/mysql/my.cnf"
})
Please provide the password for 'root@localhost:3306': ****
Save password for 'root@localhost:3306'? [Y]es/[N]o/Ne[v]er (default No): 
The MySQL server at localhost:3306, version 5.7.21-log - MySQL Community Server
(GPL), will now be checked for compatibility issues for upgrade to MySQL
8.0.18...
<<snip>>
15) Removed system variables
  No issues found
<<snip>>
---------------------------------------------------------------

Suggested fix:
Even system variable set with "-"(not "_"), check removed system variable.
[3 Dec 2019 5:47] MySQL Verification Team
Hello Yoshiaki-San,

Thank you for the report.

Thanks,
Umesh
[4 Dec 2019 23:34] Yoshiaki Yamasaki
A similar problem occurred with "System variables with new default values".

[Note]
$ cat my.cnf
<<snip>>
innodb-max-dirty-pages-pct=80

$ mysql -u root -p -e "show variables like 'innodb_max_dirty_pages_pct'"
Enter password: 
+----------------------------+-----------+
| Variable_name              | Value     |
+----------------------------+-----------+
| innodb_max_dirty_pages_pct | 80.000000 |
+----------------------------+-----------+

$ mysqlsh
<<snip>>
 MySQL  JS > util.checkForServerUpgrade("root@localhost:3306",{"targetVersion":"8.0.18", "configPath":"/usr/local/mysql/my.cnf"
})
Please provide the password for 'root@localhost:3306': ****
Save password for 'root@localhost:3306'? [Y]es/[N]o/Ne[v]er (default No): 
<<snip>>

16) System variables with new default values
  Warning: Following system variables that are not defined in your
    configuration file will have new default values. Please review if you rely on
    their current values and if so define them before performing upgrade.
  More information:
    https://mysqlserverteam.com/new-defaults-in-mysql-8-0/

<<snip>>
  innodb_max_dirty_pages_pct - default value will change from 75 (%)  90 (%)
<<snip>>
[4 Mar 2020 16:35] Margaret Fisher
Posted by developer:
 
Changelog entry added for MySQL Shell 8.0.20:

MySQL Shell's upgrade checker utility checkForServerUpgrade() did not flag removed system variables that were specified using hyphens rather than underscores. The utility also now continues with its sequence of checks if a permissions check cannot be performed at the required time.