[MDEV-29128] Possible table (mysql.innodb_table_stats) structure mismatch in internals Created: 2020-02-10  Updated: 2023-09-19

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: 10.3

Type: Bug Priority: Minor
Reporter: Sergii Gulyk Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Running mariadb as a service on Windows machine (7-10, also server versions)


Attachments: Text File QueryInternalsResult.txt    
Issue Links:
Relates
relates to MDEV-27044 Test main.mysql_upgrade seems unstable Open
relates to MDEV-27517 mariadb-upgrade from MySQL 5.7 pollut... Open
relates to MDEV-30809 mysql_upgrade is not upgrading the ty... Stalled

 Description   

We have got datafiles folder from the customer, so I have no steps for reproducing this situation. However, let's assume that we want to get out of it somehow.

Please see results of two queries in the attachment. I would like to highlight difference in
from information_schema.innodb_sys_columns

*************************** 2. row ***************************
    NAME: mysql/innodb_table_stats
TABLE_ID: 15
    NAME: table_name
     POS: 1
   MTYPE: 12
  PRTYPE: 5439759
     LEN: *192*

from information_schema.columns

*************************** 2. row ***************************
           TABLE_CATALOG: def
            TABLE_SCHEMA: mysql
              TABLE_NAME: innodb_table_stats
             COLUMN_NAME: table_name
        ORDINAL_POSITION: 2
          COLUMN_DEFAULT: NULL
             IS_NULLABLE: NO
               DATA_TYPE: varchar
CHARACTER_MAXIMUM_LENGTH: 199
  CHARACTER_OCTET_LENGTH: *597*
       NUMERIC_PRECISION: NULL
           NUMERIC_SCALE: NULL
....
             COLUMN_TYPE: varchar(199)
....
   GENERATION_EXPRESSION: NULL

Somehow we managed to have column length updated in information_schema.columns (597 bytes length), but not in information_schema.innodb_sys_columns (192 bytes length).

mysql_upgrade reports that mysql.innodb_table_stats as well as mysql.innodb_index_stats are up to date, while customer continue getting

2020-02-10 14:20:33 8 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name.  Please run mysql_upgrade
2020-02-10 14:20:33 8 [ERROR] InnoDB: Column last_update in table `mysql`.`innodb_table_stats` is INT UNSIGNED NOT NULL but should be BINARY(4) NOT NULL (type mismatch).

last_update type is also wrong, you can see it the attached file, but it is not that obvious as string length difference.

I've prepared archive of the internals, but it is 75Mb and I cannot attach it here.



 Comments   
Comment by Sergii Gulyk [ 2020-02-10 ]

Reproduces on 10.3.12 and latest built from sources 10.3.21

Comment by Roman [ 2020-03-06 ]

Greetings,
Are you sure you want to create the issue in the ColumnStore queue?

Comment by Sergii Gulyk [ 2020-03-06 ]

Hi Roman,

No, I definitely did not want to.
Only now realized that it is in ColumnStore.
The reason might be my inability to find the right project, leaving field empty and automatic assignment of the first project in the list.

Could you please move the issue where appropriate?

Comment by Roman [ 2022-07-18 ]

danblack Could you plz move this issue back to the MDEV queue?

Generated at Thu Feb 08 10:06:07 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.