Bug #30487 mysql_upgrade mislead. errors / mysqlcheck 'You can't use locks with log table.'

Submitted: 18 Aug 2007 1:32 Modified: 27 Aug 2007 9:27
Reporter: Omer Barnir (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.1.21,5.5.0m2 OS:Any
Assigned to: CPU Architecture:Any
Tags: pushbuild, sporadic, test failure

[18 Aug 2007 1:32] Omer Barnir
Description:
When upgrading from 5.0 to 5.1 the user s required to run 'mysql_upgrade' in order to check and update the system tables.
mysql_upgrade calls mysql_check (that checks that tables are ok) and then calls mysql_fix_privileges_tables.

During the initial run, if the server is started with the --output=table option mysql_check reports errors related to 'mysql.general_log' not being present 

omer@linux:~/beta-5.1.21/mysql-test> ../bin/mysql_upgrade --datadir=/tmp/omer_var/master-data --basedir=home/omer/beta-5.1.21 --force --socket=/tmp/omer_var/tmp/master.sock --port=9306 --user=root
Looking for 'mysql' in: /home/omer/beta-5.1.21/bin/mysql
Looking for 'mysqlcheck' in: /home/omer/beta-5.1.21/bin/mysqlcheck
Running 'mysqlcheck'...
mysql.columns_priv
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.db
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.func
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.help_category
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.help_keyword
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.help_relation
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.help_topic
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.host
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.proc
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.procs_priv
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.tables_priv
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.time_zone
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.time_zone_leap_second
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.time_zone_name
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.time_zone_transition
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.time_zone_transition_type
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
mysql.user
Error    : Table 'mysql.general_log' doesn't exist
status   : OK
Running 'mysql_fix_privilege_tables'...
OK
omer@linux:~/beta-5.1.21/mysql-test>

A second run will not report any errors (since now the table already exists (created while running 'mysql_fix_privilege_tables' in the first run)

omer@linux:~/beta-5.1.21/mysql-test>../bin/mysql_upgrade --datadir=/tmp/omer_var/master-data --basedir=home/omer/beta-5.1.21 --force --socket=/tmp/omer_var/tmp/master.sock --port=9306 --user=root
Looking for 'mysql' in: /home/omer/beta-5.1.21/bin/mysql
Looking for 'mysqlcheck' in: /home/omer/beta-5.1.21/bin/mysqlcheck
Running 'mysqlcheck'...
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.general_log
Error    : You can't use locks with log tables.
status   : 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.servers                                      OK
mysql.slow_log
Error    : You can't use locks with log tables.
status   : 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
Running 'mysql_fix_privilege_tables'...
OK
omer@linux:~/beta-5.1.21/mysql-test>

How to repeat:
1) start a 5.0 system
2) Stop the system and start a 5.1 system pointing to the same database 
   (make sure the server is started with --log-output=table (or file,table)
3) Run the "mysql_upgrade" command

Suggested fix:
This either needs to be fixed or documented to the users that the above error while running mysql_upgrade (when upgrading from a 5.0 or previous system) is harmless. Otherwise users might think there is something wrong with their upgrade
[27 Aug 2007 9:27] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/33134

ChangeSet@1.2572, 2007-08-27 11:27:03+02:00, msvensson@pilot.(none) +1 -0
  Bug#30487 mysql_upgrade reports misleading errors
   - Update result file to include these "misleading errors", better to 
  run mysql_upgrade with them than not at all.
[4 Sep 2007 17:11] Bugs System
Pushed into 5.1.23-beta
[5 Jan 2010 9:14] Roel Van de Paar
Just had this on 5.5.0m2:

./mysqlcheck -uroot --check --all-databases --auto-repair
[...]
mysql.general_log
Error    : You can't use locks with log tables.
status   : 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.servers                                      OK
mysql.slow_log
Error    : You can't use locks with log tables.
status   : OK
[...]

Any plans to fix?
[5 Aug 2010 9:19] Sasi Levi
Happened to me on MySQL 5.1.49.
[2 Sep 2010 18:28] Quanah Gibson-Mount
We are seeing this error with MySQL 5.1.48:

Database errors found.
/opt/zimbra/mysql/bin/mysqlcheck --defaults-file=/opt/zimbra/conf/my.cnf -S
/opt/zimbra/db/mysql.sock -A -C -s -u root
--password=xxxxxxxxxxxxxx
mysql.general_log
 Error    : You can't use locks with log tables.
 mysql.slow_log
 Error    : You can't use locks with log tables.

It looks like this should be re-opened.
[5 Oct 2010 8:36] Susanne Ebrecht
Bug #43829 is set as duplicate of this bug here.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.