Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.0.4
    • Labels:
      None
    • Global Rank:
      3372

      Description

      Tried MySQL 5.6.5, 5.6.10, 5.6.12, errors are different, but the result is the same. The example below is for MySQL 5.6.10.

      • create a new datadir (system tables) in MySQL 5.6;
      • try to start MariaDB 10.0 on this datadir
        => error log shows errors:
        130726 17:30:08 [ERROR] Cannot open mysql.event
        130726 17:30:08 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
        130726 17:30:08 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist
        

      Run mysql_upgrade, it throws errors and fails

      Phase 1/3: Fixing table and database names
      Phase 2/3: Checking and upgrading tables
      Processing databases
      information_schema
      mysql
      mysql.columns_priv                                 OK
      mysql.db                                           OK
      mysql.event
      Error    : Incorrect key file for table 'event'; try to repair it
      error    : Corrupt
      mysql.func                                         OK
      mysql.help_category                                OK
      mysql.help_keyword                                 OK
      mysql.help_relation                                OK
      mysql.help_topic                                   OK
      mysql.innodb_index_stats                           OK
      mysql.innodb_table_stats                           OK
      mysql.ndb_binlog_index                             OK
      mysql.plugin                                       OK
      mysql.proc
      Error    : Incorrect key file for table 'proc'; try to repair it
      error    : Corrupt
      mysql.procs_priv                                   OK
      mysql.proxies_priv                                 OK
      mysql.servers                                      OK
      mysql.slave_master_info                            OK
      mysql.slave_relay_log_info                         OK
      mysql.slave_worker_info                            OK
      mysql.tables_priv                                  OK
      mysql.time_zone                                    OK
      mysql.time_zone_leap_second                        OK
      mysql.time_zone_name                               OK
      mysql.time_zone_transition                         OK
      mysql.time_zone_transition_type                    OK
      mysql.user                                         OK
      performance_schema
      test
      tmp
      
      Repairing tables
      mysql.event
      Error    : Incorrect key file for table 'event'; try to repair it
      error    : Corrupt
      mysql.proc
      Error    : Incorrect key file for table 'proc'; try to repair it
      error    : Corrupt
      Phase 3/3: Running 'mysql_fix_privilege_tables'...
      ERROR 1034 (HY000) at line 23: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 35: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 358: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 403: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 404: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 410: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 413: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 415: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 420: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 422: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 425: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 427: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 432: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 434: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 437: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 439: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 444: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 449: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 451: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 452: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 461: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 462: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 463: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 464: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 498: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 499: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 500: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 501: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 502: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 504: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 507: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 509: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 512: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 514: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 517: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 519: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 521: Incorrect key file for table 'event'; try to repair it
      ERROR 1034 (HY000) at line 556: Incorrect key file for table 'proc'; try to repair it
      ERROR 1034 (HY000) at line 557: Incorrect key file for table 'event'; try to repair it
      ERROR 1050 (42S01) at line 576: Table 'cond_instances' already exists
      ERROR 1050 (42S01) at line 601: Table 'events_waits_current' already exists
      ERROR 1050 (42S01) at line 626: Table 'events_waits_history' already exists
      ERROR 1050 (42S01) at line 651: Table 'events_waits_history_long' already exists
      ERROR 1050 (42S01) at line 664: Table 'events_waits_summary_by_instance' already exists
      ERROR 1050 (42S01) at line 677: Table 'events_waits_summary_by_host_by_event_name' already exists
      ERROR 1050 (42S01) at line 690: Table 'events_waits_summary_by_user_by_event_name' already exists
      ERROR 1050 (42S01) at line 704: Table 'events_waits_summary_by_account_by_event_name' already exists
      ERROR 1050 (42S01) at line 717: Table 'events_waits_summary_by_thread_by_event_name' already exists
      ERROR 1050 (42S01) at line 729: Table 'events_waits_summary_global_by_event_name' already exists
      ERROR 1050 (42S01) at line 738: Table 'file_instances' already exists
      ERROR 1050 (42S01) at line 767: Table 'file_summary_by_event_name' already exists
      ERROR 1050 (42S01) at line 798: Table 'file_summary_by_instance' already exists
      ERROR 1050 (42S01) at line 811: Table 'socket_instances' already exists
      ERROR 1050 (42S01) at line 841: Table 'socket_summary_by_instance' already exists
      ERROR 1050 (42S01) at line 870: Table 'socket_summary_by_event_name' already exists
      ERROR 1050 (42S01) at line 905: Table 'host_cache' already exists
      ERROR 1050 (42S01) at line 914: Table 'mutex_instances' already exists
      ERROR 1050 (42S01) at line 928: Table 'objects_summary_global_by_type' already exists
      ERROR 1050 (42S01) at line 938: Table 'performance_timers' already exists
      ERROR 1050 (42S01) at line 948: Table 'rwlock_instances' already exists
      ERROR 1050 (42S01) at line 957: Table 'setup_actors' already exists
      ERROR 1050 (42S01) at line 965: Table 'setup_consumers' already exists
      ERROR 1050 (42S01) at line 974: Table 'setup_instruments' already exists
      ERROR 1050 (42S01) at line 985: Table 'setup_objects' already exists
      ERROR 1050 (42S01) at line 993: Table 'setup_timers' already exists
      ERROR 1050 (42S01) at line 1038: Table 'table_io_waits_summary_by_index_usage' already exists
      ERROR 1050 (42S01) at line 1082: Table 'table_io_waits_summary_by_table' already exists
      ERROR 1050 (42S01) at line 1161: Table 'table_lock_waits_summary_by_table' already exists
      ERROR 1050 (42S01) at line 1181: Table 'threads' already exists
      ERROR 1050 (42S01) at line 1197: Table 'events_stages_current' already exists
      ERROR 1050 (42S01) at line 1213: Table 'events_stages_history' already exists
      ERROR 1050 (42S01) at line 1229: Table 'events_stages_history_long' already exists
      ERROR 1050 (42S01) at line 1242: Table 'events_stages_summary_by_thread_by_event_name' already exists
      ERROR 1050 (42S01) at line 1255: Table 'events_stages_summary_by_host_by_event_name' already exists
      ERROR 1050 (42S01) at line 1268: Table 'events_stages_summary_by_user_by_event_name' already exists
      ERROR 1050 (42S01) at line 1282: Table 'events_stages_summary_by_account_by_event_name' already exists
      ERROR 1050 (42S01) at line 1294: Table 'events_stages_summary_global_by_event_name' already exists
      ERROR 1050 (42S01) at line 1340: Table 'events_statements_current' already exists
      ERROR 1050 (42S01) at line 1386: Table 'events_statements_history' already exists
      ERROR 1050 (42S01) at line 1432: Table 'events_statements_history_long' already exists
      ERROR 1050 (42S01) at line 1464: Table 'events_statements_summary_by_thread_by_event_name' already exists
      ERROR 1050 (42S01) at line 1496: Table 'events_statements_summary_by_host_by_event_name' already exists
      ERROR 1050 (42S01) at line 1528: Table 'events_statements_summary_by_user_by_event_name' already exists
      ERROR 1050 (42S01) at line 1561: Table 'events_statements_summary_by_account_by_event_name' already exists
      ERROR 1050 (42S01) at line 1592: Table 'events_statements_summary_global_by_event_name' already exists
      ERROR 1050 (42S01) at line 1601: Table 'hosts' already exists
      ERROR 1050 (42S01) at line 1610: Table 'users' already exists
      ERROR 1050 (42S01) at line 1620: Table 'accounts' already exists
      ERROR 1050 (42S01) at line 1655: Table 'events_statements_summary_by_digest' already exists
      ERROR 1050 (42S01) at line 1665: Table 'session_connect_attrs' already exists
      ERROR 1050 (42S01) at line 1671: Table 'session_account_connect_attrs' already exists
      FATAL ERROR: Upgrade failed
      

      The event table is still broken:

      MariaDB [test]> check table mysql.event;
      +-------------+-------+----------+--------------------------------------------------------+
      | Table       | Op    | Msg_type | Msg_text                                               |
      +-------------+-------+----------+--------------------------------------------------------+
      | mysql.event | check | Error    | Incorrect key file for table 'event'; try to repair it |
      | mysql.event | check | error    | Corrupt                                                |
      +-------------+-------+----------+--------------------------------------------------------+
      2 rows in set (0.01 sec)
      
      MariaDB [test]> repair table mysql.event;
      +-------------+--------+----------+--------------------------------------------------------+
      | Table       | Op     | Msg_type | Msg_text                                               |
      +-------------+--------+----------+--------------------------------------------------------+
      | mysql.event | repair | Error    | Incorrect key file for table 'event'; try to repair it |
      | mysql.event | repair | error    | Corrupt                                                |
      +-------------+--------+----------+--------------------------------------------------------+
      2 rows in set (0.00 sec)
      

      bzr version-info

      revision-id: holyfoot@askmonty.org-20130726110356-9s17c1kw558ls14a
      revno: 3792
      branch-nick: 10.0-serg
      

        Activity

        Hide
        Alexander Barkov added a comment -

        The problems happens because MySQL-5.6.4+ erroneously marks new TIMESTAMP
        (Field_timestampf) as FIELD_SKIP_PRESPACE, while MariaDB expects
        TIMESTAMP to be FIELD_NORMAL. Therefore, check_definition() fails
        and a table cannot be open.

        The problem happens only on tables having the HA_OPTION_PACK_RECORD option set.

        Show
        Alexander Barkov added a comment - The problems happens because MySQL-5.6.4+ erroneously marks new TIMESTAMP (Field_timestampf) as FIELD_SKIP_PRESPACE, while MariaDB expects TIMESTAMP to be FIELD_NORMAL. Therefore, check_definition() fails and a table cannot be open. The problem happens only on tables having the HA_OPTION_PACK_RECORD option set.
        Hide
        Alexander Barkov added a comment -

        Pushed into 10.0-serg.

        Show
        Alexander Barkov added a comment - Pushed into 10.0-serg.

          People

          • Assignee:
            Alexander Barkov
            Reporter:
            Elena Stepanova
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: