Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.6.11, 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11
-
None
Description
After upgrade from Mysql 5.7 to MariaDB 10.3 then to 10.6, I'm now seeing the following error in the logs periodically:
"InnoDB: Column last_update in table mysql.innodb_table_stats is BINARY(4) NOT NULL but should be INT UNSIGNED NOT NULL"
The last_update column appears to be correctly defined (TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP).
Running mysql_upgrade does not resolve the issue,
2023-01-27 10:16:23 8756 [ERROR] InnoDB: Column last_update in table mysql.innodb_table_stats is BINARY(4) NOT NULL but should be INT UNSIGNED NOT NULL
2023-01-27 10:16:23 8756 [ERROR] InnoDB: Fetch of persistent statistics requested for table `cl`.`#sql-alter-6a27-2234` but the required system tables mysql.innodb_table_stats and mysql.innodb_index_stats are not present or have unexpected structure. Using transient stats instead.
2023-01-27 10:16:23 8756 [ERROR] InnoDB: Column last_update in table mysql.innodb_table_stats is BINARY(4) NOT NULL but should be INT UNSIGNED NOT NULL
2023-01-27 10:16:23 8756 [ERROR] InnoDB: Column last_update in table mysql.innodb_table_stats is BINARY(4) NOT NULL but should be INT UNSIGNED NOT NULL
2023-01-27 10:16:23 8756 [ERROR] InnoDB: Column last_update in table mysql.innodb_table_stats is BINARY(4) NOT NULL but should be INT UNSIGNED NOT NULL
Attachments
Issue Links
- relates to
-
MDEV-6349 innodb_table_stats/innodb_index_stats broken after upgrade from 5.6
-
- Closed
-
-
MDEV-29128 Possible table (mysql.innodb_table_stats) structure mismatch in internals
-
- Open
-
-
MDEV-30809 mysql_upgrade is not upgrading the type of last_update column for innodb_index_stats and innodb_table_stats tables
-
- Stalled
-
Thanks for the report.
First of all, the InnoDB message is really misleading, because in fact the column is TIMESTAMP, both in MySQL and MariaDB. Probably a different internal format of timestamp.
I cannot reproduce it if in the described scenario I run mysql_upgrade on 10.3 before further upgrading to 10.6; but otherwise, starting from 10.4, it is easily reproducible.
I suppose the reason is that while mysql_upgrade actually runs an unconditional ALTER on the table
even if the columns are already of the same type, in 10.3 it works via table-copy and thus upgrades it, while in 10.4+ it remains essentially a no-op.
If so, then
should help as a workaround, to get rid of the error messages. Possibly server restart will also be needed.