List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:June 19 2006 12:39pm
Subject:bk commit into 5.0 tree (cmiller:1.2184)
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
  1.2184 06/06/19 14:38:57 cmiller@stripped +1 -0
  Merge bk-internal.mysql.com:/data0/bk/mysql-5.0
  into  bk-internal.mysql.com:/data0/bk/mysql-5.0-maint

  client/mysqldump.c
    1.231 06/06/19 14:37:00 cmiller@stripped +0 -0
    Auto merged

# 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:	bk-internal.mysql.com
# Root:	/data0/bk/mysql-5.0-maint/RESYNC

--- 1.230/client/mysqldump.c	2006-06-10 02:56:03 +02:00
+++ 1.231/client/mysqldump.c	2006-06-19 14:37:00 +02:00
@@ -1494,9 +1494,15 @@
       field= mysql_fetch_field_direct(result, 0);
       if (strcmp(field->name, "View") == 0)
       {
+        char *scv_buff = NULL;
+
         if (verbose)
           fprintf(stderr, "-- It's a view, create dummy table for view\n");
 
+        /* save "show create" statement for later */
+        if ((row= mysql_fetch_row(result)) && (scv_buff=row[1]))
+          scv_buff= my_strdup(scv_buff, MYF(0));
+
         mysql_free_result(result);
 
         /*
@@ -1514,9 +1520,22 @@
                     "SHOW FIELDS FROM %s", result_table);
         if (mysql_query_with_error_report(sock, 0, query_buff))
         {
+          /*
+            View references invalid or privileged table/col/fun (err 1356),
+            so we cannot create a stand-in table.  Be defensive and dump
+            a comment with the view's 'show create' statement. (Bug #17371)
+          */
+
+          if (mysql_errno(sock) == ER_VIEW_INVALID)
+            fprintf(sql_file, "\n-- failed on view %s: %s\n\n", result_table, scv_buff ? scv_buff : "");
+
+          my_free(scv_buff, MYF(MY_ALLOW_ZERO_PTR));
+
           safe_exit(EX_MYSQLERR);
-          DBUG_RETURN(0);
+          DBUG_RETURN(0); 
         }
+        else
+          my_free(scv_buff, MYF(MY_ALLOW_ZERO_PTR));
 
         if ((result= mysql_store_result(sock)))
         {
Thread
bk commit into 5.0 tree (cmiller:1.2184)Chad MILLER19 Jun