List:Commits« Previous MessageNext Message »
From:mikael Date:February 1 2006 1:00pm
Subject:bk commit into 5.1 tree (mikron:1.2100)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of mikron. When mikron 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.2100 06/02/01 14:00:00 mikron@stripped +2 -0
  WL 2826: Another step

  sql/sql_partition.cc
    1.31 06/02/01 13:59:46 mikron@stripped +154 -9
    New entries for new functions

  sql/mysql_priv.h
    1.376 06/02/01 13:59:46 mikron@stripped +7 -1
    Set error_inject_code to zero after firing error injection

# 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:	mikron
# Host:	mikael-ronstr-ms-dator.local
# Root:	/Users/mikron/wl2826

--- 1.375/sql/mysql_priv.h	2006-01-31 20:14:47 +01:00
+++ 1.376/sql/mysql_priv.h	2006-02-01 13:59:46 +01:00
@@ -616,7 +616,13 @@
 inline bool
 my_error_inject(int error)
 {
-  return (current_thd->variables.error_inject_code == error) ? 1 : 0;
+  THD *thd= current_thd;
+  if (thd->variables.error_inject_code == error)
+  {
+    thd->variables.error_inject_code= 0;
+    return 1;
+  }
+  return 0;
 }
 
 #define ERROR_INJECTOR_CRASH(code) \

--- 1.30/sql/sql_partition.cc	2006-02-01 09:27:49 +01:00
+++ 1.31/sql/sql_partition.cc	2006-02-01 13:59:46 +01:00
@@ -5115,6 +5115,146 @@
 
 
 /*
+  Write the log entry to ensure that the shadow frm file is removed at
+  crash.
+  SYNOPSIS
+    write_log_shadow_frm()
+    lpt                      Struct containing parameters
+    install_frm              Should we log action to install shadow frm or should
+                             the action be to remove the shadow frm file.
+  RETURN VALUES
+    TRUE                     Error
+    FALSE                    Success
+  DESCRIPTION
+    Prepare an entry to the table log indicating a drop/install of the shadow frm
+    file and its corresponding handler file.
+*/
+
+bool
+write_log_shadow_frm(ALTER_PARTITION_PARAM_TYPE *lpt, bool install_frm)
+{
+  DBUG_ENTER("write_log_shadow_frm");
+  DBUG_RETURN(FALSE);
+}
+
+
+/*
+  Write the log entries to ensure that the drop partition command is completed
+  even in the presence of a crash.
+
+  SYNOPSIS
+    write_log_drop_partition()
+    lpt                      Struct containing parameters
+  RETURN VALUES
+    TRUE                     Error
+    FALSE                    Success
+  DESCRIPTION
+    Prepare entries to the table log indicating all partitions to drop and to
+    install the shadow frm file and remove the old frm file.
+*/
+
+bool
+write_log_add_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
+{
+  DBUG_ENTER("write_log_drop_partition");
+  DBUG_RETURN(FALSE);
+}
+
+
+/*
+  Write the log entries to ensure that the drop partition command is completed
+  even in the presence of a crash.
+
+  SYNOPSIS
+    write_log_drop_partition()
+    lpt                      Struct containing parameters
+  RETURN VALUES
+    TRUE                     Error
+    FALSE                    Success
+  DESCRIPTION
+    Prepare entries to the table log indicating all partitions to drop and to
+    install the shadow frm file and remove the old frm file.
+*/
+
+bool
+write_log_drop_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
+{
+  DBUG_ENTER("write_log_drop_partition");
+  DBUG_RETURN(FALSE);
+}
+
+
+/*
+  Write the log entries to ensure that the add partition command is not
+  executed at all if a crash before it has completed
+
+  SYNOPSIS
+    write_log_add_partition()
+    lpt                      Struct containing parameters
+  RETURN VALUES
+    TRUE                     Error
+    FALSE                    Success
+  DESCRIPTION
+    Prepare entries to the table log indicating all partitions to drop and to
+    remove the shadow frm file.
+*/
+
+bool
+write_log_add_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
+{
+  DBUG_ENTER("write_log_add_partition");
+  DBUG_RETURN(FALSE);
+}
+
+
+/*
+  Write indicator of how to abort in first phase of change partitions
+  SYNOPSIS
+    write_log_ph1_change_partition()
+    lpt                      Struct containing parameters
+  RETURN VALUES
+    TRUE                     Error
+    FALSE                    Success
+  DESCRIPTION
+    Write the log entries to remove partitions in creation when changing
+    partitions in an ADD/REORGANIZE/COALESCE command. These commands will
+    abort the entire operation if the system crashes before the next phase
+    is done.
+*/
+
+bool
+write_log_ph1_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
+{
+  DBUG_ENTER("write_log_ph1_change_partition");
+  DBUG_RETURN(FALSE);
+}
+
+
+/*
+  Write description of how to complete the operation after first phase of
+  change partitions.
+
+  SYNOPSIS
+    write_log_ph2_change_partition()
+    lpt                      Struct containing parameters
+  RETURN VALUES
+    TRUE                     Error
+    FALSE                    Success
+  DESCRIPTION
+    We will write log entries that specify to remove all partitions reorganised,
+    to rename others to reflect the new naming scheme and to install the shadow
+    frm file.
+*/
+
+bool
+write_log_ph2_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
+{
+  DBUG_ENTER("write_log_ph2_change_partition");
+  DBUG_RETURN(FALSE);
+}
+
+
+/*
   Actually perform the change requested by ALTER TABLE of partitions
   previously prepared.
 
@@ -5305,7 +5445,7 @@
       We insert Error injections at all places where it could be interesting
       to test if recovery is properly done.
     */
-    if (write_log_shadow_frm(lpt) ||
+    if (write_log_shadow_frm(lpt, FALSE) ||
         ERROR_INJECTOR_CRASH(1000) ||
         mysql_write_frm(lpt, WFRM_WRITE_SHADOW) ||
         ERROR_INJECTOR_CRASH(1001) ||
@@ -5352,13 +5492,16 @@
          are still using the old partitioning scheme. Wait until all
          ongoing users have completed before progressing.
       4) Write binlog
-      5) Install the new frm file of the table where the partitions are
+      5) Now the change is completed except for the installation of the
+         new frm file. We thus write an action in the log to change to
+         the shadow frm file
+      6) Install the new frm file of the table where the partitions are
          added to the table.
-      6) Wait until all accesses using the old frm file has completed
-      7) Remove entries from table log
-      8) Complete query
+      7) Wait until all accesses using the old frm file has completed
+      8) Remove entries from table log
+      9) Complete query
     */
-    if (write_log_shadow_frm(lpt) ||
+    if (write_log_shadow_frm(lpt, FALSE) ||
         ERROR_INJECTED_CRASH(1010) ||
         mysql_write_frm(lpt, WFRM_WRITE_SHADOW) ||
         ERROR_INJECTED_CRASH(1011) ||
@@ -5371,11 +5514,13 @@
          (write_bin_log(thd, FALSE,
                         thd->query, thd->query_length), FALSE)) ||
         ERROR_INJECTED_CRASH(1014) ||
-        mysql_write_frm(lpt, WFRM_INSTALL_SHADOW) ||
+        write_log_shadow_frm(lpt, TRUE) ||
         ERROR_INJECTED_CRASH(1015) ||
+        mysql_write_frm(lpt, WFRM_INSTALL_SHADOW) ||
+        ERROR_INJECTED_CRASH(1016) ||
         (close_open_tables_and_downgrade(lpt), FALSE) ||
         write_log_completed(lpt) ||
-        ERROR_INJECTED_CRASH(1016)) 
+        ERROR_INJECTED_CRASH(1017)) 
     {
       fast_alter_partition_error_handler(lpt);
       DBUG_RETURN(TRUE);
@@ -5437,7 +5582,7 @@
       14)Complete query
     */
 
-    if (write_log_shadow_frm(lpt) ||
+    if (write_log_shadow_frm(lpt, FALSE) ||
         ERROR_INJECT_CRASH(1020) ||
         mysql_write_frm(lpt, WFRM_WRITE_SHADOW) ||
         ERROR_INJECT_CRASH(1021) ||
Thread
bk commit into 5.1 tree (mikron:1.2100)mikael1 Feb