Skip to content
  • Aditya A's avatar
    fdbdce70
    Bug #26390736 THE FIELD TABLE_NAME (VARCHAR(64)) FROM · fdbdce70
    Aditya A authored
                      MYSQL.INNODB_TABLE_STATS CAN OVERFLOW.
    
        In mysql.innodb_index_stats and mysql.innodb_table_stats
        tables the table name column didn't take into consideration
        partition names which can be more than varchar(64).
    
        FIX
        ---
        1. Changed the column length to 199 because the table name
           can contain
    
            (table_name)#P#(partition_name)#SP#(subpartition_name)
    
            with each identifier being 64 chars and taking the
            special symbolsadded to recognize it is a partitioned
            table ,the length comes out to be 199.
        2. Returning error in few cases where the length exceeds the
           file system name limit. This also fixes
           Bug#26953573 I_MAIN.PARTITION_INNODB_CRASH FAILING IN WEEKLY-5.7
        3. User need to do a mysql_upgrade to modify the length of
           the system tables.
        4. If the user doesn't run the the mysql_upgrade the fix will
           not work ,but a warning message will be generated to
            remind the user to call mysql_upgrdae.
        5. This fix is for mysql-5.7 only , since 8.0+ has already
           updated its system tables with this change.
        6. innodb_index_stats has a primary key which is defined as
           PRIMARY KEY (`database_name`,`table_name`,`index_name`,`stat_name`)
           and the PRIMARY KEY defined on innodb_table_stats is
           PRIMARY KEY (`database_name`,`table_name`)
           Since we are increasing the length of "table_name" column
           the index size  increases ,which will cross the limit of
           768 Bytes defined for a 4k page size. Innodb can usually
           support key size which is half of the page size. While
           estimating the maximum key size supported we usually take
           the case of secondary indexes ( which also contains the
           primary key) and estimate the key_length of about 1/4 of
           page size. In this case there is only primary key defined
           on these tables and innodb can support this index size.
           Therefore we have defined these two tables as system tables
           and the server whitelists them and skips the index length
           check on them.
        7. In server we have introduced a function
           ha_check_if_supported_system_table() will check if these
           tables are whitelisted ,and skip the key index length
           check.
    
        [#rb 18858 Reviewed By Deb,Dyre]
    fdbdce70
    Bug #26390736 THE FIELD TABLE_NAME (VARCHAR(64)) FROM
    Aditya A authored
                      MYSQL.INNODB_TABLE_STATS CAN OVERFLOW.
    
        In mysql.innodb_index_stats and mysql.innodb_table_stats
        tables the table name column didn't take into consideration
        partition names which can be more than varchar(64).
    
        FIX
        ---
        1. Changed the column length to 199 because the table name
           can contain
    
            (table_name)#P#(partition_name)#SP#(subpartition_name)
    
            with each identifier being 64 chars and taking the
            special symbolsadded to recognize it is a partitioned
            table ,the length comes out to be 199.
        2. Returning error in few cases where the length exceeds the
           file system name limit. This also fixes
           Bug#26953573 I_MAIN.PARTITION_INNODB_CRASH FAILING IN WEEKLY-5.7
        3. User need to do a mysql_upgrade to modify the length of
           the system tables.
        4. If the user doesn't run the the mysql_upgrade the fix will
           not work ,but a warning message will be generated to
            remind the user to call mysql_upgrdae.
        5. This fix is for mysql-5.7 only , since 8.0+ has already
           updated its system tables with this change.
        6. innodb_index_stats has a primary key which is defined as
           PRIMARY KEY (`database_name`,`table_name`,`index_name`,`stat_name`)
           and the PRIMARY KEY defined on innodb_table_stats is
           PRIMARY KEY (`database_name`,`table_name`)
           Since we are increasing the length of "table_name" column
           the index size  increases ,which will cross the limit of
           768 Bytes defined for a 4k page size. Innodb can usually
           support key size which is half of the page size. While
           estimating the maximum key size supported we usually take
           the case of secondary indexes ( which also contains the
           primary key) and estimate the key_length of about 1/4 of
           page size. In this case there is only primary key defined
           on these tables and innodb can support this index size.
           Therefore we have defined these two tables as system tables
           and the server whitelists them and skips the index length
           check on them.
        7. In server we have introduced a function
           ha_check_if_supported_system_table() will check if these
           tables are whitelisted ,and skip the key index length
           check.
    
        [#rb 18858 Reviewed By Deb,Dyre]
Loading