List:Commits« Previous MessageNext Message »
From:Gleb Shchepa Date:April 8 2009 7:13am
Subject:bzr commit into mysql-5.1-bugteam branch (gshchepa:2855) Bug#42563
View as plain text  
#At file:///work/bzr/42563-5.1/ based on revid:satya.bn@stripped

 2855 Gleb Shchepa	2009-04-08
      Bug #42563: Message tells me to repair table though Storage
                  Engine doesn't allow me to.
      
      In case of incompatible changes between old and new table 
      versions, the mysqlcheck program prints error messages like 
      this:
        error: Table upgrade required. Please do
               "REPAIR TABLE `table_name`" to fix it!
      
      However, InnoDB doesn't support REPAIR TABLE query, so the 
      message is confusing.
      
      
      New error message has been added:
      
        error: Table upgrade required. 
               Please do mysqldump/reload to fix it!
      modified:
        sql/share/errmsg.txt
        sql/sql_table.cc

per-file messages:
  sql/share/errmsg.txt
    Bug #42563: Message tells me to repair table though Storage
                Engine doesn't allow me to.
                
    The ER_TABLE_NEEDS_DUMP_RELOAD error message has been added:
    "Table upgrade required. Please do mysqldump/reload to fix it!"
  sql/sql_table.cc
    Bug #42563: Message tells me to repair table though Storage
                Engine doesn't allow me to.
    
    The mysql_admin_table function has been modified to send
    the ER_TABLE_NEEDS_DUMP_RELOAD message instead of
    ER_TABLE_NEEDS_UPGRADE for InnoDB tables.
=== modified file 'sql/share/errmsg.txt'
--- a/sql/share/errmsg.txt	2009-03-05 11:20:01 +0000
+++ b/sql/share/errmsg.txt	2009-04-08 07:12:59 +0000
@@ -6177,3 +6177,6 @@ ER_TOO_LONG_TABLE_COMMENT
 ER_TOO_LONG_FIELD_COMMENT
   eng "Comment for field '%-.64s' is too long (max = %lu)"
   por "Coment�rio para o campo '%-.64s' � longo demais (max = %lu)"
+
+ER_TABLE_NEEDS_DUMP_RELOAD
+  eng "Table upgrade required. Please do mysqldump/reload to fix it!"

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2009-03-24 13:58:52 +0000
+++ b/sql/sql_table.cc	2009-04-08 07:12:59 +0000
@@ -4578,6 +4578,21 @@ send_result_message:
     }
 
     case HA_ADMIN_NEEDS_UPGRADE:
+      if (!strncmp(table->table->file->table_type(), STRING_WITH_LEN("InnoDB")))
+      {
+        /*
+          InnoDB doesn't support ha_repair.
+          TODO: overload ha_innobase::check_for_upgrade() to return different
+                result code.
+        */
+        protocol->store(STRING_WITH_LEN("error"), system_charset_info);
+        protocol->store(ER(ER_TABLE_NEEDS_DUMP_RELOAD),
+                        strlen(ER(ER_TABLE_NEEDS_DUMP_RELOAD)),
+                        system_charset_info);
+        fatal_error=1;
+        break;
+      }
+      // fall through
     case HA_ADMIN_NEEDS_ALTER:
     {
       char buf[MYSQL_ERRMSG_SIZE];

Thread
bzr commit into mysql-5.1-bugteam branch (gshchepa:2855) Bug#42563Gleb Shchepa8 Apr