Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10723

mysql56-temporal-format=off creates incorrect innodb stats tables

Details

    Description

      mysql56-temporal-format had been disabled in MariaDB 10.1.17 environment. This seemed to work fine, but then the following errors around the innodb persistent statistics tables were observed in the MySQL error logs:

      InnoDB: Error: Column last_update in table "mysql"."innodb_table_stats" is INT UNSIGNED NOT NULL but should be BINARY(4) NOT NULL (type mismatch).
      

      I think this is related to mysql56-temporal-format=off - checking the tables I do see "MYSQL_TYPE_TIMESTAMP" rather than MYSQL_TYPE_TIMESTAMP I reenabled this option, recreated just these tables and these log messages went away and the tables are being populated as expected.

      Attachments

        Activity

          elenst Elena Stepanova added a comment - - edited

          I don't see how it's related to mysql56-temporal-format.

          This is a standard error you would get after upgrading from 10.0 to 10.1 before you run mysql_upgrade – was it what you did? The table format changed between the versions, hence the error.
          mysql_upgrade fixes it, but so does re-creating the table manually of course, which is what you've done now.

          Side question – when you say "mysql56-temporal-format had been disabled in MariaDB 10.1.17 environment", do you mean that it changed in MariaDB standard installation, or that you did it on your own in your instance? If it changed in the standard installation, which packages do you use?

          elenst Elena Stepanova added a comment - - edited I don't see how it's related to mysql56-temporal-format. This is a standard error you would get after upgrading from 10.0 to 10.1 before you run mysql_upgrade – was it what you did? The table format changed between the versions, hence the error. mysql_upgrade fixes it, but so does re-creating the table manually of course, which is what you've done now. Side question – when you say "mysql56-temporal-format had been disabled in MariaDB 10.1.17 environment" , do you mean that it changed in MariaDB standard installation, or that you did it on your own in your instance? If it changed in the standard installation, which packages do you use?
          andrew.garner Andrew Garner added a comment -

          I set mysql56_temporal_format=off explicitly. mysql_install_db was run after that point. This was all done on a fresh VM with only MariaDB 10.1.17 installed. mysql_upgrade does fix this so long as mysql56_temporal_format is reenabled.

          So, no this was not changed in a standard MariaDB installation - this was an intentional change in my instance.

          This bug report is just to note that disabling mysql56-temporal-format breaks innodb_*_stats tables if they are created while that option is in effect. This can happen by adjusting the my.cnf before the first mysql_install_db invocation, or by reimporting the mysql database (e.g. from backup) while this option is disabled.

          andrew.garner Andrew Garner added a comment - I set mysql56_temporal_format=off explicitly. mysql_install_db was run after that point. This was all done on a fresh VM with only MariaDB 10.1.17 installed. mysql_upgrade does fix this so long as mysql56_temporal_format is reenabled. So, no this was not changed in a standard MariaDB installation - this was an intentional change in my instance. This bug report is just to note that disabling mysql56-temporal-format breaks innodb_*_stats tables if they are created while that option is in effect. This can happen by adjusting the my.cnf before the first mysql_install_db invocation, or by reimporting the mysql database (e.g. from backup) while this option is disabled.

          andrew.garner, you are right, sorry, it does happen as you've described. Thanks for the report.

          (initialize a new datadir by running bootstrap with --mysql56-temporal-format=off => from now on, InnoDB complains about the wrong table structure, no matter whether the server runs with mysql56-temporal-format=off or mysql56-temporal-format=on.)

          Assigning to bar for now. Alexander, if it needs to be fixed in InnoDB (which I suspect to be the case), please re-assign.

          Additionally, the error message from InnoDB is confusing. If it wants to report data types, it should do it in server terms. last_update column is TIMESTAMP, whatever the internal representation is. If it cannot report accurate data types, better make it just complain about wrong internal structure or something like that.

          elenst Elena Stepanova added a comment - andrew.garner , you are right, sorry, it does happen as you've described. Thanks for the report. (initialize a new datadir by running bootstrap with --mysql56-temporal-format=off => from now on, InnoDB complains about the wrong table structure, no matter whether the server runs with mysql56-temporal-format=off or mysql56-temporal-format=on .) Assigning to bar for now. Alexander, if it needs to be fixed in InnoDB (which I suspect to be the case), please re-assign. Additionally, the error message from InnoDB is confusing. If it wants to report data types, it should do it in server terms. last_update column is TIMESTAMP , whatever the internal representation is. If it cannot report accurate data types, better make it just complain about wrong internal structure or something like that.

          People

            Unassigned Unassigned
            andrew.garner Andrew Garner
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.