Bug #27173 "Enabling keys got errno ..." does not say which table
Submitted: 15 Mar 2007 13:14 Modified: 7 Jun 2007 16:18
Reporter: Kristian Koehntopp Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:5.0.36 OS:Linux (SLES 9)
Assigned to: Mark Leith CPU Architecture:Any
Tags: bfsm_2007_05_03, enable keys, error

[15 Mar 2007 13:14] Kristian Koehntopp
Description:
In the error log of a customers server I get

070315 13:43:01  mysqld started
070315 13:43:01  InnoDB: Started; log sequence number 0 24665690
070315 13:43:01 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.0.36-enterprise-log'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Enterprise Server (Commercial)
070315 14:03:32 [Warning] Warning: Enabling keys got errno 137, retrying

and perror 137 reports

nvag-blade0106:/var/lib/mysql # perror 137
MySQL error code 137: No more records (read after end of file)

So a table has a problem, but the message does not indicate which table and database schema are affected.

How to repeat:
I have no idea how to provoke that message artificially.

Suggested fix:
Check that this (and all other table related messages) include schema name and table name, when index related also the index name and number.
[15 Mar 2007 13:58] Mark Leith
===== sql/ha_myisam.cc 1.174 vs edited =====
--- 1.174/sql/ha_myisam.cc      2007-02-21 12:07:05 +00:00
+++ edited/sql/ha_myisam.cc     2007-03-15 13:40:58 +00:00
@@ -921,8 +921,8 @@
   param.sort_buffer_length=  check_opt->sort_buffer_size;
   if ((error= repair(thd,param,1)) && param.retry_repair)
   {
-    sql_print_warning("Warning: Optimize table got errno %d, retrying",
-                      my_errno);
+    sql_print_warning("Warning: Optimize table got errno %d on %s.%s, retrying",
+                      my_errno, param.db_name, param.table_name);
     param.testflag&= ~T_REP_BY_SORT;
     error= repair(thd,param,1);
   }
@@ -1296,8 +1296,8 @@
     param.tmpdir=&mysql_tmpdir_list;
     if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair)
     {
-      sql_print_warning("Warning: Enabling keys got errno %d, retrying",
-                        my_errno);
+      sql_print_warning("Warning: Enabling keys got errno %d on %s.%s, retrying",
+                        my_errno, param.db_name, param.table_name);
       /* Repairing by sort failed. Now try standard repair method. */
       param.testflag&= ~(T_REP_BY_SORT | T_QUICK);
       error= (repair(thd,param,0) != HA_ADMIN_OK);
[4 May 2007 17:17] 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/26120

ChangeSet@1.2652, 2007-05-04 13:17:07-04:00, cmiller@zippy.cornsilk.net +1 -0
  Bug #27173: "Enabling keys got errno ..." does not say which table
  
  Warnings may show up in the error log that complain about a table, yet
  don't tell us which table.
  
  Add the database and table names to the message.
[8 May 2007 13:52] Chad MILLER
Queued to maintenance 4.1, 5.0, and 5.1 trees.
[22 May 2007 17:01] Bugs System
Pushed into 5.1.19-beta
[22 May 2007 17:03] Bugs System
Pushed into 5.0.44
[22 May 2007 17:04] Bugs System
Pushed into 4.1.23
[7 Jun 2007 16:18] MC Brown
A note has been added to the 4.1.23, 5.0.44 and 5.1.19 changelogs.