[MDEV-17056] mysqlcheck.exe skips geneal_log and slow_log Created: 2018-08-24  Updated: 2018-08-24

Status: Confirmed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3
Fix Version/s: 5.5

Type: Bug Priority: Minor
Reporter: suyecufi Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I got the usual error in case of corrupted table:
[ERROR] mysqld.exe: Table 'general_log' is marked as crashed and should be repaired.
The same on slow_log

If I run mysqlcheck --repair --all-databases -u root -p I get the following list of checked tables:
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
mysql.servers OK
mysql.table_stats 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

As you can see the problem is that general_log and slow_log are skipped (are not present in the list) and are not repaired.
I've to manually run "repair table general_log; repair table slow_log;" to get these tables repaired.

Tested version: 10.2.14 and 10.3.9



 Comments   
Comment by Alice Sherepa [ 2018-08-24 ]

Thanks for the report!
Reproducible as described, tried on 5.5.61 and 10.3.9

MariaDB [test]> select * from mysql.general_log;
ERROR 1194 (HY000): Table 'general_log' is marked as crashed and should be repaired
MariaDB [test]> \! /5.5.61/bin/mysqlcheck --repair  -u root --port=3312 mysql
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.servers                                      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
 
MariaDB [test]> select * from mysql.general_log;
ERROR 1194 (HY000): Table 'general_log' is marked as crashed and should be repaired
 
MariaDB [test]> \! /5.5.61/bin/mysqlcheck --repair  -u root --port=3312 mysql general_log
mysql.general_log
Warning  : Incorrect integer value: 'Query' for column 'server_id' at row 1
status   : OK
 
MariaDB [test]> select * from mysql.general_log;
+----------------------------+---------------------------+-----------+-----------+--------------+---------------------------------+
| event_time                 | user_host                 | thread_id | server_id | command_type | argument                        |
+----------------------------+---------------------------+-----------+-----------+--------------+---------------------------------+
| 2018-08-24 15:37:54.836798 | root[root] @ localhost [] |         4 |         6 | Quit         |                                 |
| 2018-08-24 15:37:58.920237 | root[root] @ localhost [] |         2 |         6 | Query        | select * from mysql.general_log |
+----------------------------+---------------------------+-----------+-----------+--------------+---------------------------------+
2 rows in set (0.00 sec)

Generated at Thu Feb 08 08:33:35 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.