List:Commits« Previous MessageNext Message »
From:Tatjana A Nuernberg Date:March 23 2007 8:43pm
Subject:bk commit into 5.1 tree (tnurnberg:1.2508)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tnurnberg. When tnurnberg 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-23 20:43:40+01:00, tnurnberg@stripped +5 -0
  Merge tnurnberg@stripped:/home/bk/mysql-5.1-marvel
  into  sin.intern.azundris.com:/home/tnurnberg/26817/51-26817
  MERGE: 1.2504.3.1

  client/mysqldump.c@stripped, 2007-03-23 20:43:35+01:00, tnurnberg@stripped
+0 -0
    Auto merged
    MERGE: 1.268.2.1

  sql/sql_base.cc@stripped, 2007-03-23 20:43:35+01:00, tnurnberg@stripped +0
-0
    Auto merged
    MERGE: 1.386.1.1

  sql/sql_parse.cc@stripped, 2007-03-23 20:43:35+01:00, tnurnberg@stripped +0
-0
    Auto merged
    MERGE: 1.647.1.1

  sql/sql_view.cc@stripped, 2007-03-23 20:43:35+01:00, tnurnberg@stripped +0
-0
    Auto merged
    MERGE: 1.123.1.1

  sql/table.cc@stripped, 2007-03-23 20:43:36+01:00, tnurnberg@stripped +0 -0
    Auto merged
    MERGE: 1.280.1.1

# 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:	tnurnberg
# Host:	sin.intern.azundris.com
# Root:	/home/tnurnberg/26817/51-26817/RESYNC

--- 1.270/client/mysqldump.c	2007-03-22 13:14:44 +01:00
+++ 1.271/client/mysqldump.c	2007-03-23 20:43:35 +01:00
@@ -109,7 +109,8 @@ static char  *opt_password=0,*current_us
              *lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0,
              *where=0, *order_by=0,
              *opt_compatible_mode_str= 0,
-             *err_ptr= 0;
+             *err_ptr= 0,
+             *log_error_file= NULL;
 static char **defaults_argv= 0;
 static char compatible_mode_normal_str[255];
 static ulong opt_compatible_mode= 0;
@@ -120,7 +121,9 @@ static my_string opt_mysql_unix_port=0;
 static int   first_error=0;
 static DYNAMIC_STRING extended_row;
 #include <sslopt-vars.h>
-FILE  *md_result_file= 0;
+FILE *md_result_file= 0;
+FILE *stderror_file=0;
+
 #ifdef HAVE_SMEM
 static char *shared_memory_base_name=0;
 #endif
@@ -307,6 +310,9 @@ static struct my_option my_long_options[
    0, 0, 0, 0, 0, 0},
   {"lock-tables", 'l', "Lock all tables for read.", (gptr*) &lock_tables,
    (gptr*) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+  {"log-error", OPT_ERROR_LOG_FILE, "Append warnings and errors to given file.",
+   (gptr*) &log_error_file, (gptr*) &log_error_file, 0, GET_STR,
+   REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"master-data", OPT_MASTER_DATA,
    "This causes the binary log position and filename to be appended to the "
    "output. If equal to 1, will print it as a CHANGE MASTER command; if equal"
@@ -4113,6 +4119,16 @@ int main(int argc, char **argv)
     free_resources(0);
     exit(exit_code);
   }
+
+  if (log_error_file)
+  {
+    if(!(stderror_file= freopen(log_error_file, "a+", stderr)))
+    {
+      free_resources(0);
+      exit(EX_MYSQLERR);
+    }
+  }
+
   if (connect_to_db(current_host, current_user, opt_password))
   {
     free_resources(0);
@@ -4176,5 +4192,9 @@ err:
   if (!path)
     write_footer(md_result_file);
   free_resources();
+
+  if (stderror_file)
+    fclose(stderror_file);
+
   return(first_error);
 } /* main */

--- 1.388/sql/sql_base.cc	2007-03-19 22:44:13 +01:00
+++ 1.389/sql/sql_base.cc	2007-03-23 20:43:35 +01:00
@@ -4490,14 +4490,35 @@ find_field_in_tables(THD *thd, Item_iden
   {
     Field *cur_field= find_field_in_table_ref(thd, cur_table, name, length,
                                               item->name, db, table_name, ref,
-                                              check_privileges, allow_rowid,
+                                              check_privileges,
+                                              allow_rowid,
                                               &(item->cached_field_index),
                                               register_tree_change,
                                               &actual_table);
     if (cur_field)
     {
       if (cur_field == WRONG_GRANT)
-	return (Field*) 0;
+      {
+        if (thd->lex->sql_command != SQLCOM_SHOW_FIELDS)
+          return (Field*) 0;
+
+        thd->clear_error();
+        cur_field= find_field_in_table_ref(thd, cur_table, name, length,
+                                           item->name, db, table_name, ref,
+                                           false,
+                                           allow_rowid,
+                                           &(item->cached_field_index),
+                                           register_tree_change,
+                                           &actual_table);
+        if (cur_field)
+        {
+          Field *nf=new Field_null(NULL,0,Field::NONE,
+                                   cur_field->field_name,
+                                   cur_field->table,
+                                   &my_charset_bin);
+          cur_field= nf;
+        }
+      }
 
       /*
         Store the original table of the field, which may be different from
@@ -4520,7 +4541,7 @@ find_field_in_tables(THD *thd, Item_iden
             report_error == IGNORE_EXCEPT_NON_UNIQUE)
           my_error(ER_NON_UNIQ_ERROR, MYF(0),
                    table_name ? item->full_name() : name, thd->where);
-	return (Field*) 0;
+        return (Field*) 0;
       }
       found= cur_field;
     }

--- 1.648/sql/sql_parse.cc	2007-03-19 22:37:33 +01:00
+++ 1.649/sql/sql_parse.cc	2007-03-23 20:43:35 +01:00
@@ -4460,7 +4460,10 @@ bool check_single_table_access(THD *thd,
     goto deny;
 
   /* Show only 1 table for check_grant */
-  if (grant_option && check_grant(thd, privilege, all_tables, 0, 1, 0))
+  if (grant_option &&
+      !(all_tables->belong_to_view &&
+        (thd->lex->sql_command == SQLCOM_SHOW_FIELDS)) &&
+      check_grant(thd, privilege, all_tables, 0, 1, 0))
     goto deny;
 
   thd->security_ctx= backup_ctx;

--- 1.281/sql/table.cc	2007-03-19 22:37:36 +01:00
+++ 1.282/sql/table.cc	2007-03-23 20:43:36 +01:00
@@ -2961,7 +2961,7 @@ void st_table_list::hide_view_error(THD 
       thd->net.last_errno == ER_NO_SUCH_TABLE)
   {
     TABLE_LIST *top= top_table();
-    thd->clear_error();
+    thd->clear_error(); 
     my_error(ER_VIEW_INVALID, MYF(0), top->view_db.str, top->view_name.str);
   }
   else if (thd->net.last_errno == ER_NO_DEFAULT_FOR_FIELD)
@@ -3317,7 +3317,8 @@ bool st_table_list::prepare_view_securet
                                 definer.host.str,
                                 thd->db))
     {
-      if (thd->lex->sql_command == SQLCOM_SHOW_CREATE)
+      if ((thd->lex->sql_command == SQLCOM_SHOW_CREATE) ||
+          (thd->lex->sql_command == SQLCOM_SHOW_FIELDS))
       {
         push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, 
                             ER_NO_SUCH_USER, 

--- 1.124/sql/sql_view.cc	2007-03-09 11:15:46 +01:00
+++ 1.125/sql/sql_view.cc	2007-03-23 20:43:35 +01:00
@@ -1004,6 +1004,11 @@ bool mysql_make_view(THD *thd, File_pars
     CHARSET_INFO *save_cs= thd->variables.character_set_client;
     thd->variables.character_set_client= system_charset_info;
     res= MYSQLparse((void *)thd);
+
+    if ((old_lex->sql_command == SQLCOM_SHOW_FIELDS) ||
+        (old_lex->sql_command == SQLCOM_SHOW_CREATE))
+        lex->sql_command= old_lex->sql_command;
+
     thd->variables.character_set_client= save_cs;
     thd->variables.sql_mode= save_mode;
   }
@@ -1029,7 +1034,7 @@ bool mysql_make_view(THD *thd, File_pars
       }
     }
     else if (!table->prelocking_placeholder &&
-             old_lex->sql_command == SQLCOM_SHOW_CREATE &&
+             (old_lex->sql_command == SQLCOM_SHOW_CREATE) &&
              !table->belong_to_view)
     {
       if (check_table_access(thd, SHOW_VIEW_ACL, table, 0))
Thread
bk commit into 5.1 tree (tnurnberg:1.2508)Tatjana A Nuernberg24 Mar