List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:March 7 2007 7:51pm
Subject:bk commit into 5.0 tree (cmiller:1.2421) BUG#25347
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of cmiller. When cmiller does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-03-07 13:51:38-05:00, cmiller@stripped +4 -0
  Patch contributed by Jocelyn Fournier.  CLA received 2007-02-27.
  
  Bug#25347: mysqlcheck -A -r doesn't repair table marked as crashed
  
  mysqlcheck tests nullness of the engine type to know whether the
  "table" is a view or not.  That also falsely catches tables that 
  are severly damaged.
  
  Instead, use SHOW FULL TABLES to test whether a "table" is a view
  or not.
  
  (Don't add new function.  Instead, get original data a smarter way.)

  BitKeeper/etc/collapsed@stripped, 2007-03-07 13:50:07-05:00, cmiller@stripped +4
-0

  client/mysqlcheck.c@stripped, 2007-03-07 13:51:36-05:00, cmiller@stripped +12 -12
    Use SHOW FULL TABLES to test better whether a name in the table
    list is one of a view.  Checking that the engine is NULL is 
    insufficient.
    
    Implemented suggestion from jimw that involved removing most of 
    original patch and getting data a better way

  mysql-test/r/mysqlcheck.result@stripped, 2007-03-07 13:51:36-05:00,
cmiller@stripped +10 -0
    Verify that tables that have NULL/unreadable engine types are 
    processed and not interpreted as views.

  mysql-test/t/mysqlcheck.test@stripped, 2007-03-07 13:51:36-05:00, cmiller@stripped
+16 -0
    Verify that tables that have NULL/unreadable engine types are 
    processed and not interpreted as views.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	cmiller
# Host:	zippy.cornsilk.net
# Root:	/home/cmiller/work/mysql/mysql-5.0-comeng--bug25347

--- 1.26/BitKeeper/etc/collapsed	2007-03-07 13:51:43 -05:00
+++ 1.27/BitKeeper/etc/collapsed	2007-03-07 13:51:43 -05:00
@@ -57,3 +57,7 @@
 45ddaf15_Ld7IAEpUUP3FJjJ-oSEFg
 45ddc763DodLG1BqH_wRBJXMbCSB5A
 45ddc8282KnaNGuijqCTphlXV_eeog
+45eedc83xPOs7LThqiF1rwmXkDwIWQ
+45eedf775gJhd_GXVE4kSj9hIvn_MA
+45eeeae4mAi29baXtdh96CJlDa_cXw
+45ef08038kltrL-Enj7ZHHjUrrP9pw

--- 1.2/mysql-test/r/mysqlcheck.result	2007-03-07 13:51:43 -05:00
+++ 1.3/mysql-test/r/mysqlcheck.result	2007-03-07 13:51:43 -05:00
@@ -38,4 +38,14 @@ test.t1                                 
 test.t1                                            OK
 drop view v1;
 drop table t1;
+create database d_bug25347;
+use d_bug25347;
+create table t_bug25347 (a int);
+create view v_bug25347 as select * from t_bug25347;
+removing and creating
+d_bug25347.t_bug25347                              OK
+drop view v_bug25347;
+drop table t_bug25347;
+drop database d_bug25347;
+use test;
 End of 5.0 tests

--- 1.2/mysql-test/t/mysqlcheck.test	2007-03-07 13:51:43 -05:00
+++ 1.3/mysql-test/t/mysqlcheck.test	2007-03-07 13:51:43 -05:00
@@ -22,4 +22,20 @@ create view v1 as select * from t1;
 drop view v1;
 drop table t1;
 
+#
+# Bug#25347: mysqlcheck -A -r doesn't repair table marked as crashed
+#
+create database d_bug25347;
+use d_bug25347;
+create table t_bug25347 (a int);
+create view v_bug25347 as select * from t_bug25347;
+--echo removing and creating
+--exec rm    $MYSQLTEST_VARDIR/master-data/d_bug25347/t_bug25347.MYI;
+--exec touch $MYSQLTEST_VARDIR/master-data/d_bug25347/t_bug25347.MYI;
+--exec $MYSQL_CHECK --repair --databases d_bug25347
+drop view v_bug25347;
+drop table t_bug25347;
+drop database d_bug25347;
+use test;
+
 --echo End of 5.0 tests

--- 1.58/client/mysqlcheck.c	2007-03-07 13:51:43 -05:00
+++ 1.59/client/mysqlcheck.c	2007-03-07 13:51:43 -05:00
@@ -457,7 +457,7 @@ static int process_all_tables_in_db(char
   LINT_INIT(res);
   if (use_db(database))
     return 1;
-  if (mysql_query(sock, "SHOW TABLE STATUS") ||
+  if (mysql_query(sock, "SHOW FULL TABLES") ||
 	!((res= mysql_store_result(sock))))
     return 1;
 
@@ -483,12 +483,11 @@ static int process_all_tables_in_db(char
     }
     for (end = tables + 1; (row = mysql_fetch_row(res)) ;)
     {
-      /* Skip tables with an engine of NULL (probably a view). */
-      if (row[1])
-      {
-        end= fix_table_name(end, row[0]);
-        *end++= ',';
-      }
+      if (strcmp(row[1], "VIEW") == 0)
+        continue;
+
+      end= fix_table_name(end, row[0]);
+      *end++= ',';
     }
     *--end = 0;
     if (tot_length)
@@ -498,11 +497,12 @@ static int process_all_tables_in_db(char
   else
   {
     while ((row = mysql_fetch_row(res)))
-      /* Skip tables with an engine of NULL (probably a view). */
-      if (row[1])
-      {
-        handle_request_for_tables(row[0], strlen(row[0]));
-      }
+    {
+      if (strcmp(row[1], "VIEW") == 0)
+        continue;
+
+      handle_request_for_tables(row[0], strlen(row[0]));
+    }
   }
   mysql_free_result(res);
   return 0;
Thread
bk commit into 5.0 tree (cmiller:1.2421) BUG#25347Chad MILLER7 Mar