[MDEV-30809] mysql_upgrade is not upgrading the type of last_update column for innodb_index_stats and innodb_table_stats tables Created: 2023-03-08 Updated: 2023-11-30 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.6.11 |
| Fix Version/s: | 10.4, 10.6, 10.11 |
| Type: | Bug | Priority: | Major |
| Reporter: | Christian Gonzalez | Assignee: | Alexander Barkov |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | innodb | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
NOTE: The information below will refer only to innodb_table_stats table for simplicity but it can be reproduced exactly the same way for innodb_index_stats table. Also, this was reproduced using MySQL 5.7.38 and MariaDB 10.6.11 version but other versions could be affected by this. After upgrading a fresh installed DB without any changes from MySQL 5.7.38 to MariaDB 10.6.11 (including running mysql_upgrade tool), the server is printing the following errors:
As described here by marc_r in
The PRTYPE has a different value for a fresh MariaDB 10.6.11 installation:
Looking at the code, it seems that scripts/mysql_system_tables_fix.sql already contains changes to address this problem:
But the alter table is not having any effect, I have tried running the statement manually having the same result. The output of DESCRIBE mysql.innodb_table_stats; shows the same before and after running mysql_upgrade and the only two ways I've found to fix the PRTYPE is either running optimize table mysql.innodb_table_stats; as described at marc_r comment, which results in a table rebuild, or dumping and restoring the database. This makes me thing that the issue is only related with the specific PRTYPE field not being updated and once the table is recreated the right PRTYPE value is used. |
| Comments |
| Comment by Otto Kekäläinen [ 2023-03-09 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The same error message Error: Column last_update in table "mysql"."innodb_table_stats" is BINARY(4) NOT NULL is also in The issue MDEV-27044 is about upgrade test being unstable and hitting this (open since 10.6 was new) and MDEV-27517 is about upgrade from MySQL 5.7 leaking strings and resulting in (false?) errors about mysql.proc not being updated and the need to run mariadb-upgrade. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-03-09 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
otto, thank you for your comment. Based on a comment in | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2023-03-18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
PR pending review at https://github.com/MariaDB/server/pull/2555 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2023-03-21 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I provided some feedback in | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-11-30 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|