List:Commits« Previous MessageNext Message »
From:eugene Date:August 31 2006 8:14am
Subject:bk commit into 5.1 tree (evgen:1.2288)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of evgen. When evgen 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, 2006-08-31 12:14:27+04:00, evgen@stripped +4 -0
  Merge epotemkin@stripped:/home/bk/mysql-5.1
  into  moonbone.local:/work/tmp_merge-5.1-opt-mysql
  MERGE: 1.2284.1.3

  sql/ha_innodb.cc@stripped, 2006-08-31 12:14:23+04:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.284.1.1

  sql/mysql_priv.h@stripped, 2006-08-31 12:14:23+04:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.429.1.3

  sql/sql_delete.cc@stripped, 2006-08-31 12:14:23+04:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.191.1.1

  sql/sql_select.cc@stripped, 2006-08-31 12:14:24+04:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.431.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:	evgen
# Host:	moonbone.local
# Root:	/work/tmp_merge-5.1-opt-mysql/RESYNC

--- 1.431/sql/mysql_priv.h	2006-08-31 12:14:33 +04:00
+++ 1.432/sql/mysql_priv.h	2006-08-31 12:14:33 +04:00
@@ -111,6 +111,15 @@
   TYPELIB *ab_month_names;
   TYPELIB *day_names;
   TYPELIB *ab_day_names;
+#ifdef __cplusplus 
+  my_locale_st(const char *name_par, const char *descr_par, bool is_ascii_par,
+               TYPELIB *month_names_par, TYPELIB *ab_month_names_par,
+               TYPELIB *day_names_par, TYPELIB *ab_day_names_par) : 
+    name(name_par), description(descr_par), is_ascii(is_ascii_par),
+    month_names(month_names_par), ab_month_names(ab_month_names_par),
+    day_names(day_names_par), ab_day_names(ab_day_names_par)
+  {}
+#endif
 } MY_LOCALE;
 
 extern MY_LOCALE my_locale_en_US;
@@ -1131,6 +1140,7 @@
                                    TABLE_LIST *tables, 
                                    TABLE_LIST **leaves, 
                                    bool select_insert,
+                                   ulong want_access_first,
                                    ulong want_access);
 int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
 	       List<Item> *sum_func_list, uint wild_num);

--- 1.192/sql/sql_delete.cc	2006-08-31 12:14:33 +04:00
+++ 1.193/sql/sql_delete.cc	2006-08-31 12:14:33 +04:00
@@ -383,7 +383,7 @@
                                     &thd->lex->select_lex.top_join_list,
                                     table_list, 
                                     &select_lex->leaf_tables, FALSE, 
-                                    DELETE_ACL) ||
+                                    DELETE_ACL, SELECT_ACL) ||
       setup_conds(thd, table_list, select_lex->leaf_tables, conds) ||
       setup_ftfuncs(select_lex))
     DBUG_RETURN(TRUE);
@@ -446,7 +446,7 @@
                                     &thd->lex->select_lex.top_join_list,
                                     lex->query_tables,
                                     &lex->select_lex.leaf_tables, FALSE, 
-                                    DELETE_ACL))
+                                    DELETE_ACL, SELECT_ACL))
     DBUG_RETURN(TRUE);
 
 

--- 1.432/sql/sql_select.cc	2006-08-31 12:14:33 +04:00
+++ 1.433/sql/sql_select.cc	2006-08-31 12:14:33 +04:00
@@ -822,6 +822,40 @@
     if (!order && org_order)
       skip_sort_order= 1;
   }
+  /*
+     Check if we can optimize away GROUP BY/DISTINCT.
+     We can do that if there are no aggregate functions and the
+     fields in DISTINCT clause (if present) and/or columns in GROUP BY
+     (if present) contain direct references to all key parts of
+     an unique index (in whatever order).
+     Note that the unique keys for DISTINCT and GROUP BY should not
+     be the same (as long as they are unique).
+
+     The FROM clause must contain a single non-constant table.
+  */
+  if (tables - const_tables == 1 && (group_list || select_distinct) &&
+      !tmp_table_param.sum_func_count &&
+      (!join_tab[const_tables].select ||
+       !join_tab[const_tables].select->quick ||
+       join_tab[const_tables].select->quick->get_type() != 
+       QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX))
+  {
+    if (group_list &&
+       list_contains_unique_index(join_tab[const_tables].table,
+                                 find_field_in_order_list,
+                                 (void *) group_list))
+    {
+      group_list= 0;
+      group= 0;
+    }
+    if (select_distinct &&
+       list_contains_unique_index(join_tab[const_tables].table,
+                                 find_field_in_item_list,
+                                 (void *) &fields_list))
+    {
+      select_distinct= 0;
+    }
+  }
   if (group_list || tmp_table_param.sum_func_count)
   {
     if (! hidden_group_fields && rollup.state == ROLLUP::STATE_NONE)
@@ -890,40 +924,6 @@
 			     &simple_group);
     if (old_group_list && !group_list)
       select_distinct= 0;
-  }
-  /*
-     Check if we can optimize away GROUP BY/DISTINCT.
-     We can do that if there are no aggregate functions and the
-     fields in DISTINCT clause (if present) and/or columns in GROUP BY
-     (if present) contain direct references to all key parts of
-     an unique index (in whatever order).
-     Note that the unique keys for DISTINCT and GROUP BY should not
-     be the same (as long as they are unique).
-
-     The FROM clause must contain a single non-constant table.
-  */
-  if (tables - const_tables == 1 && (group_list || select_distinct) &&
-      !tmp_table_param.sum_func_count &&
-      (!join_tab[const_tables].select ||
-       !join_tab[const_tables].select->quick ||
-       join_tab[const_tables].select->quick->get_type() != 
-       QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX))
-  {
-    if (group_list &&
-       list_contains_unique_index(join_tab[const_tables].table,
-                                 find_field_in_order_list,
-                                 (void *) group_list))
-    {
-      group_list= 0;
-      group= 0;
-    }
-    if (select_distinct &&
-       list_contains_unique_index(join_tab[const_tables].table,
-                                 find_field_in_item_list,
-                                 (void *) &fields_list))
-    {
-      select_distinct= 0;
-    }
   }
   if (!group_list && group)
   {

--- 1.286/sql/ha_innodb.cc	2006-08-31 12:14:33 +04:00
+++ 1.287/sql/ha_innodb.cc	2006-08-31 12:14:33 +04:00
@@ -2363,8 +2363,7 @@
 				"have forgotten\nto delete the corresponding "
 				".frm files of InnoDB tables, or you\n"
 				"have moved .frm files to another database?\n"
-				"Look from section 15.1 of "
-				"http://www.innodb.com/ibman.html\n"
+				"See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
 				"how you can resolve the problem.\n",
 				norm_name);
 		free_share(share);
@@ -2381,8 +2380,7 @@
 				"Have you deleted the .ibd file from the "
 				"database directory under\nthe MySQL datadir, "
 				"or have you used DISCARD TABLESPACE?\n"
-				"Look from section 15.1 of "
-				"http://www.innodb.com/ibman.html\n"
+				"See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
 				"how you can resolve the problem.\n",
 				norm_name);
 		free_share(share);
@@ -5602,13 +5600,14 @@
 		for (i = 0; i < table->s->keys; i++) {
 			if (index == NULL) {
 				ut_print_timestamp(stderr);
-				sql_print_error("Table %s contains less "
+				sql_print_error("Table %s contains fewer "
 						"indexes inside InnoDB than "
 						"are defined in the MySQL "
 						".frm file. Have you mixed up "
 						".frm files from different "
-						"installations? See section "
-						"15.1 at http://www.innodb.com/ibman.html",
+						"installations? See "
+"http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n",
+
 						ib_table->name);
 				break;
 			}
@@ -5617,17 +5616,11 @@
 
 				if (j + 1 > index->n_uniq) {
 					ut_print_timestamp(stderr);
-					sql_print_error("Index %s of %s has "
-							"%lu columns unique "
-							"inside InnoDB, but "
-							"MySQL is asking "
-							"statistics for %lu "
-							"columns. Have you "
-							"mixed up .frm files "
-							"from different "
-							"installations? See "
-							"section 15.1 at "
-							"http://www.innodb.com/ibman.html",
+					sql_print_error(
+"Index %s of %s has %lu columns unique inside InnoDB, but MySQL is asking "
+"statistics for %lu columns. Have you mixed up .frm files from different "
+"installations? "
+"See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n",
 							index->name,
 							ib_table->name,
 							(unsigned long)
@@ -6436,7 +6429,7 @@
 "table %s does not exist.\n"
 "Have you deleted the .ibd file from the database directory under\n"
 "the MySQL datadir?"
-"Look from section 15.1 of http://www.innodb.com/ibman.html\n"
+"See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
 "how you can resolve the problem.\n",
 				prebuilt->table->name);
 		DBUG_RETURN(HA_ERR_CRASHED);
Thread
bk commit into 5.1 tree (evgen:1.2288)eugene31 Aug