MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Lars Thalmann Date:June 19 2006 10:14am
Subject:bk commit into 5.1 tree (lars:1.2220)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of lthalmann. When lthalmann 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.2220 06/06/19 12:14:38 lars@stripped +8 -0
  Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl
  into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge

  sql/sql_table.cc
    1.349 06/06/19 12:14:24 lars@stripped +0 -0
    Auto merged

  sql/sql_parse.cc
    1.561 06/06/19 12:14:23 lars@stripped +0 -0
    Auto merged

  sql/sql_insert.cc
    1.203 06/06/19 12:14:22 lars@stripped +0 -0
    Auto merged

  sql/sql_class.h
    1.300 06/06/19 12:14:22 lars@stripped +0 -0
    Auto merged

  sql/sql_class.cc
    1.267 06/06/19 12:14:21 lars@stripped +0 -0
    Auto merged

  sql/sql_base.cc
    1.329 06/06/19 12:14:21 lars@stripped +0 -0
    Auto merged

  sql/log.cc
    1.216 06/06/19 12:14:20 lars@stripped +0 -0
    Auto merged

  mysql-test/t/archive.test
    1.23 06/06/19 12:14:20 lars@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:	lars
# Host:	dl145j.mysql.com
# Root:	/users/lthalmann/bk/MERGE/mysql-5.1-merge/RESYNC

--- 1.215/sql/log.cc	2006-06-16 20:23:07 +02:00
+++ 1.216/sql/log.cc	2006-06-19 12:14:20 +02:00
@@ -71,11 +71,17 @@
 struct binlog_trx_data {
   bool empty() const
   {
+#ifdef HAVE_ROW_BASED_REPLICATION
     return pending == NULL && my_b_tell(&trans_log) == 0;
+#else
+    return my_b_tell(&trans_log) == 0;
+#endif
   }
   binlog_trx_data() {}
   IO_CACHE trans_log;                         // The transaction cache
+#ifdef HAVE_ROW_BASED_REPLICATION
   Rows_log_event *pending;                // The pending binrows event
+#endif
 };
 
 handlerton binlog_hton;
@@ -1073,6 +1079,7 @@
 #endif
     error= mysql_bin_log.write(thd, trans_log, end_ev);
   }
+#ifdef HAVE_ROW_BASED_REPLICATION
   else
   {
 #ifdef HAVE_ROW_BASED_REPLICATION
@@ -1092,6 +1099,7 @@
     transaction cache.
   */
   mysql_bin_log.update_table_map_version();
+#endif
 
   statistic_increment(binlog_cache_use, &LOCK_status);
   if (trans_log->disk_writes != 0)
@@ -2919,7 +2927,6 @@
 }
 
 
-#ifdef HAVE_ROW_BASED_REPLICATION
 /*
   These functions are placed in this file since they need access to
   binlog_hton, which has internal linkage.
@@ -2955,6 +2962,7 @@
   engine has registered for the transaction.
  */
 
+#ifdef HAVE_ROW_BASED_REPLICATION
 int THD::binlog_write_table_map(TABLE *table, bool is_trans)
 {
   int error;
@@ -3133,9 +3141,9 @@
     we are inside a stored function, we do not end the statement since
     this will close all tables on the slave.
   */
+#ifdef HAVE_ROW_BASED_REPLICATION
   bool const end_stmt=
     thd->prelocked_mode && thd->lex->requires_prelocking();
-#ifdef HAVE_ROW_BASED_REPLICATION
   thd->binlog_flush_pending_rows_event(end_stmt);
 #endif /*HAVE_ROW_BASED_REPLICATION*/
 
@@ -3186,7 +3194,6 @@
         (binlog_trx_data*) thd->ha_data[binlog_hton.slot];
       IO_CACHE *trans_log= &trx_data->trans_log;
       bool trans_log_in_use= my_b_tell(trans_log) != 0;
-
       if (event_info->get_cache_stmt() && !trans_log_in_use)
         trans_register_ha(thd,
                           (thd->options &

--- 1.328/sql/sql_base.cc	2006-06-16 00:49:50 +02:00
+++ 1.329/sql/sql_base.cc	2006-06-19 12:14:21 +02:00
@@ -5084,10 +5084,6 @@
   if (from_clause->elements == 0)
     return FALSE; /* We come here in the case of UNIONs. */
 
-  /* For stored procedures do not redo work if already done. */
-  if (!context->select_lex->first_execution)
-    return FALSE;
-
   List_iterator_fast<TABLE_LIST> table_ref_it(*from_clause);
   TABLE_LIST *table_ref; /* Current table reference. */
   /* Table reference to the left of the current. */
@@ -5100,14 +5096,18 @@
   {
     table_ref= left_neighbor;
     left_neighbor= table_ref_it++;
-    if (store_top_level_join_columns(thd, table_ref,
-                                     left_neighbor, right_neighbor))
-      return TRUE;
-    if (left_neighbor)
+    /* For stored procedures do not redo work if already done. */
+    if (context->select_lex->first_execution)
     {
-      TABLE_LIST *first_leaf_on_the_right;
-      first_leaf_on_the_right= table_ref->first_leaf_for_name_resolution();
-      left_neighbor->next_name_resolution_table= first_leaf_on_the_right;
+      if (store_top_level_join_columns(thd, table_ref,
+                                       left_neighbor, right_neighbor))
+        return TRUE;
+      if (left_neighbor)
+      {
+        TABLE_LIST *first_leaf_on_the_right;
+        first_leaf_on_the_right= table_ref->first_leaf_for_name_resolution();
+        left_neighbor->next_name_resolution_table= first_leaf_on_the_right;
+      }
     }
     right_neighbor= table_ref;
   }

--- 1.266/sql/sql_class.cc	2006-06-16 00:49:50 +02:00
+++ 1.267/sql/sql_class.cc	2006-06-19 12:14:21 +02:00
@@ -2121,7 +2121,9 @@
   backup->enable_slow_log= enable_slow_log;
   backup->last_insert_id=  last_insert_id;
   backup->next_insert_id=  next_insert_id;
+  backup->current_insert_id=  current_insert_id;
   backup->insert_id_used=  insert_id_used;
+  backup->last_insert_id_used=  last_insert_id_used;
   backup->clear_next_insert_id= clear_next_insert_id;
   backup->limit_found_rows= limit_found_rows;
   backup->examined_row_count= examined_row_count;
@@ -2173,7 +2175,9 @@
   enable_slow_log=  backup->enable_slow_log;
   last_insert_id=   backup->last_insert_id;
   next_insert_id=   backup->next_insert_id;
+  current_insert_id= backup->current_insert_id;
   insert_id_used=   backup->insert_id_used;
+  last_insert_id_used= backup->last_insert_id_used;
   clear_next_insert_id= backup->clear_next_insert_id;
   limit_found_rows= backup->limit_found_rows;
   sent_row_count=   backup->sent_row_count;

--- 1.299/sql/sql_class.h	2006-06-16 02:52:05 +02:00
+++ 1.300/sql/sql_class.h	2006-06-19 12:14:22 +02:00
@@ -763,12 +763,13 @@
 {
 public:
   ulonglong options;
-  ulonglong last_insert_id, next_insert_id;
+  ulonglong last_insert_id, next_insert_id, current_insert_id;
   ulonglong limit_found_rows;
   ha_rows    cuted_fields, sent_row_count, examined_row_count;
   ulong client_capabilities;
   uint in_sub_stmt;
   bool enable_slow_log, insert_id_used, clear_next_insert_id;
+  bool last_insert_id_used;
   my_bool no_send_ok;
   SAVEPOINT *savepoints;
 };

--- 1.202/sql/sql_insert.cc	2006-06-16 02:52:05 +02:00
+++ 1.203/sql/sql_insert.cc	2006-06-19 12:14:22 +02:00
@@ -2009,6 +2009,14 @@
   if (!using_bin_log)
     table->file->extra(HA_EXTRA_WRITE_CACHE);
   pthread_mutex_lock(&mutex);
+
+  /* Reset auto-increment cacheing */
+  if (thd.clear_next_insert_id)
+  {
+    thd.next_insert_id= 0;
+    thd.clear_next_insert_id= 0;
+  }
+
   while ((row=rows.get()))
   {
     stacked_inserts--;

--- 1.560/sql/sql_parse.cc	2006-06-16 00:49:51 +02:00
+++ 1.561/sql/sql_parse.cc	2006-06-19 12:14:23 +02:00
@@ -5201,7 +5201,14 @@
   if (all_tables->security_ctx)
     thd->security_ctx= all_tables->security_ctx;
 
-  if (check_access(thd, privilege, all_tables->db,
+  const char *db_name;
+  if ((all_tables->view || all_tables->field_translation) &&
+      !all_tables->schema_table)
+    db_name= all_tables->view_db.str;
+  else
+    db_name= all_tables->db;
+
+  if (check_access(thd, privilege, db_name,
 		   &all_tables->grant.privilege, 0, 0,
                    test(all_tables->schema_table)))
     goto deny;

--- 1.22/mysql-test/t/archive.test	2006-06-16 00:49:45 +02:00
+++ 1.23/mysql-test/t/archive.test	2006-06-19 12:14:20 +02:00
@@ -1331,12 +1331,14 @@
 #
 # For bug #12836
 # Delete was allowing all rows to be removed
+--error 1031
 DELETE FROM t2;
 SELECT * FROM t2;
 INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W');
 INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
 INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
 SELECT * FROM t2;
+--error 1031
 TRUNCATE TABLE t2;
 SELECT * FROM t2;
 
Thread
bk commit into 5.1 tree (lars:1.2220)Lars Thalmann19 Jun