List:Internals« Previous MessageNext Message »
From:timour Date:September 15 2005 3:46pm
Subject:bk commit into 5.0 tree (timour:1.1967)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of timka. When timka 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.1967 05/09/15 16:46:42 timour@stripped +1 -0
  Merge mysql.com:/home/timka/mysql/src/5.0-virgin
  into  mysql.com:/home/timka/mysql/src/5.0-bug-13127

  sql/sql_base.cc
    1.303 05/09/15 16:46:38 timour@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:	timour
# Host:	lamia.home
# Root:	/home/timka/mysql/src/5.0-bug-13127/RESYNC

--- 1.302/sql/sql_base.cc	2005-09-15 10:02:14 +03:00
+++ 1.303/sql/sql_base.cc	2005-09-15 16:46:38 +03:00
@@ -2980,7 +2980,8 @@
     TODO: Ensure that table_name, db_name and tables->db always points to
           something !
   */
-  if (!(table_list->nested_join && table_list->join_columns) &&
+  if ((!(table_list->nested_join && table_list->join_columns) ||
+       table_list->field_translation) &&
       table_name && table_name[0] &&
       (my_strcasecmp(table_alias_charset, table_list->alias, table_name) ||
        (db_name && db_name[0] && table_list->db &&
table_list->db[0] &&
@@ -2988,25 +2989,48 @@
     DBUG_RETURN(0);
 
   *actual_table= NULL;
+
   if (table_list->field_translation)
   {
+    /* 'table_list' is a view or an information schema table. */
     if ((fld= find_field_in_view(thd, table_list, name, item_name, length,
                                  ref, check_grants_view,
                                  register_tree_change)))
       *actual_table= table_list;
   }
-  else if (table_list->nested_join && table_list->join_columns)
+  else if (!(table_list->nested_join && table_list->join_columns))
+  {
+    /*
+      'table_list' is a stored table. It is so because the only type of nested
+      join passed to this procedure is a NATURAL/USING join or an operand of a
+      NATURAL/USING join.
+    */
+    if ((fld= find_field_in_table(thd, table_list->table, name, length,
+                                  check_grants_table, allow_rowid,
+                                  cached_field_index_ptr)))
+      *actual_table= table_list;
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+    /* check for views with temporary table algorithm */
+    if (check_grants_view && table_list->view &&
+        fld && fld != WRONG_GRANT &&
+        check_grant_column(thd, &table_list->grant,
+                           table_list->view_db.str,
+                           table_list->view_name.str,
+                           name, length))
+    fld= WRONG_GRANT;
+#endif
+  }
+  else
   {
     /*
-      If this is a NATURAL/USING join, or an operand of such join which is a
-      join itself, and the field name is qualified, then search for the field
-      in the operands of the join.
+      'table_list' is a NATURAL/USING join, or an operand of such join that
+      is a join itself.
+
+      If the field name we search for is qualified, then search for the field
+      in the table references used by NATURAL/USING the join.
     */
     if (table_name && table_name[0])
     {
-      /*
-        Qualified field; Search for it in the tables used by the natural join.
-      */
       List_iterator<TABLE_LIST> it(table_list->nested_join->join_list);
       TABLE_LIST *table;
       while ((table= it++))
@@ -3031,23 +3055,6 @@
                                     /* TIMOUR_TODO: check this with Sanja */
                                     check_grants_table || check_grants_view,
                                     register_tree_change, actual_table);
-  }
-  else
-  {
-    if ((fld= find_field_in_table(thd, table_list->table, name, length,
-                                  check_grants_table, allow_rowid,
-                                  cached_field_index_ptr)))
-      *actual_table= table_list;
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
-    /* check for views with temporary table algorithm */
-    if (check_grants_view && table_list->view &&
-        fld && fld != WRONG_GRANT &&
-        check_grant_column(thd, &table_list->grant,
-                           table_list->view_db.str,
-                           table_list->view_name.str,
-                           name, length))
-    fld= WRONG_GRANT;
-#endif
   }
 
   DBUG_RETURN(fld);
Thread
bk commit into 5.0 tree (timour:1.1967)timour15 Sep