List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:March 7 2007 6:44pm
Subject:bk commit into 5.0 tree (cmiller:1.2422)
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:44:19-05:00, cmiller@stripped +3 -0
  Don't add new function.  Instead, get original data a smarter way.

  client/mysqlcheck.c@stripped, 2007-03-07 13:44:17-05:00, cmiller@stripped +3 -50
    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:44:17-05:00, cmiller@stripped +0 -1
    No change.

  mysql-test/t/mysqlcheck.test@stripped, 2007-03-07 13:44:17-05:00, cmiller@stripped +0 -1
    No change.

# 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.3/mysql-test/r/mysqlcheck.result	2007-03-07 13:44:23 -05:00
+++ 1.4/mysql-test/r/mysqlcheck.result	2007-03-07 13:44:23 -05:00
@@ -42,7 +42,6 @@ create database d_bug25347;
 use d_bug25347;
 create table t_bug25347 (a int);
 create view v_bug25347 as select * from t_bug25347;
-d_bug25347.t_bug25347                              OK
 removing and creating
 d_bug25347.t_bug25347                              OK
 drop view v_bug25347;

--- 1.3/mysql-test/t/mysqlcheck.test	2007-03-07 13:44:23 -05:00
+++ 1.4/mysql-test/t/mysqlcheck.test	2007-03-07 13:44:23 -05:00
@@ -29,7 +29,6 @@ create database d_bug25347;
 use d_bug25347;
 create table t_bug25347 (a int);
 create view v_bug25347 as select * from t_bug25347;
---exec $MYSQL_CHECK --repair --databases d_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;

--- 1.59/client/mysqlcheck.c	2007-03-07 13:44:23 -05:00
+++ 1.60/client/mysqlcheck.c	2007-03-07 13:44:23 -05:00
@@ -449,53 +449,6 @@ static char *fix_table_name(char *dest, 
 }
 
 
-/**
-  Take a "table name" and check to see if it's really a view.  
-  Specifically, it checks that SHOW CREATE VIEW table_name doesn't
-  cause a SQL error.
-
-  @param  table_name  NUL-terminated, unquoted name of purported view
-  @returns  TRUE if table_name is a view name, FALSE if not or unsure
-*/
-static my_bool is_view(char *table_name)
-{
-  MYSQL_RES *show_create_result;
-  my_bool ret;
-  char *query_view_check;
-
-  uint show_stmt_length= 19 + strlen(table_name) + 1;  /* 19=SHOW...  1=\0 */
-  query_view_check= (char *) my_malloc(sizeof(char)*show_stmt_length, MYF(0));
-
-  sprintf(query_view_check, "SHOW CREATE VIEW `%s`", table_name);
-  if (mysql_query(sock, query_view_check) == 0)
-  {
-    ret= TRUE;
-
-    /* We asked for it.  We must retreive it. */
-    if ((show_create_result= mysql_store_result(sock)) != NULL)
-      mysql_free_result(show_create_result);
-  }
-  else
-  {
-    /* 
-      SHOW CREATE failed.  It may fail for several reasons, but only
-      one is interesting:  If the object we operated on is not a view,
-      then we should get ER_WRONG_OBJECT.  If we get something else,
-      like a handler error (err < 1000), then it is a view that is 
-      damaged.
-    */
-    
-    if (mysql_errno(sock) == ER_WRONG_OBJECT)
-      ret= FALSE;
-    else
-      ret= TRUE;
-  }
-
-  my_free(query_view_check, MYF(0));
-  return(ret);
-}
-
-
 static int process_all_tables_in_db(char *database)
 {
   MYSQL_RES *res;
@@ -504,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;
 
@@ -530,7 +483,7 @@ static int process_all_tables_in_db(char
     }
     for (end = tables + 1; (row = mysql_fetch_row(res)) ;)
     {
-      if (is_view(row[0]))
+      if (strcmp(row[1], "VIEW") == 0)
         continue;
 
       end= fix_table_name(end, row[0]);
@@ -545,7 +498,7 @@ static int process_all_tables_in_db(char
   {
     while ((row = mysql_fetch_row(res)))
     {
-      if (is_view(row[0]))
+      if (strcmp(row[1], "VIEW") == 0)
         continue;
 
       handle_request_for_tables(row[0], strlen(row[0]));
Thread
bk commit into 5.0 tree (cmiller:1.2422)Chad MILLER7 Mar