]> git.pld-linux.org Git - packages/mysql.git/commitdiff
- percona patches updated by Eero Hänninen; rel 2
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 16 Jul 2009 13:01:56 +0000 (13:01 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    mysql-gcc3.patch -> 1.1.2.2
    mysql-innodb_io_patches.patch -> 1.1.2.4
    mysql-innodb_io_pattern.patch -> 1.1.2.3
    mysql-innodb_locks_held.patch -> 1.1.2.4
    mysql-innodb_rw_lock.patch -> 1.1.2.3
    mysql-microsec_process.patch -> 1.1.2.3
    mysql-microslow_innodb.patch -> 1.1.2.9
    mysql-userstatv2.patch -> 1.1.2.9
    mysql-xtrabackup.patch -> 1.1.2.2
    mysql.spec -> 1.353.2.71

mysql-gcc3.patch
mysql-innodb_io_patches.patch
mysql-innodb_io_pattern.patch
mysql-innodb_locks_held.patch
mysql-innodb_rw_lock.patch
mysql-microsec_process.patch
mysql-microslow_innodb.patch
mysql-userstatv2.patch
mysql-xtrabackup.patch
mysql.spec

index 08154f555a412898ade0a0ddfb7a8bdd3b089e7c..b49bd0c9f822da11f9b5bafccec3b44f0dc487d0 100644 (file)
  #endif
  
  /* NOTE! The structure appears here only for the compiler to know its size.
+
+
+
+NOTE: this chunk is to fix buggy percona patch:
+--- mysql-5.0.83/innobase/sync/sync0rw.c~      2009-07-16 12:43:34.863559101 +0300
++++ mysql-5.0.83/innobase/sync/sync0rw.c       2009-07-16 13:01:55.553904932 +0300
+@@ -626,10 +626,14 @@
+       } else if (state == RW_LOCK_NOT_LOCKED) {
+               /* Spin waiting for the writer field to become free */
+-
++#ifdef  HAVE_ATOMIC_BUILTINS
+               while (i < SYNC_SPIN_ROUNDS
+                       && lock->lock_word != RW_LOCK_BIAS) {
+-                      if (srv_spin_wait_delay) {
++#else
++                              while (rw_lock_get_writer(lock) != RW_LOCK_NOT_LOCKED
++                                              && i < SYNC_SPIN_ROUNDS) {
++#endif
++                              if (srv_spin_wait_delay) {
+                               ut_delay(ut_rnd_interval(0,
+                                                       srv_spin_wait_delay));
+                       }
index 2677ed4545e2c500bd62c34236a31257cd7b29d9..8247a32678f991cdf16c62fd714c3639929b1cce 100644 (file)
@@ -1,6 +1,6 @@
-diff -ruN a/innobase/buf/buf0flu.c b/innobase/buf/buf0flu.c
---- a/innobase/buf/buf0flu.c   2008-12-19 02:19:35.000000000 +0900
-+++ b/innobase/buf/buf0flu.c   2009-01-09 15:51:10.000000000 +0900
+diff -r ed298a6e5e10 innobase/buf/buf0flu.c
+--- a/innobase/buf/buf0flu.c   Mon Jun 01 00:36:10 2009 -0700
++++ b/innobase/buf/buf0flu.c   Mon Jun 01 00:36:16 2009 -0700
 @@ -898,10 +898,17 @@
  
                                old_page_count = page_count;
@@ -19,10 +19,18 @@ diff -ruN a/innobase/buf/buf0flu.c b/innobase/buf/buf0flu.c
                                /* fprintf(stderr,
                                "Flush type %lu, page no %lu, neighb %lu\n",
                                flush_type, offset,
-diff -ruN a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c
---- a/innobase/buf/buf0rea.c   2009-01-09 15:40:22.000000000 +0900
-+++ b/innobase/buf/buf0rea.c   2009-01-09 15:40:46.000000000 +0900
-@@ -189,6 +189,10 @@
+diff -r ed298a6e5e10 innobase/buf/buf0rea.c
+--- a/innobase/buf/buf0rea.c   Mon Jun 01 00:36:10 2009 -0700
++++ b/innobase/buf/buf0rea.c   Mon Jun 01 00:36:16 2009 -0700
+@@ -20,6 +20,7 @@
+ #include "os0file.h"
+ #include "srv0start.h"
++extern uint srv_read_ahead;
+ extern ulint srv_read_ahead_rnd;
+ extern ulint srv_read_ahead_seq;
+ extern ulint srv_buf_pool_reads;
+@@ -189,6 +190,10 @@
        ulint           err;
        ulint           i;
  
@@ -33,7 +41,7 @@ diff -ruN a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c
        if (srv_startup_is_before_trx_rollback_phase) {
                /* No read-ahead to avoid thread deadlocks */
                return(0);
-@@ -396,6 +400,10 @@
+@@ -396,6 +401,10 @@
        ulint           err;
        ulint           i;
        
@@ -44,9 +52,9 @@ diff -ruN a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c
        if (srv_startup_is_before_trx_rollback_phase) {
                /* No read-ahead to avoid thread deadlocks */
                return(0);
-diff -ruN a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c
---- a/innobase/ibuf/ibuf0ibuf.c        2008-12-19 02:19:35.000000000 +0900
-+++ b/innobase/ibuf/ibuf0ibuf.c        2009-01-09 15:53:18.000000000 +0900
+diff -r ed298a6e5e10 innobase/ibuf/ibuf0ibuf.c
+--- a/innobase/ibuf/ibuf0ibuf.c        Mon Jun 01 00:36:10 2009 -0700
++++ b/innobase/ibuf/ibuf0ibuf.c        Mon Jun 01 00:36:16 2009 -0700
 @@ -370,8 +370,9 @@
        grow in size, as the references on the upper levels of the tree can
        change */
@@ -73,9 +81,9 @@ diff -ruN a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c
  
        sync = FALSE;
        
-diff -ruN a/innobase/include/os0file.h b/innobase/include/os0file.h
---- a/innobase/include/os0file.h       2009-01-09 15:40:22.000000000 +0900
-+++ b/innobase/include/os0file.h       2009-01-09 15:40:46.000000000 +0900
+diff -r ed298a6e5e10 innobase/include/os0file.h
+--- a/innobase/include/os0file.h       Mon Jun 01 00:36:10 2009 -0700
++++ b/innobase/include/os0file.h       Mon Jun 01 00:36:16 2009 -0700
 @@ -551,8 +551,10 @@
  /*========*/
        ulint   n,              /* in: maximum number of pending aio operations
@@ -89,9 +97,9 @@ diff -ruN a/innobase/include/os0file.h b/innobase/include/os0file.h
        ulint   n_slots_sync);  /* in: number of slots in the sync aio array */
  /***********************************************************************
  Requests an asynchronous i/o operation. */
-diff -ruN a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h
---- a/innobase/include/srv0srv.h       2009-01-09 15:40:22.000000000 +0900
-+++ b/innobase/include/srv0srv.h       2009-01-09 15:54:33.000000000 +0900
+diff -r ed298a6e5e10 innobase/include/srv0srv.h
+--- a/innobase/include/srv0srv.h       Mon Jun 01 00:36:10 2009 -0700
++++ b/innobase/include/srv0srv.h       Mon Jun 01 00:36:16 2009 -0700
 @@ -89,6 +89,8 @@
  extern ulint  srv_lock_table_size;
  
@@ -101,7 +109,7 @@ diff -ruN a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h
  
  #ifdef UNIV_LOG_ARCHIVE
  extern ibool  srv_log_archive_on;
-@@ -133,6 +135,14 @@
+@@ -133,6 +135,15 @@
  extern ulong  srv_max_purge_lag;
  extern ibool  srv_use_awe;
  extern ibool  srv_use_adaptive_hash_indexes;
@@ -111,14 +119,15 @@ diff -ruN a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h
 +extern ulint  srv_ibuf_active_contract;
 +extern ulint  srv_ibuf_accel_rate;
 +extern ulint  srv_flush_neighbor_pages;
++extern ulint  srv_enable_unsafe_group_commit;
 +extern uint   srv_read_ahead;
 +extern ulint  srv_adaptive_checkpoint;
  /*-------------------------------------------*/
  
  extern ulint  srv_n_rows_inserted;
-diff -ruN a/innobase/log/log0log.c b/innobase/log/log0log.c
---- a/innobase/log/log0log.c   2008-12-19 02:19:36.000000000 +0900
-+++ b/innobase/log/log0log.c   2009-01-09 15:40:46.000000000 +0900
+diff -r ed298a6e5e10 innobase/log/log0log.c
+--- a/innobase/log/log0log.c   Mon Jun 01 00:36:10 2009 -0700
++++ b/innobase/log/log0log.c   Mon Jun 01 00:36:16 2009 -0700
 @@ -3326,6 +3326,15 @@
                        (ulong) ut_dulint_get_high(log_sys->last_checkpoint_lsn),
                        (ulong) ut_dulint_get_low(log_sys->last_checkpoint_lsn));
@@ -135,10 +144,10 @@ diff -ruN a/innobase/log/log0log.c b/innobase/log/log0log.c
        current_time = time(NULL);
                        
        time_elapsed = 0.001 + difftime(current_time,
-diff -ruN a/innobase/os/os0file.c b/innobase/os/os0file.c
---- a/innobase/os/os0file.c    2009-01-09 15:40:23.000000000 +0900
-+++ b/innobase/os/os0file.c    2009-01-09 15:40:46.000000000 +0900
-@@ -2877,8 +2877,10 @@
+diff -r ed298a6e5e10 innobase/os/os0file.c
+--- a/innobase/os/os0file.c    Mon Jun 01 00:36:10 2009 -0700
++++ b/innobase/os/os0file.c    Mon Jun 01 00:36:16 2009 -0700
+@@ -2878,8 +2878,10 @@
  /*========*/
        ulint   n,              /* in: maximum number of pending aio operations
                                allowed; n must be divisible by n_segments */
@@ -151,7 +160,7 @@ diff -ruN a/innobase/os/os0file.c b/innobase/os/os0file.c
        ulint   n_slots_sync)   /* in: number of slots in the sync aio array */
  {
        ulint   n_read_segs;
-@@ -2888,6 +2890,8 @@
+@@ -2889,6 +2891,8 @@
  #ifdef POSIX_ASYNC_IO
        sigset_t   sigset;
  #endif
@@ -160,7 +169,7 @@ diff -ruN a/innobase/os/os0file.c b/innobase/os/os0file.c
        ut_ad(n % n_segments == 0);
        ut_ad(n_segments >= 4);
  
-@@ -2898,8 +2902,8 @@
+@@ -2899,8 +2903,8 @@
        }
  
        n_per_seg = n / n_segments;
@@ -171,7 +180,7 @@ diff -ruN a/innobase/os/os0file.c b/innobase/os/os0file.c
        
        /* fprintf(stderr, "Array n per seg %lu\n", n_per_seg); */
  
-@@ -3180,6 +3184,13 @@
+@@ -3181,6 +3185,13 @@
        struct aiocb*   control;
  #endif
        ulint           i;
@@ -185,7 +194,7 @@ diff -ruN a/innobase/os/os0file.c b/innobase/os/os0file.c
  loop:
        os_mutex_enter(array->mutex);
  
-@@ -3198,6 +3209,16 @@
+@@ -3199,6 +3210,16 @@
                goto loop;
        }
  
@@ -202,7 +211,7 @@ diff -ruN a/innobase/os/os0file.c b/innobase/os/os0file.c
        for (i = 0;; i++) {
                slot = os_aio_array_get_nth_slot(array, i);
  
-@@ -3205,6 +3226,7 @@
+@@ -3206,6 +3227,7 @@
                        break;
                }
        }
@@ -210,9 +219,9 @@ diff -ruN a/innobase/os/os0file.c b/innobase/os/os0file.c
  
        array->n_reserved++;
  
-diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
---- a/innobase/srv/srv0srv.c   2009-01-09 15:40:23.000000000 +0900
-+++ b/innobase/srv/srv0srv.c   2009-01-09 15:58:36.000000000 +0900
+diff -r ed298a6e5e10 innobase/srv/srv0srv.c
+--- a/innobase/srv/srv0srv.c   Mon Jun 01 00:36:10 2009 -0700
++++ b/innobase/srv/srv0srv.c   Mon Jun 01 00:36:16 2009 -0700
 @@ -167,6 +167,8 @@
  ulint srv_lock_table_size     = ULINT_MAX;
  
@@ -222,7 +231,7 @@ diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
  
  #ifdef UNIV_LOG_ARCHIVE
  ibool srv_log_archive_on      = FALSE;
-@@ -324,6 +326,22 @@
+@@ -330,6 +332,24 @@
  ibool srv_use_awe                     = FALSE;
  ibool srv_use_adaptive_hash_indexes   = TRUE;
  
@@ -240,12 +249,14 @@ diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
 +
 +ulint srv_flush_neighbor_pages = 1; /* 0:disable 1:enable */
 +
++ulint srv_enable_unsafe_group_commit = 0; /* 0:disable 1:enable */
++
 +uint  srv_read_ahead = 3; /* 1: random  2: linear  3: Both */
 +ulint srv_adaptive_checkpoint = 0; /* 0:disable 1:enable */
  /*-------------------------------------------*/
  ulong srv_n_spin_wait_rounds  = 20;
  ulong srv_n_free_tickets_to_enter = 500;
-@@ -2214,6 +2232,8 @@
+@@ -2229,6 +2249,8 @@
        ibool           skip_sleep      = FALSE;
        ulint           i;
        
@@ -254,7 +265,7 @@ diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
  #ifdef UNIV_DEBUG_THREAD_CREATION
        fprintf(stderr, "Master thread starts, id %lu\n",
                              os_thread_pf(os_thread_get_curr_id()));
-@@ -2302,9 +2322,9 @@
+@@ -2317,9 +2339,9 @@
                                                + log_sys->n_pending_writes;
                n_ios = log_sys->n_log_ios + buf_pool->n_pages_read
                                                + buf_pool->n_pages_written;
@@ -266,7 +277,7 @@ diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
  
                        srv_main_thread_op_info = "flushing log";
  
-@@ -2317,7 +2337,7 @@
+@@ -2332,7 +2354,7 @@
                        /* Try to keep the number of modified pages in the
                        buffer pool under the limit wished by the user */
                        
@@ -275,7 +286,7 @@ diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
                                                          ut_dulint_max);
  
                        /* If we had to do the flush, it may have taken
-@@ -2326,6 +2346,49 @@
+@@ -2341,6 +2363,49 @@
                        iteration of this loop. */
                             
                        skip_sleep = TRUE;
@@ -325,7 +336,7 @@ diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
                }
  
                if (srv_activity_count == old_activity_count) {
-@@ -2352,10 +2415,10 @@
+@@ -2367,10 +2432,10 @@
        n_pend_ios = buf_get_n_pending_ios() + log_sys->n_pending_writes;
        n_ios = log_sys->n_log_ios + buf_pool->n_pages_read
                                                + buf_pool->n_pages_written;
@@ -338,7 +349,7 @@ diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
  
                srv_main_thread_op_info = "flushing log";
                log_buffer_flush_to_disk();
-@@ -2365,7 +2428,7 @@
+@@ -2380,7 +2445,7 @@
        even if the server were active */
  
        srv_main_thread_op_info = "doing insert buffer merge";
@@ -347,7 +358,7 @@ diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
  
        srv_main_thread_op_info = "flushing log";
        log_buffer_flush_to_disk();
-@@ -2407,14 +2470,14 @@
+@@ -2422,14 +2487,14 @@
                (> 70 %), we assume we can afford reserving the disk(s) for
                the time it requires to flush 100 pages */
  
@@ -364,7 +375,7 @@ diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
                                                        ut_dulint_max);
        }
  
-@@ -2503,7 +2566,7 @@
+@@ -2518,7 +2583,7 @@
        if (srv_fast_shutdown && srv_shutdown_state > 0) {
                n_bytes_merged = 0;
        } else {
@@ -373,7 +384,7 @@ diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
        }
  
        srv_main_thread_op_info = "reserving kernel mutex";
-@@ -2520,7 +2583,7 @@
+@@ -2535,7 +2600,7 @@
  
        if (srv_fast_shutdown < 2) {
                n_pages_flushed =
@@ -382,9 +393,9 @@ diff -ruN a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
        } else {
                /* In the fastest shutdown we do not flush the buffer pool
                to data files: we set n_pages_flushed to 0 artificially. */
-diff -ruN a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
---- a/innobase/srv/srv0start.c 2008-12-19 02:19:37.000000000 +0900
-+++ b/innobase/srv/srv0start.c 2009-01-09 15:40:46.000000000 +0900
+diff -r ed298a6e5e10 innobase/srv/srv0start.c
+--- a/innobase/srv/srv0start.c Mon Jun 01 00:36:10 2009 -0700
++++ b/innobase/srv/srv0start.c Mon Jun 01 00:36:16 2009 -0700
 @@ -1205,24 +1205,28 @@
                return(DB_ERROR);
        }
@@ -418,9 +429,9 @@ diff -ruN a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
                                        SRV_MAX_N_PENDING_SYNC_IOS);
        }
        
-diff -ruN a/patch_info/innodb_io_patches.info b/patch_info/innodb_io_patches.info
---- /dev/null  1970-01-01 09:00:00.000000000 +0900
-+++ b/patch_info/innodb_io_patches.info        2009-01-09 15:59:05.000000000 +0900
+diff -r ed298a6e5e10 patch_info/innodb_io_patches.info
+--- /dev/null  Thu Jan 01 00:00:00 1970 +0000
++++ b/patch_info/innodb_io_patches.info        Mon Jun 01 00:36:16 2009 -0700
 @@ -0,0 +1,11 @@
 +File=innodb_io_patches.patch
 +Name=Cluster of past InnoDB IO patches
@@ -433,9 +444,9 @@ diff -ruN a/patch_info/innodb_io_patches.info b/patch_info/innodb_io_patches.inf
 +YK: Initial release
 +2009-01-09
 +YK: Some parameters are added
-diff -ruN a/sql/ha_innodb.cc b/sql/ha_innodb.cc
---- a/sql/ha_innodb.cc 2009-01-09 15:40:23.000000000 +0900
-+++ b/sql/ha_innodb.cc 2009-01-09 15:40:46.000000000 +0900
+diff -r ed298a6e5e10 sql/ha_innodb.cc
+--- a/sql/ha_innodb.cc Mon Jun 01 00:36:10 2009 -0700
++++ b/sql/ha_innodb.cc Mon Jun 01 00:36:16 2009 -0700
 @@ -149,6 +149,7 @@
       innobase_lock_wait_timeout, innobase_force_recovery,
       innobase_open_files;
@@ -444,7 +455,7 @@ diff -ruN a/sql/ha_innodb.cc b/sql/ha_innodb.cc
  longlong innobase_buffer_pool_size, innobase_log_file_size;
  
  /* The default values for the following char* start-up parameters
-@@ -1403,6 +1404,8 @@
+@@ -1417,6 +1418,8 @@
        srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size;
  
        srv_n_file_io_threads = (ulint) innobase_file_io_threads;
@@ -453,9 +464,20 @@ diff -ruN a/sql/ha_innodb.cc b/sql/ha_innodb.cc
  
        srv_lock_wait_timeout = (ulint) innobase_lock_wait_timeout;
        srv_force_recovery = (ulint) innobase_force_recovery;
-diff -ruN a/sql/ha_innodb.h b/sql/ha_innodb.h
---- a/sql/ha_innodb.h  2009-01-09 15:40:23.000000000 +0900
-+++ b/sql/ha_innodb.h  2009-01-09 15:59:41.000000000 +0900
+@@ -7330,6 +7333,10 @@
+         trx_t* trx = check_trx_exists(thd);
+         if (thd->lex->sql_command != SQLCOM_XA_PREPARE) {
++              if (srv_enable_unsafe_group_commit && !thd->variables.innodb_support_xa) {
++                      /* choose group commit rather than binlog order */
++                      return(0);
++              }
+                 /* For ibbackup to work the order of transactions in binlog
+                 and InnoDB must be the same. Consider the situation
+diff -r ed298a6e5e10 sql/ha_innodb.h
+--- a/sql/ha_innodb.h  Mon Jun 01 00:36:10 2009 -0700
++++ b/sql/ha_innodb.h  Mon Jun 01 00:36:16 2009 -0700
 @@ -204,6 +204,7 @@
  extern long innobase_additional_mem_pool_size;
  extern long innobase_buffer_pool_awe_mem_mb;
@@ -464,24 +486,26 @@ diff -ruN a/sql/ha_innodb.h b/sql/ha_innodb.h
  extern long innobase_force_recovery;
  extern long innobase_open_files;
  extern char *innobase_data_home_dir, *innobase_data_file_path;
-@@ -234,6 +235,13 @@
- running with the fix disabled because MySQL 5.1 is frozen for such
- behavioral changes. */
- extern char srv_use_legacy_cardinality_algorithm;
+@@ -234,6 +235,15 @@
+ extern ulong srv_thread_concurrency;
+ extern ulong srv_commit_concurrency;
+ extern ulong srv_flush_log_at_trx_commit;
 +extern ulong srv_io_capacity;
 +extern long long srv_ibuf_max_size;
 +extern ulong srv_ibuf_active_contract;
 +extern ulong srv_ibuf_accel_rate;
 +extern ulong srv_flush_neighbor_pages;
++extern ulong srv_enable_unsafe_group_commit;
 +extern uint srv_read_ahead;
 +extern ulong srv_adaptive_checkpoint;
- }
- bool innobase_init(void);
-diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
---- a/sql/mysqld.cc    2009-01-09 15:40:23.000000000 +0900
-+++ b/sql/mysqld.cc    2009-01-09 16:01:25.000000000 +0900
-@@ -5036,6 +5036,15 @@
++
+ /* An option to enable the fix for "Bug#43660 SHOW INDEXES/ANALYZE does
+ NOT update cardinality for indexes of InnoDB table". By default we are
+ running with the fix disabled because MySQL 5.1 is frozen for such
+diff -r ed298a6e5e10 sql/mysqld.cc
+--- a/sql/mysqld.cc    Mon Jun 01 00:36:10 2009 -0700
++++ b/sql/mysqld.cc    Mon Jun 01 00:36:16 2009 -0700
+@@ -5086,6 +5086,16 @@
    OPT_INNODB_ROLLBACK_ON_TIMEOUT,
    OPT_SECURE_FILE_PRIV,
    OPT_KEEP_FILES_ON_CREATE,
@@ -490,16 +514,17 @@ diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
 +  OPT_INNODB_IBUF_ACTIVE_CONTRACT,
 +  OPT_INNODB_IBUF_ACCEL_RATE,
 +  OPT_INNODB_FLUSH_NEIGHBOR_PAGES,
++  OPT_INNODB_ENABLE_UNSAFE_GROUP_COMMIT,
 +  OPT_INNODB_READ_AHEAD,
 +  OPT_INNODB_ADAPTIVE_CHECKPOINT,
 +  OPT_INNODB_READ_IO_THREADS,
 +  OPT_INNODB_WRITE_IO_THREADS,
    OPT_INNODB_ADAPTIVE_HASH_INDEX,
-   OPT_FEDERATED
- };
-@@ -5344,6 +5353,41 @@
-    (gptr*) &global_system_variables.innodb_table_locks,
-    (gptr*) &global_system_variables.innodb_table_locks,
+   OPT_FEDERATED,
+   OPT_INNODB_USE_LEGACY_CARDINALITY_ALGORITHM
+@@ -5403,6 +5413,45 @@
+    (gptr*) &srv_use_legacy_cardinality_algorithm,
+    (gptr*) &srv_use_legacy_cardinality_algorithm,
     0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
 +  {"innodb_io_capacity", OPT_INNODB_IO_CAPACITY,
 +   "Number of IO operations per second the server can do. Tunes background IO rate.",
@@ -528,6 +553,10 @@ diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
 +   "Enable/Diasable flushing along modified age. 0:disable 1:enable",
 +   (gptr*) &srv_adaptive_checkpoint, (gptr*) &srv_adaptive_checkpoint,
 +   0, GET_ULONG, REQUIRED_ARG, 0, 0, 1, 0, 0, 0},
++  {"innodb_enable_unsafe_group_commit", OPT_INNODB_ENABLE_UNSAFE_GROUP_COMMIT,
++   "Enable/Disable unsafe group commit when support_xa=OFF and use with binlog or other XA storage engine.",
++   (gptr*) &srv_enable_unsafe_group_commit, (gptr*) &srv_enable_unsafe_group_commit,
++   0, GET_ULONG, REQUIRED_ARG, 0, 0, 1, 0, 0, 0},
 +  {"innodb_read_io_threads", OPT_INNODB_READ_IO_THREADS,
 +   "Number of background read I/O threads in InnoDB.",
 +   (gptr*) &innobase_read_io_threads, (gptr*) &innobase_read_io_threads,
@@ -539,7 +568,7 @@ diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
  #endif /* End HAVE_INNOBASE_DB */
    {"isam", OPT_ISAM, "Obsolete. ISAM storage engine is no longer supported.",
     (gptr*) &opt_isam, (gptr*) &opt_isam, 0, GET_BOOL, NO_ARG, 0, 0, 0,
-@@ -7637,6 +7636,22 @@
+@@ -7644,6 +7693,22 @@
    case OPT_INNODB_LOG_ARCHIVE:
      innobase_log_archive= argument ? test(atoi(argument)) : 1;
      break;
@@ -562,10 +591,10 @@ diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
  #endif /* HAVE_INNOBASE_DB */
    case OPT_MYISAM_RECOVER:
    {
-diff -ruN a/sql/set_var.cc b/sql/set_var.cc
---- a/sql/set_var.cc   2009-01-09 15:40:23.000000000 +0900
-+++ b/sql/set_var.cc   2009-01-09 16:05:22.000000000 +0900
-@@ -484,6 +484,37 @@
+diff -r ed298a6e5e10 sql/set_var.cc
+--- a/sql/set_var.cc   Mon Jun 01 00:36:10 2009 -0700
++++ b/sql/set_var.cc   Mon Jun 01 00:36:16 2009 -0700
+@@ -489,6 +489,39 @@
  sys_var_long_ptr  sys_innodb_flush_log_at_trx_commit(
                                          "innodb_flush_log_at_trx_commit",
                                          &srv_flush_log_at_trx_commit);
@@ -598,12 +627,14 @@ diff -ruN a/sql/set_var.cc b/sql/set_var.cc
 +};
 +sys_var_enum  sys_innodb_read_ahead("innodb_read_ahead", &srv_read_ahead,
 +                                      &innodb_read_ahead_typelib, fix_innodb_read_ahead);
++sys_var_long_ptr      sys_innodb_enable_unsafe_group_commit("innodb_enable_unsafe_group_commit",
++                                                             &srv_enable_unsafe_group_commit);
 +sys_var_long_ptr      sys_innodb_adaptive_checkpoint("innodb_adaptive_checkpoint",
 +                                                      &srv_adaptive_checkpoint);
  sys_var_const_os_str_ptr sys_innodb_data_file_path("innodb_data_file_path", 
                                                 &innobase_data_file_path);
  sys_var_const_os_str_ptr sys_innodb_data_home_dir("innodb_data_home_dir", 
-@@ -847,6 +859,12 @@
+@@ -860,6 +893,13 @@
    &sys_innodb_thread_concurrency,
    &sys_innodb_commit_concurrency,
    &sys_innodb_flush_log_at_trx_commit,
@@ -612,30 +643,32 @@ diff -ruN a/sql/set_var.cc b/sql/set_var.cc
 +  &sys_innodb_ibuf_accel_rate,
 +  &sys_innodb_flush_neighbor_pages,
 +  &sys_innodb_read_ahead,
++  &sys_innodb_enable_unsafe_group_commit,
 +  &sys_innodb_adaptive_checkpoint,
  #endif
    &sys_trust_routine_creators,
    &sys_trust_function_creators,
-@@ -982,6 +1000,15 @@
+@@ -997,6 +1037,16 @@
+   {sys_innodb_table_locks.name, (char*) &sys_innodb_table_locks, SHOW_SYS},
+   {sys_innodb_thread_concurrency.name, (char*) &sys_innodb_thread_concurrency, SHOW_SYS},
    {sys_innodb_thread_sleep_delay.name, (char*) &sys_innodb_thread_sleep_delay, SHOW_SYS},
-   {sys_innodb_use_legacy_cardinality_algorithm.name,
-    (char*) &sys_innodb_use_legacy_cardinality_algorithm, SHOW_SYS},
 +  {sys_innodb_io_capacity.name, (char*) &sys_innodb_io_capacity, SHOW_SYS},
 +  {"innodb_ibuf_max_size", (char*) &srv_ibuf_max_size, SHOW_LONGLONG},
 +  {sys_innodb_ibuf_active_contract.name, (char*) &sys_innodb_ibuf_active_contract, SHOW_SYS},
 +  {sys_innodb_ibuf_accel_rate.name, (char*) &sys_innodb_ibuf_accel_rate, SHOW_SYS},
 +  {sys_innodb_flush_neighbor_pages.name, (char*) &sys_innodb_flush_neighbor_pages, SHOW_SYS},
 +  {sys_innodb_read_ahead.name, (char*) &sys_innodb_read_ahead, SHOW_SYS},
++  {sys_innodb_enable_unsafe_group_commit.name, (char*) &sys_innodb_enable_unsafe_group_commit, SHOW_SYS},
 +  {sys_innodb_adaptive_checkpoint.name, (char*) &sys_innodb_adaptive_checkpoint, SHOW_SYS},
 +  {"innodb_read_io_threads", (char*) &innobase_read_io_threads, SHOW_LONG},
 +  {"innodb_write_io_threads", (char*) &innobase_write_io_threads, SHOW_LONG},
+   {sys_innodb_use_legacy_cardinality_algorithm.name,
+    (char*) &sys_innodb_use_legacy_cardinality_algorithm, SHOW_SYS},
  #endif
-   {sys_interactive_timeout.name,(char*) &sys_interactive_timeout,   SHOW_SYS},
-   {sys_join_buffer_size.name,   (char*) &sys_join_buffer_size,            SHOW_SYS},
-@@ -1482,6 +1501,13 @@
+@@ -1459,6 +1509,13 @@
    }
  }
-
 +#ifdef HAVE_INNOBASE_DB
 +extern void fix_innodb_read_ahead(THD *thd, enum_var_type type)
 +{
@@ -646,13 +679,13 @@ diff -ruN a/sql/set_var.cc b/sql/set_var.cc
  static void fix_max_binlog_size(THD *thd, enum_var_type type)
  {
    DBUG_ENTER("fix_max_binlog_size");
-diff -ruN a/sql/set_var.h b/sql/set_var.h
---- a/sql/set_var.h    2009-01-12 11:20:31.000000000 +0900
-+++ b/sql/set_var.h    2009-01-12 15:26:35.000000000 +0900
+diff -r ed298a6e5e10 sql/set_var.h
+--- a/sql/set_var.h    Mon Jun 01 00:36:10 2009 -0700
++++ b/sql/set_var.h    Mon Jun 01 00:36:16 2009 -0700
 @@ -31,6 +31,10 @@
-
  extern TYPELIB bool_typelib, delay_key_write_typelib, sql_mode_typelib;
-
 +#ifdef HAVE_INNOBASE_DB
 +extern TYPELIB innodb_read_ahead_typelib;
 +#endif /* HAVE_INNOBASE_DB */
@@ -660,7 +693,7 @@ diff -ruN a/sql/set_var.h b/sql/set_var.h
  typedef int (*sys_check_func)(THD *,  set_var *);
  typedef bool (*sys_update_func)(THD *, set_var *);
  typedef void (*sys_after_update_func)(THD *,enum_var_type);
-@@ -1114,6 +1118,9 @@
+@@ -1148,6 +1152,9 @@
  int sql_set_variables(THD *thd, List<set_var_base> *var_list);
  bool not_all_support_one_shot(List<set_var_base> *var_list);
  void fix_delay_key_write(THD *thd, enum_var_type type);
index 26c9b69ac67bc6793401bd5bbece277902f16f27..305f63dfb221301653ab1a6f9b45b24ceaf4e1ad 100644 (file)
@@ -382,16 +382,16 @@ diff -r 5060df9888d7 sql/ha_innodb.cc
 diff -r 5060df9888d7 sql/ha_innodb.h
 --- a/sql/ha_innodb.h  Tue Feb 17 22:33:54 2009 -0800
 +++ b/sql/ha_innodb.h  Tue Feb 17 22:33:58 2009 -0800
-@@ -244,6 +244,9 @@
+@@ -245,6 +245,9 @@
  extern ulong srv_adaptive_checkpoint;
  extern ulong srv_show_locks_held;
  extern ulong srv_show_verbose_locks;
 +extern ulong srv_io_pattern_trace;
 +extern ulong srv_io_pattern_trace_running;
 +extern ulong srv_io_pattern_size_limit;
- }
- bool innobase_init(void);
+
+ /* An option to enable the fix for "Bug#43660 SHOW INDEXES/ANALYZE does
+ NOT update cardinality for indexes of InnoDB table". By default we are
 @@ -270,6 +273,9 @@
  bool innodb_I_S_buffer_pool_content(THD* thd, TABLE_LIST *tables);
  bool innodb_mutex_show_status(THD* thd);
@@ -471,16 +471,16 @@ diff -r 5060df9888d7 sql/set_var.cc
  #endif
    &sys_trust_routine_creators,
    &sys_trust_function_creators,
-@@ -1047,6 +1056,9 @@
+@@ -1072,6 +1072,9 @@
    {sys_innodb_adaptive_checkpoint.name, (char*) &sys_innodb_adaptive_checkpoint, SHOW_SYS},
    {"innodb_read_io_threads", (char*) &innobase_read_io_threads, SHOW_LONG},
    {"innodb_write_io_threads", (char*) &innobase_write_io_threads, SHOW_LONG},
 +  {sys_innodb_io_pattern_trace.name, (char*) &sys_innodb_io_pattern_trace, SHOW_SYS},
 +  {sys_innodb_io_pattern_trace_running.name, (char*) &sys_innodb_io_pattern_trace_running, SHOW_SYS},
 +  {sys_innodb_io_pattern_size_limit.name, (char*) &sys_innodb_io_pattern_size_limit, SHOW_SYS},
+   {sys_innodb_use_legacy_cardinality_algorithm.name,
+    (char*) &sys_innodb_use_legacy_cardinality_algorithm, SHOW_SYS},
  #endif
-   {sys_interactive_timeout.name,(char*) &sys_interactive_timeout,   SHOW_SYS},
-   {sys_join_buffer_size.name,   (char*) &sys_join_buffer_size,            SHOW_SYS},
 @@ -3160,6 +3172,19 @@
      thd->variables.lc_time_names= global_system_variables.lc_time_names;
  }
index a4ae8ab8c935973a2b799deee2b6817c95e170eb..65ac766e0d110c82e34190ea29c2907cdc17e772 100644 (file)
@@ -1,6 +1,6 @@
-diff -r 7d3d7786b927 innobase/include/srv0srv.h
---- a/innobase/include/srv0srv.h       Tue Feb 17 22:33:33 2009 -0800
-+++ b/innobase/include/srv0srv.h       Tue Feb 17 22:33:47 2009 -0800
+diff -r e9fb5b8bcf78 innobase/include/srv0srv.h
+--- a/innobase/include/srv0srv.h       Mon Jun 01 00:36:33 2009 -0700
++++ b/innobase/include/srv0srv.h       Mon Jun 01 00:36:41 2009 -0700
 @@ -80,6 +80,8 @@
  extern ulint  srv_log_file_size;
  extern ulint  srv_log_buffer_size;
@@ -10,9 +10,9 @@ diff -r 7d3d7786b927 innobase/include/srv0srv.h
  
  extern byte   srv_latin1_ordering[256];/* The sort order table of the latin1
                                        character set */
-diff -r 7d3d7786b927 innobase/lock/lock0lock.c
---- a/innobase/lock/lock0lock.c        Tue Feb 17 22:33:33 2009 -0800
-+++ b/innobase/lock/lock0lock.c        Tue Feb 17 22:33:47 2009 -0800
+diff -r e9fb5b8bcf78 innobase/lock/lock0lock.c
+--- a/innobase/lock/lock0lock.c        Mon Jun 01 00:36:33 2009 -0700
++++ b/innobase/lock/lock0lock.c        Mon Jun 01 00:36:41 2009 -0700
 @@ -4181,6 +4181,7 @@
  #endif /* UNIV_SYNC_DEBUG */
        }
@@ -50,9 +50,9 @@ diff -r 7d3d7786b927 innobase/lock/lock0lock.c
                        file);
        
                nth_trx++;
-diff -r 7d3d7786b927 innobase/srv/srv0srv.c
---- a/innobase/srv/srv0srv.c   Tue Feb 17 22:33:33 2009 -0800
-+++ b/innobase/srv/srv0srv.c   Tue Feb 17 22:33:47 2009 -0800
+diff -r e9fb5b8bcf78 innobase/srv/srv0srv.c
+--- a/innobase/srv/srv0srv.c   Mon Jun 01 00:36:33 2009 -0700
++++ b/innobase/srv/srv0srv.c   Mon Jun 01 00:36:41 2009 -0700
 @@ -116,6 +116,8 @@
  ulint srv_log_file_size       = ULINT_MAX;    /* size in database pages */ 
  ulint srv_log_buffer_size     = ULINT_MAX;    /* size in database pages */ 
@@ -62,7 +62,7 @@ diff -r 7d3d7786b927 innobase/srv/srv0srv.c
  
  byte  srv_latin1_ordering[256]        /* The sort order table of the latin1
                                        character set. The following table is
-@@ -1703,24 +1705,6 @@
+@@ -1711,24 +1713,6 @@
  
        mutex_exit(&dict_foreign_err_mutex);
  
@@ -87,11 +87,10 @@ diff -r 7d3d7786b927 innobase/srv/srv0srv.c
        fputs("--------\n"
                "FILE I/O\n"
                "--------\n", file);
-@@ -1813,6 +1797,25 @@
-       srv_n_rows_updated_old = srv_n_rows_updated;
+@@ -1822,6 +1806,25 @@
        srv_n_rows_deleted_old = srv_n_rows_deleted;
        srv_n_rows_read_old = srv_n_rows_read;
-+
 +      lock_print_info_summary(file);
 +      if (trx_start) {
 +              long    t = ftell(file);
@@ -110,13 +109,14 @@ diff -r 7d3d7786b927 innobase/srv/srv0srv.c
 +                      *trx_end = (ulint) t;
 +              }
 +      }
++
    fputs("----------------------------\n"
                       "END OF INNODB MONITOR OUTPUT\n"
-diff -r 7d3d7786b927 libmysqld/set_var.cc
---- a/libmysqld/set_var.cc     Tue Feb 17 22:33:33 2009 -0800
-+++ b/libmysqld/set_var.cc     Tue Feb 17 22:33:47 2009 -0800
-@@ -821,6 +821,8 @@
+               "============================\n", file);
+diff -r e9fb5b8bcf78 libmysqld/set_var.cc
+--- a/libmysqld/set_var.cc     Mon Jun 01 00:36:33 2009 -0700
++++ b/libmysqld/set_var.cc     Mon Jun 01 00:36:41 2009 -0700
+@@ -825,6 +825,8 @@
    &sys_innodb_thread_concurrency,
    &sys_innodb_commit_concurrency,
    &sys_innodb_flush_log_at_trx_commit,
@@ -125,7 +125,7 @@ diff -r 7d3d7786b927 libmysqld/set_var.cc
  #endif
    &sys_trust_routine_creators,
    &sys_trust_function_creators,
-@@ -936,6 +938,8 @@
+@@ -942,6 +944,8 @@
    {"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG },
    {"innodb_file_per_table", (char*) &innobase_file_per_table, SHOW_MY_BOOL},
    {sys_innodb_flush_log_at_trx_commit.name, (char*) &sys_innodb_flush_log_at_trx_commit, SHOW_SYS},
@@ -134,9 +134,9 @@ diff -r 7d3d7786b927 libmysqld/set_var.cc
    {"innodb_flush_method",    (char*) &innobase_unix_file_flush_method, SHOW_CHAR_PTR},
    {"innodb_force_recovery", (char*) &innobase_force_recovery, SHOW_LONG },
    {"innodb_lock_wait_timeout", (char*) &innobase_lock_wait_timeout, SHOW_LONG },
-diff -r 7d3d7786b927 patch_info/innodb_locks_held.info
+diff -r e9fb5b8bcf78 patch_info/innodb_locks_held.info
 --- /dev/null  Thu Jan 01 00:00:00 1970 +0000
-+++ b/patch_info/innodb_locks_held.info        Tue Feb 17 22:33:47 2009 -0800
++++ b/patch_info/innodb_locks_held.info        Mon Jun 01 00:36:41 2009 -0700
 @@ -0,0 +1,6 @@
 +File=innodb_locks_held.patch
 +Name=Add locks held, remove locked records in SHOW INNODB STATUS
@@ -144,22 +144,22 @@ diff -r 7d3d7786b927 patch_info/innodb_locks_held.info
 +Author=Baron Schwartz <baron@xaprb.com>
 +License=GPL
 +Comment=Bug #29126 fix
-diff -r 7d3d7786b927 sql/ha_innodb.h
---- a/sql/ha_innodb.h  Tue Feb 17 22:33:33 2009 -0800
-+++ b/sql/ha_innodb.h  Tue Feb 17 22:33:47 2009 -0800
-@@ -242,6 +242,8 @@
- extern ulong srv_flush_neighbor_pages;
+diff -r e9fb5b8bcf78 sql/ha_innodb.h
+--- a/sql/ha_innodb.h  Mon Jun 01 00:36:33 2009 -0700
++++ b/sql/ha_innodb.h  Mon Jun 01 00:36:41 2009 -0700
+@@ -243,6 +243,8 @@
+ extern ulong srv_enable_unsafe_group_commit;
  extern uint srv_read_ahead;
  extern ulong srv_adaptive_checkpoint;
 +extern ulong srv_show_locks_held;
 +extern ulong srv_show_verbose_locks;
- }
  
- bool innobase_init(void);
-diff -r 7d3d7786b927 sql/mysqld.cc
---- a/sql/mysqld.cc    Tue Feb 17 22:33:33 2009 -0800
-+++ b/sql/mysqld.cc    Tue Feb 17 22:33:47 2009 -0800
-@@ -5012,6 +5012,8 @@
+ /* An option to enable the fix for "Bug#43660 SHOW INDEXES/ANALYZE does
+ NOT update cardinality for indexes of InnoDB table". By default we are
+diff -r e9fb5b8bcf78 sql/mysqld.cc
+--- a/sql/mysqld.cc    Mon Jun 01 00:36:33 2009 -0700
++++ b/sql/mysqld.cc    Mon Jun 01 00:36:41 2009 -0700
+@@ -5016,6 +5016,8 @@
    OPT_INNODB_MAX_PURGE_LAG,
    OPT_INNODB_FILE_IO_THREADS,
    OPT_INNODB_LOCK_WAIT_TIMEOUT,
@@ -168,7 +168,7 @@ diff -r 7d3d7786b927 sql/mysqld.cc
    OPT_INNODB_THREAD_CONCURRENCY,
    OPT_INNODB_COMMIT_CONCURRENCY,
    OPT_INNODB_FORCE_RECOVERY,
-@@ -5356,6 +5358,14 @@
+@@ -5364,6 +5366,14 @@
     (gptr*) &srv_flush_log_at_trx_commit,
     (gptr*) &srv_flush_log_at_trx_commit,
     0, GET_ULONG, OPT_ARG,  1, 0, 2, 0, 0, 0},
@@ -183,11 +183,11 @@ diff -r 7d3d7786b927 sql/mysqld.cc
    {"innodb_flush_method", OPT_INNODB_FLUSH_METHOD,
     "With which method to flush data.", (gptr*) &innobase_unix_file_flush_method,
     (gptr*) &innobase_unix_file_flush_method, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
-diff -r 7d3d7786b927 sql/set_var.cc
---- a/sql/set_var.cc   Tue Feb 17 22:33:33 2009 -0800
-+++ b/sql/set_var.cc   Tue Feb 17 22:33:47 2009 -0800
-@@ -522,6 +522,12 @@
-                                       &innodb_read_ahead_typelib, fix_innodb_read_ahead);
+diff -r e9fb5b8bcf78 sql/set_var.cc
+--- a/sql/set_var.cc   Mon Jun 01 00:36:33 2009 -0700
++++ b/sql/set_var.cc   Mon Jun 01 00:36:41 2009 -0700
+@@ -527,6 +527,12 @@
+                                                              &srv_enable_unsafe_group_commit);
  sys_var_long_ptr      sys_innodb_adaptive_checkpoint("innodb_adaptive_checkpoint",
                                                        &srv_adaptive_checkpoint);
 +sys_var_long_ptr  sys_innodb_show_locks_held(
@@ -199,16 +199,16 @@ diff -r 7d3d7786b927 sql/set_var.cc
  sys_var_const_os_str_ptr sys_innodb_data_file_path("innodb_data_file_path", 
                                                 &innobase_data_file_path);
  sys_var_const_os_str_ptr sys_innodb_data_home_dir("innodb_data_home_dir", 
-@@ -893,6 +899,8 @@
-   &sys_innodb_flush_neighbor_pages,
+@@ -906,6 +912,8 @@
    &sys_innodb_read_ahead,
+   &sys_innodb_enable_unsafe_group_commit,
    &sys_innodb_adaptive_checkpoint,
 +  &sys_innodb_show_locks_held,
 +  &sys_innodb_show_verbose_locks,
  #endif
    &sys_trust_routine_creators,
    &sys_trust_function_creators,
-@@ -1008,6 +1016,8 @@
+@@ -1023,6 +1031,8 @@
    {"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG },
    {"innodb_file_per_table", (char*) &innobase_file_per_table, SHOW_MY_BOOL},
    {sys_innodb_flush_log_at_trx_commit.name, (char*) &sys_innodb_flush_log_at_trx_commit, SHOW_SYS},
index f7a31669ef538598d7b990bdc2d8e79ad4b1bb91..e45fccd8688dc6008df7360360984412bf7cbc19 100644 (file)
-diff -r 962aec0d731c innobase/configure
---- a/innobase/configure       Thu Oct 09 08:28:53 2008 -0700
-+++ b/innobase/configure       Thu Oct 09 08:30:28 2008 -0700
-@@ -20519,6 +20519,88 @@
+diff -ruN a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c
+--- a/innobase/btr/btr0sea.c   2009-05-20 14:21:44.000000000 +0900
++++ b/innobase/btr/btr0sea.c   2009-05-20 14:39:34.000000000 +0900
+@@ -773,7 +773,7 @@
+               rw_lock_s_lock(&btr_search_latch);
+       }
  
- fi
- done
-+
-+
-+# as http://lists.mysql.com/commits/40686 does
-+{ echo "$as_me:$LINENO: checking whether the compiler provides atomic builtins" >&5
-+echo $ECHO_N "checking whether the compiler provides atomic builtins... $ECHO_C" >&6; }
-+if test "${mysql_cv_atomic_builtins+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  if test "$cross_compiling" = yes; then
-+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-+See \`config.log' for more details." >&5
-+echo "$as_me: error: cannot run test program while cross compiling
-+See \`config.log' for more details." >&2;}
-+   { (exit 1); exit 1; }; }
-+else
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+
-+  int main()
-+  {
-+    int foo= -10; int bar= 10;
-+    __sync_fetch_and_add(&foo, bar);
-+    if (foo)
-+      return -1;
-+    bar= __sync_lock_test_and_set(&foo, bar);
-+    if (bar || foo != 10)
-+      return -1;
-+    bar= __sync_val_compare_and_swap(&bar, foo, 15);
-+    if (bar)
-+      return -1;
-+    return 0;
-+  }
-+
-+_ACEOF
-+rm -f conftest$ac_exeext
-+if { (ac_try="$ac_link"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+  (eval "$ac_link") 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-+  { (case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+  (eval "$ac_try") 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  mysql_cv_atomic_builtins=yes
-+else
-+  echo "$as_me: program exited with status $ac_status" >&5
-+echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+( exit $ac_status )
-+mysql_cv_atomic_builtins=no
-+fi
-+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-+fi
-+
-+
-+fi
-+{ echo "$as_me:$LINENO: result: $mysql_cv_atomic_builtins" >&5
-+echo "${ECHO_T}$mysql_cv_atomic_builtins" >&6; }
-+
-+if test "x$mysql_cv_atomic_builtins" = xyes; then
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_ATOMIC_BUILTINS 1
-+_ACEOF
-+
-+fi
- #AC_CHECK_FUNCS(readdir_r) MySQL checks that it has also the right args.
- # Some versions of Unix only take 2 arguments.
-diff -r 962aec0d731c innobase/configure.in
---- a/innobase/configure.in    Thu Oct 09 08:28:53 2008 -0700
-+++ b/innobase/configure.in    Thu Oct 09 08:30:28 2008 -0700
-@@ -42,6 +42,31 @@
- AC_CHECK_FUNCS(sched_yield)
- AC_CHECK_FUNCS(fdatasync)
- AC_CHECK_FUNCS(localtime_r)
-+
-+# as http://lists.mysql.com/commits/40686 does
-+AC_CACHE_CHECK([whether the compiler provides atomic builtins],
-+               [mysql_cv_atomic_builtins], [AC_TRY_RUN([
-+  int main()
-+  {
-+    int foo= -10; int bar= 10;
-+    __sync_fetch_and_add(&foo, bar);
-+    if (foo)
-+      return -1;
-+    bar= __sync_lock_test_and_set(&foo, bar);
-+    if (bar || foo != 10)
-+      return -1;
-+    bar= __sync_val_compare_and_swap(&bar, foo, 15);
-+    if (bar)
-+      return -1;
-+    return 0;
-+  }
-+], [mysql_cv_atomic_builtins=yes], [mysql_cv_atomic_builtins=no])])
-+
-+if test "x$mysql_cv_atomic_builtins" = xyes; then
-+  AC_DEFINE(HAVE_ATOMIC_BUILTINS, 1,
-+            [Define to 1 if compiler provides atomic builtins.])
-+fi
-+
- #AC_CHECK_FUNCS(readdir_r) MySQL checks that it has also the right args.
- # Some versions of Unix only take 2 arguments.
- #AC_C_INLINE  Already checked in MySQL
-diff -r 962aec0d731c innobase/ib_config.h
---- a/innobase/ib_config.h     Thu Oct 09 08:28:53 2008 -0700
-+++ b/innobase/ib_config.h     Thu Oct 09 08:30:28 2008 -0700
-@@ -3,6 +3,9 @@
- /* Define to 1 if you have the <aio.h> header file. */
- #define HAVE_AIO_H 1
-+
-+/* Define to 1 if compiler provides atomic builtins. */
-+#define HAVE_ATOMIC_BUILTINS 1
- /* Define to 1 if you have the <dlfcn.h> header file. */
- #define HAVE_DLFCN_H 1
-diff -r 962aec0d731c innobase/ib_config.h.in
---- a/innobase/ib_config.h.in  Thu Oct 09 08:28:53 2008 -0700
-+++ b/innobase/ib_config.h.in  Thu Oct 09 08:30:28 2008 -0700
-@@ -2,6 +2,9 @@
- /* Define to 1 if you have the <aio.h> header file. */
- #undef HAVE_AIO_H
-+
-+/* Define to 1 if compiler provides atomic builtins. */
-+#undef HAVE_ATOMIC_BUILTINS
- /* Define to 1 if you have the <dlfcn.h> header file. */
- #undef HAVE_DLFCN_H
-diff -r 962aec0d731c innobase/include/sync0rw.h
---- a/innobase/include/sync0rw.h       Thu Oct 09 08:28:53 2008 -0700
-+++ b/innobase/include/sync0rw.h       Thu Oct 09 08:30:28 2008 -0700
+-      ut_ad(btr_search_latch.writer != RW_LOCK_EX);
++      ut_ad(rw_lock_get_writer(&btr_search_latch) != RW_LOCK_EX);
+       ut_ad(btr_search_latch.reader_count > 0);
+       rec = ha_search_and_get_data(btr_search_sys->hash_index, fold);
+diff -ruN a/innobase/include/sync0rw.h b/innobase/include/sync0rw.h
+--- a/innobase/include/sync0rw.h       2009-01-30 06:42:20.000000000 +0900
++++ b/innobase/include/sync0rw.h       2009-04-16 16:15:28.000000000 +0900
 @@ -325,7 +325,17 @@
  Accessor functions for rw lock. */
  UNIV_INLINE
@@ -191,7 +50,7 @@ diff -r 962aec0d731c innobase/include/sync0rw.h
  /* NOTE! The structure appears here only for the compiler to know its size.
  Do not use its fields directly! The structure used in the spin lock
  implementation of a read-write lock. Several threads may have a shared lock
-@@ -417,9 +432,9 @@
+@@ -417,9 +438,9 @@
  field. Then no new readers are allowed in. */
  
  struct rw_lock_struct {
@@ -204,7 +63,7 @@ diff -r 962aec0d731c innobase/include/sync0rw.h
        os_event_t      wait_ex_event;  /* This windows specific event is
                                used by the thread which has set the
                                lock state to RW_LOCK_WAIT_EX. The
-@@ -427,31 +442,35 @@
+@@ -427,31 +448,35 @@
                                thread will be the next one to proceed
                                once the current the event gets
                                signalled. See LEMMA 2 in sync0sync.c */
@@ -249,10 +108,10 @@ diff -r 962aec0d731c innobase/include/sync0rw.h
                                /* This is TRUE if the writer field is
                                RW_LOCK_WAIT_EX; this field is located far
                                from the memory update hotspot fields which
-diff -r 962aec0d731c innobase/include/sync0rw.ic
---- a/innobase/include/sync0rw.ic      Thu Oct 09 08:28:53 2008 -0700
-+++ b/innobase/include/sync0rw.ic      Thu Oct 09 08:30:28 2008 -0700
-@@ -47,20 +47,52 @@
+diff -ruN a/innobase/include/sync0rw.ic b/innobase/include/sync0rw.ic
+--- a/innobase/include/sync0rw.ic      2009-01-30 06:42:20.000000000 +0900
++++ b/innobase/include/sync0rw.ic      2009-04-16 17:06:53.000000000 +0900
+@@ -47,20 +47,64 @@
  Accessor functions for rw lock. */
  UNIV_INLINE
  ulint
@@ -263,11 +122,13 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
  {
 -      return(lock->waiters);
 +      return(lock->s_waiters);
-+}
-+UNIV_INLINE
+ }
+ UNIV_INLINE
+-void
+-rw_lock_set_waiters(
 +ulint
 +rw_lock_get_x_waiters(
-+/*================*/
+ /*================*/
 +      rw_lock_t*      lock)
 +{
 +      return(lock->x_waiters);
@@ -279,17 +140,19 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
 +      rw_lock_t*      lock)
 +{
 +      return(lock->wait_ex_waiters);
- }
- UNIV_INLINE
- void
--rw_lock_set_waiters(
--/*================*/
++}
++UNIV_INLINE
++void
 +rw_lock_set_s_waiters(
        rw_lock_t*      lock,
        ulint           flag)
  {
 -      lock->waiters = flag;
++#ifdef HAVE_ATOMIC_BUILTINS
++      __sync_lock_test_and_set(&lock->s_waiters, flag);
++#else
 +      lock->s_waiters = flag;
++#endif
 +}
 +UNIV_INLINE
 +void
@@ -297,7 +160,11 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
 +      rw_lock_t*      lock,
 +      ulint           flag)
 +{
++#ifdef HAVE_ATOMIC_BUILTINS
++      __sync_lock_test_and_set(&lock->x_waiters, flag);
++#else
 +      lock->x_waiters = flag;
++#endif
 +}
 +UNIV_INLINE
 +void
@@ -306,11 +173,15 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
 +      rw_lock_t*      lock,
 +      ulint           flag)
 +{
++#ifdef HAVE_ATOMIC_BUILTINS
++      __sync_lock_test_and_set(&lock->wait_ex_waiters, flag);
++#else
 +      lock->wait_ex_waiters = flag;
++#endif
  }
  UNIV_INLINE
  ulint
-@@ -68,7 +100,19 @@
+@@ -68,7 +112,19 @@
  /*===============*/
        rw_lock_t*      lock)
  {
@@ -330,7 +201,7 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
  }
  UNIV_INLINE
  void
-@@ -96,6 +140,7 @@
+@@ -96,6 +152,7 @@
  {
        lock->reader_count = count;
  }
@@ -338,7 +209,7 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
  UNIV_INLINE
  mutex_t*
  rw_lock_get_mutex(
-@@ -104,6 +149,7 @@
+@@ -104,6 +161,7 @@
  {
        return(&(lock->mutex));
  }
@@ -346,7 +217,7 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
  
  /**********************************************************************
  Returns the value of writer_count for the lock. Does not reserve the lock
-@@ -133,14 +179,26 @@
+@@ -133,14 +191,26 @@
        const char*     file_name, /* in: file name where lock requested */
        ulint           line)   /* in: line where requested */
  {
@@ -374,7 +245,7 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
  
  #ifdef UNIV_SYNC_DEBUG
                rw_lock_add_debug_info(lock, pass, RW_LOCK_SHARED, file_name,
-@@ -167,11 +225,15 @@
+@@ -167,11 +237,15 @@
        const char*     file_name,      /* in: file name where requested */
        ulint           line)           /* in: line where lock requested */
  {
@@ -391,7 +262,7 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
  
        lock->last_s_file_name = file_name;
        lock->last_s_line = line;
-@@ -199,7 +261,11 @@
+@@ -199,7 +273,11 @@
  
        rw_lock_set_writer(lock, RW_LOCK_EX);
        lock->writer_thread = os_thread_get_curr_id();
@@ -403,7 +274,7 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
        lock->pass = 0;
                        
        lock->last_x_file_name = file_name;
-@@ -241,15 +307,21 @@
+@@ -241,15 +319,21 @@
        ut_ad(!rw_lock_own(lock, RW_LOCK_SHARED)); /* see NOTE above */
  #endif /* UNIV_SYNC_DEBUG */
  
@@ -425,7 +296,7 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
  
                rw_lock_s_lock_spin(lock, pass, file_name, line);
  
-@@ -272,11 +344,23 @@
+@@ -272,11 +356,23 @@
  {
        ibool   success = FALSE;
  
@@ -449,7 +320,7 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
  
  #ifdef UNIV_SYNC_DEBUG
                rw_lock_add_debug_info(lock, 0, RW_LOCK_SHARED, file_name,
-@@ -289,7 +373,9 @@
+@@ -289,7 +385,9 @@
                success = TRUE;
        }
  
@@ -459,20 +330,20 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
  
        return(success);
  }
-@@ -309,6 +395,55 @@
+@@ -309,6 +407,54 @@
  {
        ibool           success         = FALSE;
        os_thread_id_t  curr_thread     = os_thread_get_curr_id();
 +#ifdef HAVE_ATOMIC_BUILTINS
-+      if ((lock->lock_word == RW_LOCK_BIAS)
-+                      && rw_lock_get_writer(lock) == RW_LOCK_NOT_LOCKED) {
-+              /* try x-lock */
-+              if(__sync_sub_and_fetch(&(lock->lock_word),
-+                              RW_LOCK_BIAS) == 0) {
++      if (lock->reader_count == 0) {
++              /* try to lock writer */
++              if(__sync_lock_test_and_set(&(lock->writer),RW_LOCK_EX)
++                              == RW_LOCK_NOT_LOCKED) {
 +                      /* success */
-+                      /* try to lock writer */
-+                      if(__sync_lock_test_and_set(&(lock->writer),RW_LOCK_EX)
-+                                      == RW_LOCK_NOT_LOCKED) {
++retry_x_lock:
++                      /* try x-lock */
++                      if(__sync_sub_and_fetch(&(lock->lock_word),
++                                      RW_LOCK_BIAS) == 0) {
 +                              /* success */
 +                              lock->writer_thread = curr_thread;
 +                              lock->pass = 0;
@@ -492,30 +363,29 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
 +
 +                              return(TRUE);
 +                      } else {
-+                              /* x-unlock */
-+                              __sync_fetch_and_add(&(lock->lock_word),
-+                                      RW_LOCK_BIAS);
++                              /* fail (x-lock) */
++                              if (__sync_fetch_and_add(&(lock->lock_word),RW_LOCK_BIAS)
++                                              == 0)
++                                      goto retry_x_lock;
 +                      }
-+              } else {
-+                      /* fail (x-lock) */
-+                      __sync_fetch_and_add(&(lock->lock_word),RW_LOCK_BIAS);
++
++                      __sync_lock_test_and_set(&(lock->writer),RW_LOCK_NOT_LOCKED);
 +              }
 +      }
 +
 +      if (lock->pass == 0
-+                      && os_thread_eq(lock->writer_thread, curr_thread)
-+                      && rw_lock_get_writer(lock) == RW_LOCK_EX) {
++                      && os_thread_eq(lock->writer_thread, curr_thread)) {
 +              goto relock;
 +      }
 +
-+      ut_ad(rw_lock_validate(lock));
++      //ut_ad(rw_lock_validate(lock));
 +
 +      return(FALSE);
 +#else
        mutex_enter(rw_lock_get_mutex(lock));
  
        if (UNIV_UNLIKELY(rw_lock_get_reader_count(lock) != 0)) {
-@@ -339,6 +474,7 @@
+@@ -339,6 +485,7 @@
          ut_ad(rw_lock_validate(lock));
  
        return(success);
@@ -523,7 +393,7 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
  }
  
  /**********************************************************************
-@@ -354,16 +490,33 @@
+@@ -354,16 +501,33 @@
  #endif
        )
  {
@@ -558,37 +428,37 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
  
  #ifdef UNIV_SYNC_DEBUG
        rw_lock_remove_debug_info(lock, pass, RW_LOCK_SHARED);
-@@ -372,20 +525,36 @@
+@@ -372,22 +536,39 @@
        /* If there may be waiters and this was the last s-lock,
        signal the object */
  
 -      if (UNIV_UNLIKELY(lock->waiters)
 +#ifdef HAVE_ATOMIC_BUILTINS
-+      if (UNIV_UNLIKELY(last && lock->wait_ex_waiters)) {
++      if (UNIV_UNLIKELY(last && __sync_lock_test_and_set(&lock->wait_ex_waiters, 0))) {
++              os_event_set(lock->wait_ex_event);
++              sync_array_object_signalled(sync_primary_wait_array);
++      }
++      else if (UNIV_UNLIKELY(last && __sync_lock_test_and_set(&lock->x_waiters, 0))) {
++              os_event_set(lock->x_event);
++              sync_array_object_signalled(sync_primary_wait_array);
++      }
 +#else
 +      if (UNIV_UNLIKELY(lock->wait_ex_waiters)
                        && lock->reader_count == 0) {
 -              sg = TRUE;
-+#endif
 +              wx_sg = TRUE;
  
 -              rw_lock_set_waiters(lock, 0);
 +              rw_lock_set_wx_waiters(lock, 0);
 +      }
-+#ifdef HAVE_ATOMIC_BUILTINS
-+      else if (UNIV_UNLIKELY(last && lock->x_waiters)) {
-+#else
 +      else if (UNIV_UNLIKELY(lock->x_waiters)
 +                      && lock->reader_count == 0) {
-+#endif
 +              x_sg = TRUE;
 +
 +              rw_lock_set_x_waiters(lock, 0);
        }
        
-+#ifndef HAVE_ATOMIC_BUILTINS
        mutex_exit(mutex);
-+#endif
  
 -      if (UNIV_UNLIKELY(sg)) {
 -#ifdef __WIN__
@@ -601,8 +471,11 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
 +              os_event_set(lock->x_event);
                sync_array_object_signalled(sync_primary_wait_array);
        }
++#endif
+         ut_ad(rw_lock_validate(lock));
  
-@@ -409,13 +578,22 @@
+@@ -409,13 +590,22 @@
  
        ut_ad(lock->reader_count > 0);
  
@@ -625,7 +498,7 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
          ut_ad(rw_lock_validate(lock));
  #ifdef UNIV_SYNC_PERF_STAT
        rw_s_exit_count++;
-@@ -435,41 +613,81 @@
+@@ -435,41 +625,83 @@
  #endif
        )
  {
@@ -658,10 +531,7 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
 +              /* FIXME: It is a value of bad manners for pthread.
 +                        But we shouldn't keep an ID of not-owner. */
 +              lock->writer_thread = -1;
-+
-+              /* atomic operation may be safer about memory order. */
-+              rw_lock_set_writer(lock, RW_LOCK_NOT_LOCKED);
-+              __sync_synchronize();
++              __sync_lock_test_and_set(&(lock->writer),RW_LOCK_NOT_LOCKED);
 +      }
 +#else
        lock->writer_count--;
@@ -683,9 +553,15 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
 -              rw_lock_set_waiters(lock, 0);
 +#ifdef HAVE_ATOMIC_BUILTINS
 +      if (last) {
++              if(__sync_lock_test_and_set(&lock->s_waiters, 0)){
++                      s_sg = TRUE;
++              }
++              if(__sync_lock_test_and_set(&lock->x_waiters, 0)){
++                      x_sg = TRUE;
++              }
++      }
 +#else
 +      if (lock->writer_count == 0) {
-+#endif
 +              if(lock->s_waiters){
 +                      s_sg = TRUE;
 +                      rw_lock_set_s_waiters(lock, 0);
@@ -696,7 +572,6 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
 +              }
        }
        
-+#ifndef HAVE_ATOMIC_BUILTINS
        mutex_exit(&(lock->mutex));
 +#endif
  
@@ -715,7 +590,7 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
                sync_array_object_signalled(sync_primary_wait_array);
        }
  
-@@ -494,9 +712,13 @@
+@@ -494,9 +726,13 @@
  
        ut_ad(lock->writer_count > 0);
  
@@ -729,7 +604,7 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
                rw_lock_set_writer(lock, RW_LOCK_NOT_LOCKED);
        }
  
-@@ -504,7 +726,12 @@
+@@ -504,7 +740,12 @@
        rw_lock_remove_debug_info(lock, 0, RW_LOCK_EX);
  #endif
  
@@ -742,9 +617,9 @@ diff -r 962aec0d731c innobase/include/sync0rw.ic
          ut_ad(rw_lock_validate(lock));
  
  #ifdef UNIV_SYNC_PERF_STAT
-diff -r 962aec0d731c innobase/sync/sync0arr.c
---- a/innobase/sync/sync0arr.c Thu Oct 09 08:28:53 2008 -0700
-+++ b/innobase/sync/sync0arr.c Thu Oct 09 08:30:28 2008 -0700
+diff -ruN a/innobase/sync/sync0arr.c b/innobase/sync/sync0arr.c
+--- a/innobase/sync/sync0arr.c 2009-01-30 06:42:24.000000000 +0900
++++ b/innobase/sync/sync0arr.c 2009-04-16 16:15:28.000000000 +0900
 @@ -309,13 +309,13 @@
  {
        if (type == SYNC_MUTEX) {
@@ -877,9 +752,9 @@ diff -r 962aec0d731c innobase/sync/sync0arr.c
                                }
                          }
                  }
-diff -r 962aec0d731c innobase/sync/sync0rw.c
---- a/innobase/sync/sync0rw.c  Thu Oct 09 08:28:53 2008 -0700
-+++ b/innobase/sync/sync0rw.c  Thu Oct 09 08:30:28 2008 -0700
+diff -ruN a/innobase/sync/sync0rw.c b/innobase/sync/sync0rw.c
+--- a/innobase/sync/sync0rw.c  2009-01-30 06:42:24.000000000 +0900
++++ b/innobase/sync/sync0rw.c  2009-04-16 17:33:59.000000000 +0900
 @@ -99,6 +99,7 @@
        object is created, then the following call initializes
        the sync system. */
@@ -945,7 +820,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
  
        if (UT_LIST_GET_PREV(list, lock)) {
                ut_a(UT_LIST_GET_PREV(list, lock)->magic_n == RW_LOCK_MAGIC_N);
-@@ -192,6 +199,8 @@
+@@ -192,26 +199,43 @@
  Checks that the rw-lock has been initialized and that there are no
  simultaneous shared and exclusive locks. */
  
@@ -954,8 +829,9 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
  ibool
  rw_lock_validate(
  /*=============*/
-@@ -199,7 +208,9 @@
+       rw_lock_t*      lock)
  {
++      ulint   test;
        ut_a(lock);
  
 +#ifndef HAVE_ATOMIC_BUILTINS
@@ -963,28 +839,37 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
 +#endif
  
        ut_a(lock->magic_n == RW_LOCK_MAGIC_N);
++#ifndef HAVE_ATOMIC_BUILTINS
        ut_a((rw_lock_get_reader_count(lock) == 0)
-@@ -207,11 +218,17 @@
-       ut_a((rw_lock_get_writer(lock) == RW_LOCK_EX)
-            || (rw_lock_get_writer(lock) == RW_LOCK_WAIT_EX)
-            || (rw_lock_get_writer(lock) == RW_LOCK_NOT_LOCKED));
+            || (rw_lock_get_writer(lock) != RW_LOCK_EX));
+-      ut_a((rw_lock_get_writer(lock) == RW_LOCK_EX)
+-           || (rw_lock_get_writer(lock) == RW_LOCK_WAIT_EX)
+-           || (rw_lock_get_writer(lock) == RW_LOCK_NOT_LOCKED));
 -      ut_a((rw_lock_get_waiters(lock) == 0)
 -           || (rw_lock_get_waiters(lock) == 1));
-+      ut_a((rw_lock_get_s_waiters(lock) == 0)
-+           || (rw_lock_get_s_waiters(lock) == 1));
-+      ut_a((rw_lock_get_x_waiters(lock) == 0)
-+           || (rw_lock_get_x_waiters(lock) == 1));
-+      ut_a((rw_lock_get_wx_waiters(lock) == 0)
-+           || (rw_lock_get_wx_waiters(lock) == 1));
++#endif
++      test = rw_lock_get_writer(lock);
++      ut_a((test == RW_LOCK_EX)
++           || (test == RW_LOCK_WAIT_EX)
++           || (test == RW_LOCK_NOT_LOCKED));
++      test = rw_lock_get_s_waiters(lock);
++      ut_a((test == 0)
++           || (test == 1));
++      test = rw_lock_get_x_waiters(lock);
++      ut_a((test == 0)
++           || (test == 1));
++      test = rw_lock_get_wx_waiters(lock);
++      ut_a((test == 0)
++           || (test == 1));
++#ifndef HAVE_ATOMIC_BUILTINS
        ut_a((lock->writer != RW_LOCK_EX) || (lock->writer_count > 0));
             
-+#ifndef HAVE_ATOMIC_BUILTINS
        mutex_exit(rw_lock_get_mutex(lock));
 +#endif
  
        return(TRUE);
  }
-@@ -237,13 +254,14 @@
+@@ -237,13 +261,14 @@
          ut_ad(rw_lock_validate(lock));
  
  lock_loop:
@@ -1002,7 +887,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
                if (srv_spin_wait_delay) {
                        ut_delay(ut_rnd_interval(0, srv_spin_wait_delay));
                }
-@@ -262,15 +280,27 @@
+@@ -262,15 +287,27 @@
                lock->cfile_name, (ulong) lock->cline, (ulong) i);
        }
  
@@ -1030,13 +915,13 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
                /* If we get here, locking did not succeed, we may
                suspend the thread to wait in the wait array */
  
-@@ -281,9 +311,26 @@
+@@ -281,9 +318,26 @@
                                file_name, line,
                                &index);
  
 -              rw_lock_set_waiters(lock, 1);
 +              rw_lock_set_s_waiters(lock, 1);
++
 +#ifdef HAVE_ATOMIC_BUILTINS
 +              /* like sync0sync.c doing */
 +              for (i = 0; i < 4; i++) {
@@ -1045,10 +930,10 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
 +                              return; /* Success */
 +                      }
 +              }
-+
 +              /* If wait_ex_waiter stalls, wakes it. */
-+              if (lock->wait_ex_waiters && lock->lock_word == RW_LOCK_BIAS) {
-+                      rw_lock_set_wx_waiters(lock, 0);
++              if (lock->reader_count == 0
++                  && __sync_lock_test_and_set(&lock->wait_ex_waiters, 0)) {
 +                      os_event_set(lock->wait_ex_event);
 +                      sync_array_object_signalled(sync_primary_wait_array);
 +              }
@@ -1058,7 +943,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
  
                if (srv_print_latch_waits) {
                        fprintf(stderr,
-@@ -318,13 +358,19 @@
+@@ -318,13 +372,19 @@
  {
        ut_ad(rw_lock_is_locked(lock, RW_LOCK_EX));
  
@@ -1078,13 +963,13 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
  }
  
  /**********************************************************************
-@@ -342,6 +388,89 @@
+@@ -342,6 +402,89 @@
        const char*     file_name,/* in: file name where lock requested */
        ulint           line)   /* in: line where requested */
  {
 +#ifdef HAVE_ATOMIC_BUILTINS
 +      os_thread_id_t  curr_thread     = os_thread_get_curr_id();
-+
++retry_writer:
 +      /* try to lock writer */
 +      if(__sync_lock_test_and_set(&(lock->writer),RW_LOCK_EX)
 +                      == RW_LOCK_NOT_LOCKED) {
@@ -1160,15 +1045,15 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
 +
 +              break;
 +
-+          default: /* ??? */
-+              return(RW_LOCK_NOT_LOCKED);
++          default: /* RW_LOCK_NOT_LOCKED? maybe impossible */
++              goto retry_writer;
 +      }
 +#else /* HAVE_ATOMIC_BUILTINS */
 +
  #ifdef UNIV_SYNC_DEBUG
        ut_ad(mutex_own(rw_lock_get_mutex(lock)));
  #endif /* UNIV_SYNC_DEBUG */
-@@ -423,6 +552,7 @@
+@@ -423,6 +566,7 @@
                /* Locking succeeded, we may return */
                return(RW_LOCK_EX);
        }
@@ -1176,7 +1061,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
  
        /* Locking did not succeed */
        return(RW_LOCK_NOT_LOCKED);
-@@ -448,19 +578,33 @@
+@@ -448,19 +592,33 @@
        ulint           line)   /* in: line where requested */
  {
          ulint index;  /* index of the reserved wait cell */
@@ -1211,7 +1096,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
        if (state == RW_LOCK_EX) {
  
                return; /* Locking succeeded */
-@@ -468,10 +612,9 @@
+@@ -468,10 +626,9 @@
        } else if (state == RW_LOCK_NOT_LOCKED) {
  
                /* Spin waiting for the writer field to become free */
@@ -1220,11 +1105,11 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
 -              while (rw_lock_get_writer(lock) != RW_LOCK_NOT_LOCKED 
 -                                                      && i < SYNC_SPIN_ROUNDS) {
 +              while (i < SYNC_SPIN_ROUNDS
-+                      && rw_lock_get_writer(lock) != RW_LOCK_NOT_LOCKED) {
++                      && lock->lock_word != RW_LOCK_BIAS) {
                        if (srv_spin_wait_delay) {
                                ut_delay(ut_rnd_interval(0,
                                                        srv_spin_wait_delay));
-@@ -485,9 +628,12 @@
+@@ -485,9 +642,12 @@
          } else if (state == RW_LOCK_WAIT_EX) {
  
                /* Spin waiting for the reader count field to become zero */
@@ -1238,7 +1123,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
                                                        && i < SYNC_SPIN_ROUNDS) {
                        if (srv_spin_wait_delay) {
                                ut_delay(ut_rnd_interval(0,
-@@ -500,7 +646,6 @@
+@@ -500,7 +660,6 @@
                        os_thread_yield();
                }
          } else {
@@ -1246,7 +1131,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
                ut_error;
        }       
  
-@@ -516,34 +661,69 @@
+@@ -516,34 +675,69 @@
          /* We try once again to obtain the lock. Acquire the mutex protecting
        the rw-lock fields */
  
@@ -1269,7 +1154,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
  
                return; /* Locking succeeded */
        }
-+
 +#ifdef HAVE_ATOMIC_BUILTINS
 +      /* like sync0sync.c doing */
 +      i++;
@@ -1278,7 +1163,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
 +              goto spin_loop;
 +      }
 +#endif
++
        rw_x_system_call_count++;
  
          sync_array_reserve_cell(sync_primary_wait_array,
@@ -1322,7 +1207,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
  
        if (srv_print_latch_waits) {
                fprintf(stderr,
-@@ -718,7 +898,9 @@
+@@ -718,7 +912,9 @@
        ut_ad(lock);
        ut_ad(rw_lock_validate(lock));
  
@@ -1332,7 +1217,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
  
        info = UT_LIST_GET_FIRST(lock->debug_list);
  
-@@ -728,7 +910,9 @@
+@@ -728,7 +924,9 @@
                    && (info->pass == 0)
                    && (info->lock_type == lock_type)) {
  
@@ -1342,7 +1227,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
                        /* Found! */
  
                        return(TRUE);
-@@ -736,7 +920,9 @@
+@@ -736,7 +934,9 @@
  
                info = UT_LIST_GET_NEXT(list, info);
        }
@@ -1352,7 +1237,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
  
        return(FALSE);
  }
-@@ -758,21 +944,25 @@
+@@ -758,21 +958,25 @@
        ut_ad(lock);
        ut_ad(rw_lock_validate(lock));
        
@@ -1379,7 +1264,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
  
        return(ret);
  }
-@@ -801,16 +991,26 @@
+@@ -801,16 +1005,26 @@
  
                count++;
  
@@ -1409,7 +1294,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
                        } else {
                                putc('\n', stderr);
                        }
-@@ -822,7 +1022,9 @@
+@@ -822,7 +1036,9 @@
                        }
                }
  
@@ -1419,7 +1304,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
                lock = UT_LIST_GET_NEXT(list, lock);
        }
  
-@@ -847,10 +1049,18 @@
+@@ -847,10 +1063,18 @@
  
        if ((rw_lock_get_writer(lock) != RW_LOCK_NOT_LOCKED)
            || (rw_lock_get_reader_count(lock) != 0)
@@ -1441,7 +1326,7 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
                } else {
                        putc('\n', stderr);
                }
-@@ -909,14 +1119,18 @@
+@@ -909,14 +1133,18 @@
        lock = UT_LIST_GET_FIRST(rw_lock_list);
  
        while (lock != NULL) {
@@ -1460,9 +1345,9 @@ diff -r 962aec0d731c innobase/sync/sync0rw.c
                lock = UT_LIST_GET_NEXT(list, lock);
        }
  
-diff -r 962aec0d731c patch_info/innodb_rw_lock.info
---- /dev/null  Thu Jan 01 00:00:00 1970 +0000
-+++ b/patch_info/innodb_rw_lock.info   Thu Oct 09 08:30:28 2008 -0700
+diff -ruN a/patch_info/innodb_rw_lock.info b/patch_info/innodb_rw_lock.info
+--- /dev/null  1970-01-01 09:00:00.000000000 +0900
++++ b/patch_info/innodb_rw_lock.info   2009-04-16 16:15:28.000000000 +0900
 @@ -0,0 +1,6 @@
 +File=innodb_rw_lock.patch
 +Name=Fix of InnoDB rw_locks
index 0e094e5e2cd4ba56eae7ac95949040a3ded68408..2e68888c06065fc9f15418709921c780f35f6233 100644 (file)
@@ -1,6 +1,6 @@
-diff -r 327ce7a34c91 mysql-test/r/information_schema.result
---- a/mysql-test/r/information_schema.result   Fri Nov 07 15:44:23 2008 -0800
-+++ b/mysql-test/r/information_schema.result   Fri Nov 07 15:52:53 2008 -0800
+diff -r e3b747e556c8 mysql-test/r/information_schema.result
+--- a/mysql-test/r/information_schema.result   Mon May 18 18:44:04 2009 -0700
++++ b/mysql-test/r/information_schema.result   Mon May 18 18:48:11 2009 -0700
 @@ -44,6 +44,7 @@
  COLUMN_PRIVILEGES
  INDEX_STATISTICS
@@ -59,9 +59,9 @@ diff -r 327ce7a34c91 mysql-test/r/information_schema.result
  PROFILING     information_schema.PROFILING    1
  ROUTINES      information_schema.ROUTINES     1
  SCHEMATA      information_schema.SCHEMATA     1
-diff -r 327ce7a34c91 mysql-test/r/information_schema_db.result
---- a/mysql-test/r/information_schema_db.result        Fri Nov 07 15:44:23 2008 -0800
-+++ b/mysql-test/r/information_schema_db.result        Fri Nov 07 15:52:53 2008 -0800
+diff -r e3b747e556c8 mysql-test/r/information_schema_db.result
+--- a/mysql-test/r/information_schema_db.result        Mon May 18 18:44:04 2009 -0700
++++ b/mysql-test/r/information_schema_db.result        Mon May 18 18:48:11 2009 -0700
 @@ -13,6 +13,7 @@
  COLUMN_PRIVILEGES
  INDEX_STATISTICS
@@ -70,9 +70,9 @@ diff -r 327ce7a34c91 mysql-test/r/information_schema_db.result
  PROFILING
  ROUTINES
  SCHEMATA
-diff -r 327ce7a34c91 mysql-test/r/mysqlshow.result
---- a/mysql-test/r/mysqlshow.result    Fri Nov 07 15:44:23 2008 -0800
-+++ b/mysql-test/r/mysqlshow.result    Fri Nov 07 15:52:53 2008 -0800
+diff -r e3b747e556c8 mysql-test/r/mysqlshow.result
+--- a/mysql-test/r/mysqlshow.result    Mon May 18 18:44:04 2009 -0700
++++ b/mysql-test/r/mysqlshow.result    Mon May 18 18:48:11 2009 -0700
 @@ -87,6 +87,7 @@
  | COLUMN_PRIVILEGES                     |
  | INDEX_STATISTICS                      |
@@ -89,10 +89,20 @@ diff -r 327ce7a34c91 mysql-test/r/mysqlshow.result
  | PROFILING                             |
  | ROUTINES                              |
  | SCHEMATA                              |
-diff -r 327ce7a34c91 sql/mysql_priv.h
---- a/sql/mysql_priv.h Fri Nov 07 15:44:23 2008 -0800
-+++ b/sql/mysql_priv.h Fri Nov 07 15:52:53 2008 -0800
-@@ -244,6 +244,8 @@
+diff -r e3b747e556c8 patch_info/microsec_process.info
+--- /dev/null  Thu Jan 01 00:00:00 1970 +0000
++++ b/patch_info/microsec_process.info Mon May 18 18:48:11 2009 -0700
+@@ -0,0 +1,6 @@
++File=microsec_process.patch
++Name=Adds INFOMATION_SCHEMA.PROCESSLIST with TIME_MS column
++Version=1.0
++Author=Percona <info@percona.com>
++License=GPL
++Comment=
+diff -r e3b747e556c8 sql/mysql_priv.h
+--- a/sql/mysql_priv.h Mon May 18 18:44:04 2009 -0700
++++ b/sql/mysql_priv.h Mon May 18 18:48:11 2009 -0700
+@@ -249,6 +249,8 @@
  
  /* Characters shown for the command in 'show processlist' */
  #define PROCESS_LIST_WIDTH 100
@@ -101,15 +111,13 @@ diff -r 327ce7a34c91 sql/mysql_priv.h
  
  #define PRECISION_FOR_DOUBLE 53
  #define PRECISION_FOR_FLOAT  24
-diff -r 327ce7a34c91 sql/sql_show.cc
---- a/sql/sql_show.cc  Fri Nov 07 15:44:23 2008 -0800
-+++ b/sql/sql_show.cc  Fri Nov 07 15:52:53 2008 -0800
-@@ -1466,6 +1466,120 @@
-   }
-   send_eof(thd);
+diff -r e3b747e556c8 sql/sql_show.cc
+--- a/sql/sql_show.cc  Mon May 18 18:44:04 2009 -0700
++++ b/sql/sql_show.cc  Mon May 18 18:48:11 2009 -0700
+@@ -1480,6 +1480,122 @@
    DBUG_VOID_RETURN;
-+}
-+
+ }
 +int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
 +{
 +  TABLE *table= tables->table;
@@ -173,7 +181,9 @@ diff -r 327ce7a34c91 sql/sql_show.cc
 +        table->field[4]->store(command_name[tmp->command],
 +                               strlen(command_name[tmp->command]), cs);
 +      /* MYSQL_TIME */
-+      const ulonglong utime= (tmp->start_timer && current_timer) ? current_timer - tmp->start_timer : 0; 
++      ulonglong utime= (tmp->start_timer && current_timer) ? current_timer - tmp->start_timer : 0; 
++      /* correction for negative time */
++      if (utime > 2629743) utime= 0; 
 +      table->field[5]->store(utime / 1000000, TRUE);
 +      /* STATE */
 +#ifndef EMBEDDED_LIBRARY
@@ -222,10 +232,12 @@ diff -r 327ce7a34c91 sql/sql_show.cc
 +
 +  VOID(pthread_mutex_unlock(&LOCK_thread_count));
 +  DBUG_RETURN(0);
- }
++}
++
  /*****************************************************************************
-@@ -4821,6 +4941,22 @@
+   Status functions
+ *****************************************************************************/
+@@ -4849,6 +4965,22 @@
    {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
  };
  
@@ -248,7 +260,7 @@ diff -r 327ce7a34c91 sql/sql_show.cc
  /*
    Description of ST_FIELD_INFO in table.h
  */
-@@ -4845,6 +4981,8 @@
+@@ -4873,6 +5005,8 @@
      get_all_tables, 0, get_schema_key_column_usage_record, 4, 5, 0},
    {"OPEN_TABLES", open_tables_fields_info, create_schema_table,
     fill_open_tables, make_old_format, 0, -1, -1, 1},
@@ -257,10 +269,10 @@ diff -r 327ce7a34c91 sql/sql_show.cc
    {"PROFILING", query_profile_statistics_info, create_schema_table,
     fill_query_profile_statistics_info, make_profile_table_for_show, 
     NULL, -1, -1, false},
-diff -r 327ce7a34c91 sql/table.h
---- a/sql/table.h      Fri Nov 07 15:44:23 2008 -0800
-+++ b/sql/table.h      Fri Nov 07 15:52:53 2008 -0800
-@@ -378,6 +378,7 @@
+diff -r e3b747e556c8 sql/table.h
+--- a/sql/table.h      Mon May 18 18:44:04 2009 -0700
++++ b/sql/table.h      Mon May 18 18:48:11 2009 -0700
+@@ -379,6 +379,7 @@
    SCH_INDEX_STATS,
    SCH_KEY_COLUMN_USAGE,
    SCH_OPEN_TABLES,
@@ -268,14 +280,3 @@ diff -r 327ce7a34c91 sql/table.h
    SCH_PROFILES,
    SCH_PROCEDURES,
    SCH_SCHEMATA,
-diff -ruN mysql-5.0.67_highperf/patch_info/microsec_process.info mysql-5.0.67_highperf_tmp/patch_info/microsec_process.info
---- /dev/null  1970-01-01 09:00:00.000000000 +0900
-+++ mysql-5.0.67_highperf_tmp/patch_info/microsec_process.info 2008-11-12 09:27:52.000000000 +0900
-@@ -0,0 +1,6 @@
-+File=microsec_process.patch
-+Name=Adds INFOMATION_SCHEMA.PROCESSLIST with TIME_MS column
-+Version=1.0
-+Author=Percona <info@percona.com>
-+License=GPL
-+Comment=
-+ChangeLog=
index 97ec61d269fe3884c5634ba19dac458f4ab60cd4..e28f0912c25fdbd6f515eeeb9115386e2067655d 100644 (file)
@@ -1,19 +1,19 @@
-diff -r 04958490fc6d include/my_getopt.h
---- a/include/my_getopt.h      Tue Feb 17 22:32:27 2009 -0800
-+++ b/include/my_getopt.h      Tue Feb 17 22:33:00 2009 -0800
+diff -r 069dc6d4f269 include/my_getopt.h
+--- a/include/my_getopt.h      Mon Jun 01 00:35:20 2009 -0700
++++ b/include/my_getopt.h      Mon Jun 01 00:35:30 2009 -0700
 @@ -28,7 +28,8 @@
  #define GET_ULL        8
  #define GET_STR        9
  #define GET_STR_ALLOC 10
 -#define GET_DISABLED  11
-+#define GET_DOUBLE    11
++#define GET_MICROTIME 11
 +#define GET_DISABLED  12
  
  #define GET_ASK_ADDR   128
  #define GET_TYPE_MASK  127
-diff -r 04958490fc6d include/my_time.h
---- a/include/my_time.h        Tue Feb 17 22:32:27 2009 -0800
-+++ b/include/my_time.h        Tue Feb 17 22:33:00 2009 -0800
+diff -r 069dc6d4f269 include/my_time.h
+--- a/include/my_time.h        Mon Jun 01 00:35:20 2009 -0700
++++ b/include/my_time.h        Mon Jun 01 00:35:30 2009 -0700
 @@ -140,7 +140,7 @@
  int my_date_to_str(const MYSQL_TIME *l_time, char *to);
  int my_datetime_to_str(const MYSQL_TIME *l_time, char *to);
@@ -23,20 +23,21 @@ diff -r 04958490fc6d include/my_time.h
  C_MODE_END
  
  #endif /* _my_time_h_ */
-diff -r 04958490fc6d innobase/buf/buf0buf.c
---- a/innobase/buf/buf0buf.c   Tue Feb 17 22:32:27 2009 -0800
-+++ b/innobase/buf/buf0buf.c   Tue Feb 17 22:33:00 2009 -0800
-@@ -37,6 +37,9 @@
+diff -r 069dc6d4f269 innobase/buf/buf0buf.c
+--- a/innobase/buf/buf0buf.c   Mon Jun 01 00:35:20 2009 -0700
++++ b/innobase/buf/buf0buf.c   Mon Jun 01 00:35:30 2009 -0700
+@@ -37,6 +37,10 @@
  #include "log0log.h"
  #include "trx0undo.h"
  #include "srv0srv.h"
++#include "trx0trx.h"
 +
 +/* prototypes for new functions added to ha_innodb.cc */
 +trx_t* innobase_get_trx();
  
  /*
                IMPLEMENTATION OF THE BUFFER POOL
-@@ -1086,6 +1089,36 @@
+@@ -1086,6 +1090,36 @@
        return(block);
  }
  
@@ -73,7 +74,7 @@ diff -r 04958490fc6d innobase/buf/buf0buf.c
  /************************************************************************
  This is the general function used to get access to a database page. */
  
-@@ -1108,6 +1141,11 @@
+@@ -1108,6 +1142,11 @@
        ulint           fix_type;
        ibool           success;
        ibool           must_read;
@@ -85,7 +86,7 @@ diff -r 04958490fc6d innobase/buf/buf0buf.c
        
        ut_ad(mtr);
        ut_ad((rw_latch == RW_S_LATCH)
-@@ -1119,6 +1157,9 @@
+@@ -1119,6 +1158,9 @@
  #ifndef UNIV_LOG_DEBUG
        ut_ad(!ibuf_inside() || ibuf_page(space, offset));
  #endif
@@ -95,7 +96,7 @@ diff -r 04958490fc6d innobase/buf/buf0buf.c
        buf_pool->n_page_gets++;
  loop:
        block = NULL;
-@@ -1148,7 +1189,7 @@
+@@ -1148,7 +1190,7 @@
                        return(NULL);
                }
  
@@ -104,7 +105,7 @@ diff -r 04958490fc6d innobase/buf/buf0buf.c
  
  #ifdef UNIV_DEBUG
                buf_dbg_counter++;
-@@ -1261,6 +1302,11 @@
+@@ -1261,6 +1303,11 @@
                        /* Let us wait until the read operation
                        completes */
  
@@ -116,20 +117,20 @@ diff -r 04958490fc6d innobase/buf/buf0buf.c
                        for (;;) {
                                mutex_enter(&block->mutex);
  
-@@ -1275,6 +1321,12 @@
+@@ -1276,6 +1323,12 @@
                                       break;
                                }
-+                      }
+                       }
 +                      if (srv_slow_log && trx && trx->take_stats && start_time)
 +                      {
 +                              ut_usectime(&sec, &ms);
 +                              finish_time = (ib_longlong)sec * 1000000 + ms;
 +                              trx->io_reads_wait_timer += (ulint)(finish_time - start_time);
-                       }
++                      }
                }
  
-@@ -1296,12 +1348,17 @@
+               fix_type = MTR_MEMO_BUF_FIX;
+@@ -1296,12 +1349,17 @@
                /* In the case of a first access, try to apply linear
                read-ahead */
  
@@ -148,7 +149,7 @@ diff -r 04958490fc6d innobase/buf/buf0buf.c
        return(block->frame);           
  }
  
-@@ -1326,6 +1383,7 @@
+@@ -1326,6 +1384,7 @@
        ibool           accessed;
        ibool           success;
        ulint           fix_type;
@@ -156,7 +157,7 @@ diff -r 04958490fc6d innobase/buf/buf0buf.c
  
        ut_ad(mtr && block);
        ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH));
-@@ -1440,13 +1498,18 @@
+@@ -1440,7 +1499,7 @@
                read-ahead */
  
                buf_read_ahead_linear(buf_frame_get_space_id(guess),
@@ -165,18 +166,19 @@ diff -r 04958490fc6d innobase/buf/buf0buf.c
        }
  
  #ifdef UNIV_IBUF_DEBUG
-       ut_a(ibuf_count_get(block->space, block->offset) == 0);
+@@ -1448,6 +1507,11 @@
  #endif
        buf_pool->n_page_gets++;
-+
 +      if (srv_slow_log) {
 +              trx = innobase_get_trx();
 +              _increment_page_get_statistics(block, trx);
 +      }
++
        return(TRUE);
  }
-@@ -1470,6 +1533,7 @@
+@@ -1470,6 +1534,7 @@
        buf_block_t*    block;
        ibool           success;
        ulint           fix_type;
@@ -184,21 +186,21 @@ diff -r 04958490fc6d innobase/buf/buf0buf.c
  
        ut_ad(mtr);
        ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH));
-@@ -1558,6 +1622,11 @@
-               || (ibuf_count_get(block->space, block->offset) == 0));
+@@ -1559,6 +1624,11 @@
  #endif
        buf_pool->n_page_gets++;
-+
 +      if (srv_slow_log) {
 +              trx = innobase_get_trx();
 +              _increment_page_get_statistics(block, trx);
 +      }
++
        return(TRUE);
  }
-diff -r 04958490fc6d innobase/buf/buf0rea.c
---- a/innobase/buf/buf0rea.c   Tue Feb 17 22:32:27 2009 -0800
-+++ b/innobase/buf/buf0rea.c   Tue Feb 17 22:33:00 2009 -0800
+diff -r 069dc6d4f269 innobase/buf/buf0rea.c
+--- a/innobase/buf/buf0rea.c   Mon Jun 01 00:35:20 2009 -0700
++++ b/innobase/buf/buf0rea.c   Mon Jun 01 00:35:30 2009 -0700
 @@ -70,7 +70,8 @@
                        treat the tablespace as dropped; this is a timestamp we
                        use to stop dangling page reads from a tablespace
@@ -315,9 +317,9 @@ diff -r 04958490fc6d innobase/buf/buf0rea.c
                }
        }
        
-diff -r 04958490fc6d innobase/fil/fil0fil.c
---- a/innobase/fil/fil0fil.c   Tue Feb 17 22:32:27 2009 -0800
-+++ b/innobase/fil/fil0fil.c   Tue Feb 17 22:33:00 2009 -0800
+diff -r 069dc6d4f269 innobase/fil/fil0fil.c
+--- a/innobase/fil/fil0fil.c   Mon Jun 01 00:35:20 2009 -0700
++++ b/innobase/fil/fil0fil.c   Mon Jun 01 00:35:30 2009 -0700
 @@ -3527,7 +3527,7 @@
                        node->name, node->handle, buf,
                        offset_low, offset_high,
@@ -356,9 +358,9 @@ diff -r 04958490fc6d innobase/fil/fil0fil.c
  #endif
        ut_a(ret);
  
-diff -r 04958490fc6d innobase/include/buf0rea.h
---- a/innobase/include/buf0rea.h       Tue Feb 17 22:32:27 2009 -0800
-+++ b/innobase/include/buf0rea.h       Tue Feb 17 22:33:00 2009 -0800
+diff -r 069dc6d4f269 innobase/include/buf0rea.h
+--- a/innobase/include/buf0rea.h       Mon Jun 01 00:35:20 2009 -0700
++++ b/innobase/include/buf0rea.h       Mon Jun 01 00:35:30 2009 -0700
 @@ -10,6 +10,7 @@
  #define buf0rea_h
  
@@ -388,9 +390,9 @@ diff -r 04958490fc6d innobase/include/buf0rea.h
  /************************************************************************
  Issues read requests for pages which the ibuf module wants to read in, in
  order to contract the insert buffer tree. Technically, this function is like
-diff -r 04958490fc6d innobase/include/fil0fil.h
---- a/innobase/include/fil0fil.h       Tue Feb 17 22:32:27 2009 -0800
-+++ b/innobase/include/fil0fil.h       Tue Feb 17 22:33:00 2009 -0800
+diff -r 069dc6d4f269 innobase/include/fil0fil.h
+--- a/innobase/include/fil0fil.h       Mon Jun 01 00:35:20 2009 -0700
++++ b/innobase/include/fil0fil.h       Mon Jun 01 00:35:30 2009 -0700
 @@ -534,8 +534,11 @@
  /************************************************************************
  Reads or writes data. This operation is asynchronous (aio). */
@@ -415,18 +417,18 @@ diff -r 04958490fc6d innobase/include/fil0fil.h
  /************************************************************************
  Reads data from a space to a buffer. Remember that the possible incomplete
  blocks at the end of file are ignored: they are not taken into account when
-diff -r 04958490fc6d innobase/include/os0file.h
---- a/innobase/include/os0file.h       Tue Feb 17 22:32:27 2009 -0800
-+++ b/innobase/include/os0file.h       Tue Feb 17 22:33:00 2009 -0800
-@@ -10,6 +10,8 @@
- #define os0file_h
+diff -r 069dc6d4f269 innobase/include/os0file.h
+--- a/innobase/include/os0file.h       Mon Jun 01 00:35:20 2009 -0700
++++ b/innobase/include/os0file.h       Mon Jun 01 00:35:30 2009 -0700
+@@ -11,6 +11,8 @@
  
  #include "univ.i"
-+
-+#include "trx0types.h"
  
++#include "trx0types.h"
++
  #ifndef __WIN__
  #include <dirent.h>
+ #include <sys/stat.h>
 @@ -421,8 +423,11 @@
  /***********************************************************************
  Requests a synchronous read operation. */
@@ -460,21 +462,21 @@ diff -r 04958490fc6d innobase/include/os0file.h
  /****************************************************************************
  Wakes up all async i/o threads so that they know to exit themselves in
  shutdown. */
-diff -r 04958490fc6d innobase/include/srv0srv.h
---- a/innobase/include/srv0srv.h       Tue Feb 17 22:32:27 2009 -0800
-+++ b/innobase/include/srv0srv.h       Tue Feb 17 22:33:00 2009 -0800
-@@ -26,6 +26,8 @@
- at a time */
+diff -r 069dc6d4f269 innobase/include/srv0srv.h
+--- a/innobase/include/srv0srv.h       Mon Jun 01 00:35:20 2009 -0700
++++ b/innobase/include/srv0srv.h       Mon Jun 01 00:35:30 2009 -0700
+@@ -27,6 +27,8 @@
  #define SRV_AUTO_EXTEND_INCREMENT     \
        (srv_auto_extend_increment * ((1024 * 1024) / UNIV_PAGE_SIZE))
-+
-+extern ibool  srv_slow_log;
  
++extern ibool  srv_slow_log;
++
  /* This is set to TRUE if the MySQL user has set it in MySQL */
  extern ibool  srv_lower_case_table_names;
-diff -r 04958490fc6d innobase/include/trx0trx.h
---- a/innobase/include/trx0trx.h       Tue Feb 17 22:32:27 2009 -0800
-+++ b/innobase/include/trx0trx.h       Tue Feb 17 22:33:00 2009 -0800
+diff -r 069dc6d4f269 innobase/include/trx0trx.h
+--- a/innobase/include/trx0trx.h       Mon Jun 01 00:35:20 2009 -0700
++++ b/innobase/include/trx0trx.h       Mon Jun 01 00:35:30 2009 -0700
 @@ -668,6 +668,17 @@
        /*------------------------------*/
        char detailed_error[256];       /* detailed error message for last
@@ -493,9 +495,9 @@ diff -r 04958490fc6d innobase/include/trx0trx.h
  };
  
  #define TRX_MAX_N_THREADS     32      /* maximum number of concurrent
-diff -r 04958490fc6d innobase/lock/lock0lock.c
---- a/innobase/lock/lock0lock.c        Tue Feb 17 22:32:27 2009 -0800
-+++ b/innobase/lock/lock0lock.c        Tue Feb 17 22:33:00 2009 -0800
+diff -r 069dc6d4f269 innobase/lock/lock0lock.c
+--- a/innobase/lock/lock0lock.c        Mon Jun 01 00:35:20 2009 -0700
++++ b/innobase/lock/lock0lock.c        Mon Jun 01 00:35:30 2009 -0700
 @@ -1806,6 +1806,8 @@
  {
        lock_t* lock;
@@ -538,18 +540,19 @@ diff -r 04958490fc6d innobase/lock/lock0lock.c
        trx->que_state = TRX_QUE_LOCK_WAIT;
        trx->was_chosen_as_deadlock_victim = FALSE;
        trx->wait_started = time(NULL);
-diff -r 04958490fc6d innobase/os/os0file.c
---- a/innobase/os/os0file.c    Tue Feb 17 22:32:27 2009 -0800
-+++ b/innobase/os/os0file.c    Tue Feb 17 22:33:00 2009 -0800
-@@ -14,6 +14,7 @@
+diff -r 069dc6d4f269 innobase/os/os0file.c
+--- a/innobase/os/os0file.c    Mon Jun 01 00:35:20 2009 -0700
++++ b/innobase/os/os0file.c    Mon Jun 01 00:35:30 2009 -0700
+@@ -14,6 +14,8 @@
  #include "srv0start.h"
  #include "fil0fil.h"
  #include "buf0buf.h"
 +#include "trx0sys.h"
++#include "trx0trx.h"
  
  #if defined(UNIV_HOTBACKUP) && defined(__WIN__)
  /* Add includes for the _stat() call to compile on Windows */
-@@ -1903,9 +1904,13 @@
+@@ -1903,9 +1905,13 @@
  #ifndef __WIN__
  /***********************************************************************
  Does a synchronous read operation in Posix. */
@@ -564,7 +567,7 @@ diff -r 04958490fc6d innobase/os/os0file.c
  /*==========*/
                                /* out: number of bytes read, -1 if error */
        os_file_t       file,   /* in: handle to a file */
-@@ -1913,12 +1918,17 @@
+@@ -1913,12 +1919,17 @@
        ulint           n,      /* in: number of bytes to read */       
        ulint           offset, /* in: least significant 32 bits of file
                                offset from where to read */
@@ -585,7 +588,7 @@ diff -r 04958490fc6d innobase/os/os0file.c
        ut_a((offset & 0xFFFFFFFFUL) == offset);
          
          /* If off_t is > 4 bytes in size, then we assume we can pass a
-@@ -1937,7 +1947,13 @@
+@@ -1937,7 +1948,13 @@
          }
  
        os_n_file_reads++;
@@ -600,7 +603,7 @@ diff -r 04958490fc6d innobase/os/os0file.c
  #if defined(HAVE_PREAD) && !defined(HAVE_BROKEN_PREAD)
          os_mutex_enter(os_file_count_mutex);
        os_file_n_pending_preads++;
-@@ -1951,6 +1967,13 @@
+@@ -1951,6 +1968,13 @@
        os_n_pending_reads--;
          os_mutex_exit(os_file_count_mutex);
  
@@ -614,21 +617,21 @@ diff -r 04958490fc6d innobase/os/os0file.c
        return(n_bytes);
  #else
        {
-@@ -1980,6 +2003,13 @@
-         os_mutex_enter(os_file_count_mutex);
+@@ -1981,6 +2005,13 @@
        os_n_pending_reads--;
          os_mutex_exit(os_file_count_mutex);
-+
 +        if (srv_slow_log && trx && trx->take_stats && start_time)
 +        {
 +              ut_usectime(&sec, &ms);
 +              finish_time = (ib_longlong)sec * 1000000 + ms;
 +                trx->io_reads_wait_timer += (ulint)(finish_time - start_time);
 +      }
++
        return(ret);
        }
-@@ -2103,7 +2133,7 @@
+ #endif
+@@ -2103,7 +2134,7 @@
  Requests a synchronous positioned read operation. */
  
  ibool
@@ -637,7 +640,7 @@ diff -r 04958490fc6d innobase/os/os0file.c
  /*=========*/
                                /* out: TRUE if request was
                                successful, FALSE if fail */
-@@ -2113,7 +2143,8 @@
+@@ -2113,7 +2144,8 @@
                                offset where to read */
        ulint           offset_high, /* in: most significant 32 bits of
                                offset */
@@ -647,7 +650,7 @@ diff -r 04958490fc6d innobase/os/os0file.c
  {
  #ifdef __WIN__
        BOOL            ret;
-@@ -2177,7 +2208,7 @@
+@@ -2177,7 +2209,7 @@
        os_bytes_read_since_printout += n;
  
  try_again:
@@ -656,7 +659,7 @@ diff -r 04958490fc6d innobase/os/os0file.c
  
        if ((ulint)ret == n) {
  
-@@ -3137,7 +3168,8 @@
+@@ -3137,7 +3169,8 @@
                                offset */
        ulint           offset_high, /* in: most significant 32 bits of
                                offset */
@@ -666,7 +669,7 @@ diff -r 04958490fc6d innobase/os/os0file.c
  {
        os_aio_slot_t*  slot;
  #ifdef WIN_ASYNC_IO
-@@ -3390,7 +3422,8 @@
+@@ -3390,7 +3423,8 @@
                                can be used to identify a completed aio
                                operation); if mode is OS_AIO_SYNC, these
                                are ignored */
@@ -676,7 +679,7 @@ diff -r 04958490fc6d innobase/os/os0file.c
  {
        os_aio_array_t* array;
        os_aio_slot_t*  slot;
-@@ -3429,8 +3462,8 @@
+@@ -3429,8 +3463,8 @@
                wait in the Windows case. */
  
                if (type == OS_FILE_READ) {
@@ -687,7 +690,7 @@ diff -r 04958490fc6d innobase/os/os0file.c
                }
  
                ut_a(type == OS_FILE_WRITE);
-@@ -3463,8 +3496,13 @@
+@@ -3463,8 +3497,13 @@
                ut_error;
        }
        
@@ -702,19 +705,19 @@ diff -r 04958490fc6d innobase/os/os0file.c
        if (type == OS_FILE_READ) {
                if (os_aio_use_native_aio) {
  #ifdef WIN_ASYNC_IO
-diff -r 04958490fc6d innobase/srv/srv0srv.c
---- a/innobase/srv/srv0srv.c   Tue Feb 17 22:32:27 2009 -0800
-+++ b/innobase/srv/srv0srv.c   Tue Feb 17 22:33:00 2009 -0800
-@@ -47,6 +47,8 @@
- #include "dict0boot.h"
+diff -r 069dc6d4f269 innobase/srv/srv0srv.c
+--- a/innobase/srv/srv0srv.c   Mon Jun 01 00:35:20 2009 -0700
++++ b/innobase/srv/srv0srv.c   Mon Jun 01 00:35:30 2009 -0700
+@@ -48,6 +48,8 @@
  #include "srv0start.h"
  #include "row0mysql.h"
-+
-+ibool srv_slow_log = 0;
  
++ibool srv_slow_log = 0;
++
  /* This is set to TRUE if the MySQL user has set it in MySQL; currently
  affects only FOREIGN KEY definition parsing */
-@@ -996,6 +998,10 @@
+ ibool srv_lower_case_table_names      = FALSE;
+@@ -1002,6 +1004,10 @@
        ibool                   has_slept = FALSE;
        srv_conc_slot_t*        slot      = NULL;
        ulint                   i;
@@ -725,7 +728,7 @@ diff -r 04958490fc6d innobase/srv/srv0srv.c
  
        /* If trx has 'free tickets' to enter the engine left, then use one
        such ticket */
-@@ -1054,6 +1060,7 @@
+@@ -1060,6 +1066,7 @@
      if (SRV_THREAD_SLEEP_DELAY > 0)
      {
        os_thread_sleep(SRV_THREAD_SLEEP_DELAY);
@@ -733,7 +736,7 @@ diff -r 04958490fc6d innobase/srv/srv0srv.c
      }
  
                trx->op_info = "";
-@@ -1109,11 +1116,22 @@
+@@ -1115,12 +1122,23 @@
        /* Go to wait for the event; when a thread leaves InnoDB it will
        release this thread */
  
@@ -747,18 +750,19 @@ diff -r 04958490fc6d innobase/srv/srv0srv.c
        os_event_wait(slot->event);
  
        trx->op_info = "";
-+
 +      if (srv_slow_log && trx->take_stats && start_time) {
 +              ut_usectime(&sec, &ms);
 +              finish_time = (ib_longlong)sec * 1000000 + ms;
 +              trx->innodb_que_wait_timer += (ulint)(finish_time - start_time);
 +      }
++
        os_fast_mutex_lock(&srv_conc_mutex);
  
-diff -r 04958490fc6d innobase/trx/trx0trx.c
---- a/innobase/trx/trx0trx.c   Tue Feb 17 22:32:27 2009 -0800
-+++ b/innobase/trx/trx0trx.c   Tue Feb 17 22:33:00 2009 -0800
+       srv_conc_n_waiting_threads--;
+diff -r 069dc6d4f269 innobase/trx/trx0trx.c
+--- a/innobase/trx/trx0trx.c   Mon Jun 01 00:35:20 2009 -0700
++++ b/innobase/trx/trx0trx.c   Mon Jun 01 00:35:30 2009 -0700
 @@ -190,6 +190,15 @@
        trx->global_read_view_heap = mem_heap_create(256);
        trx->global_read_view = NULL;
@@ -859,22 +863,32 @@ diff -r 04958490fc6d innobase/trx/trx0trx.c
        trx->que_state = TRX_QUE_RUNNING;
  }
  
-diff -r 04958490fc6d mysys/my_getopt.c
---- a/mysys/my_getopt.c        Tue Feb 17 22:32:27 2009 -0800
-+++ b/mysys/my_getopt.c        Tue Feb 17 22:33:00 2009 -0800
+diff -r 069dc6d4f269 mysys/my_getopt.c
+--- a/mysys/my_getopt.c        Mon Jun 01 00:35:20 2009 -0700
++++ b/mysys/my_getopt.c        Mon Jun 01 00:35:30 2009 -0700
+@@ -827,7 +827,8 @@
+ #endif
+     break;
+   default:
+-    DBUG_ASSERT((optp->var_type & GET_TYPE_MASK) == GET_ULL);
++    DBUG_ASSERT((optp->var_type & GET_TYPE_MASK) == GET_ULL
++                || (optp->var_type & GET_TYPE_MASK) == GET_MICROTIME);
+     break;
+   }
 @@ -1061,6 +1061,9 @@
        case GET_ULONG:
        printf("%lu\n", *((ulong*) value));
        break;
-+      case GET_DOUBLE:
-+      printf("%6f\n", *((double*) value));
++      case GET_MICROTIME:
++      printf("%6f\n", ((double)(*((longlong*) value))) / 1000000.0);
 +      break;
        case GET_LL:
        printf("%s\n", llstr(*((longlong*) value), buff));
        break;
-diff -r 04958490fc6d patch_info/microslow_innodb.info
+diff -r 069dc6d4f269 patch_info/microslow_innodb.info
 --- /dev/null  Thu Jan 01 00:00:00 1970 +0000
-+++ b/patch_info/microslow_innodb.info Tue Feb 17 22:33:00 2009 -0800
++++ b/patch_info/microslow_innodb.info Mon Jun 01 00:35:30 2009 -0700
 @@ -0,0 +1,15 @@
 +File=microslow_innodb.patch
 +Name=Extended statistics in slow.log
@@ -891,9 +905,9 @@ diff -r 04958490fc6d patch_info/microslow_innodb.info
 +
 +2008-11
 +Arjen Lentz: Fixups (backward compatibility) by Arjen Lentz <arjen@openquery.com.au>
-diff -r 04958490fc6d scripts/mysqldumpslow.sh
---- a/scripts/mysqldumpslow.sh Tue Feb 17 22:32:27 2009 -0800
-+++ b/scripts/mysqldumpslow.sh Tue Feb 17 22:33:00 2009 -0800
+diff -r 069dc6d4f269 scripts/mysqldumpslow.sh
+--- a/scripts/mysqldumpslow.sh Mon Jun 01 00:35:20 2009 -0700
++++ b/scripts/mysqldumpslow.sh Mon Jun 01 00:35:30 2009 -0700
 @@ -83,8 +83,8 @@
      s/^#? Time: \d{6}\s+\d+:\d+:\d+.*\n//;
      my ($user,$host) = s/^#? User\@Host:\s+(\S+)\s+\@\s+(\S+).*\n// ? ($1,$2) : ('','');
@@ -905,10 +919,10 @@ diff -r 04958490fc6d scripts/mysqldumpslow.sh
      $t -= $l unless $opt{l};
  
      # remove fluff that mysqld writes to log when it (re)starts:
-diff -r 04958490fc6d sql-common/my_time.c
---- a/sql-common/my_time.c     Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql-common/my_time.c     Tue Feb 17 22:33:00 2009 -0800
-@@ -1252,3 +1252,37 @@
+diff -r 069dc6d4f269 sql-common/my_time.c
+--- a/sql-common/my_time.c     Mon Jun 01 00:35:20 2009 -0700
++++ b/sql-common/my_time.c     Mon Jun 01 00:35:30 2009 -0700
+@@ -1253,3 +1253,37 @@
    return 0;
  }
  
@@ -946,9 +960,9 @@ diff -r 04958490fc6d sql-common/my_time.c
 +    *ltime= newtime;
 +  return newtime;
 +}
-diff -r 04958490fc6d sql/filesort.cc
---- a/sql/filesort.cc  Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/filesort.cc  Tue Feb 17 22:33:00 2009 -0800
+diff -r 069dc6d4f269 sql/filesort.cc
+--- a/sql/filesort.cc  Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/filesort.cc  Mon Jun 01 00:35:30 2009 -0700
 @@ -180,6 +180,7 @@
    {
      statistic_increment(thd->status_var.filesort_scan_count, &LOCK_status);
@@ -973,15 +987,15 @@ diff -r 04958490fc6d sql/filesort.cc
    if (param->not_killable)
    {
      killed= &not_killable;
-diff -r 04958490fc6d sql/ha_innodb.cc
---- a/sql/ha_innodb.cc Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/ha_innodb.cc Tue Feb 17 22:33:00 2009 -0800
+diff -r 069dc6d4f269 sql/ha_innodb.cc
+--- a/sql/ha_innodb.cc Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/ha_innodb.cc Mon Jun 01 00:35:30 2009 -0700
 @@ -1,3 +1,4 @@
 +
  /* Copyright (C) 2000-2005 MySQL AB & Innobase Oy
  
     This program is free software; you can redistribute it and/or modify
-@@ -805,9 +806,34 @@
+@@ -819,9 +820,34 @@
                trx->check_unique_secondary = TRUE;
        }
  
@@ -1016,16 +1030,16 @@ diff -r 04958490fc6d sql/ha_innodb.cc
  
  /*************************************************************************
  Construct ha_innobase handler. */
-@@ -1309,6 +1335,8 @@
-       }
+@@ -1324,6 +1350,8 @@
  
        /* -------------- Log files ---------------------------*/
-+
-+      srv_slow_log = (ibool) opt_slow_log;
  
++      srv_slow_log = (ibool) opt_slow_log;
++
        /* The default dir for log files is the datadir of MySQL */
  
-@@ -4681,6 +4709,12 @@
+       if (!innobase_log_group_home_dir) {
+@@ -4694,6 +4722,12 @@
                trx->check_unique_secondary = FALSE;
        }
  
@@ -1038,7 +1052,7 @@ diff -r 04958490fc6d sql/ha_innodb.cc
        if (lower_case_table_names) {
                srv_lower_case_table_names = TRUE;
        } else {
-@@ -4946,6 +4980,12 @@
+@@ -4959,6 +4993,12 @@
                trx->check_unique_secondary = FALSE;
        }
  
@@ -1051,7 +1065,7 @@ diff -r 04958490fc6d sql/ha_innodb.cc
        name_len = strlen(name);
  
        assert(name_len < 1000);
-@@ -5033,6 +5073,12 @@
+@@ -5046,6 +5086,12 @@
                trx->check_foreigns = FALSE;
        }
  
@@ -1064,20 +1078,20 @@ diff -r 04958490fc6d sql/ha_innodb.cc
        error = row_drop_database_for_mysql(namebuf, trx);
        my_free(namebuf, MYF(0));
  
-@@ -5097,6 +5143,12 @@
-       if (current_thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) {
+@@ -5112,6 +5158,12 @@
                trx->check_foreigns = FALSE;
-+      }
-+
+       }
 +      if (current_thd->variables.log_slow_verbosity & SLOG_V_INNODB) {
 +              trx->take_stats = TRUE;
 +      } else {
 +              trx->take_stats = FALSE;
-       }
++      }
++
        name_len1 = strlen(from);
-@@ -6106,6 +6158,7 @@
+       name_len2 = strlen(to);
+@@ -6119,6 +6171,7 @@
  {
        row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt;
        trx_t*          trx;
@@ -1085,7 +1099,7 @@ diff -r 04958490fc6d sql/ha_innodb.cc
  
        DBUG_ENTER("ha_innobase::external_lock");
        DBUG_PRINT("enter",("lock_type: %d", lock_type));
-@@ -6229,7 +6282,24 @@
+@@ -6242,7 +6295,24 @@
  
        if (trx->n_mysql_tables_in_use == 0) {
  
@@ -1111,10 +1125,10 @@ diff -r 04958490fc6d sql/ha_innodb.cc
                prebuilt->used_in_HANDLER = FALSE;
  
                if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) {
-diff -r 04958490fc6d sql/ha_innodb.h
---- a/sql/ha_innodb.h  Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/ha_innodb.h  Tue Feb 17 22:33:00 2009 -0800
-@@ -266,6 +266,8 @@
+diff -r 069dc6d4f269 sql/ha_innodb.h
+--- a/sql/ha_innodb.h  Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/ha_innodb.h  Mon Jun 01 00:35:30 2009 -0700
+@@ -271,6 +271,8 @@
  
  int innobase_start_trx_and_assign_read_view(THD* thd);
  
@@ -1123,10 +1137,10 @@ diff -r 04958490fc6d sql/ha_innodb.h
  /***********************************************************************
  This function is used to prepare X/Open XA distributed transaction   */
  
-diff -r 04958490fc6d sql/log.cc
---- a/sql/log.cc       Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/log.cc       Tue Feb 17 22:33:00 2009 -0800
-@@ -2284,11 +2284,12 @@
+diff -r 069dc6d4f269 sql/log.cc
+--- a/sql/log.cc       Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/log.cc       Mon Jun 01 00:35:30 2009 -0700
+@@ -2289,11 +2289,12 @@
  */
  
  bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length,
@@ -1141,7 +1155,7 @@ diff -r 04958490fc6d sql/log.cc
      return 0;
    DBUG_ENTER("MYSQL_LOG::write");
  
-@@ -2298,7 +2299,8 @@
+@@ -2303,7 +2304,8 @@
      int tmp_errno=0;
      char buff[80],*end;
      end=buff;
@@ -1151,7 +1165,7 @@ diff -r 04958490fc6d sql/log.cc
      {
        VOID(pthread_mutex_unlock(&LOCK_log));
        DBUG_RETURN(0);
-@@ -2328,22 +2330,72 @@
+@@ -2333,22 +2335,72 @@
        if (my_b_printf(&log_file, "# User@Host: %s[%s] @ %s [%s]\n",
                        sctx->priv_user ?
                        sctx->priv_user : "",
@@ -1230,10 +1244,10 @@ diff -r 04958490fc6d sql/log.cc
      }
      if (thd->db && strcmp(thd->db,db))
      {                                         // Database changed
-diff -r 04958490fc6d sql/log_event.cc
---- a/sql/log_event.cc Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/log_event.cc Tue Feb 17 22:33:00 2009 -0800
-@@ -2039,6 +2039,7 @@
+diff -r 069dc6d4f269 sql/log_event.cc
+--- a/sql/log_event.cc Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/log_event.cc Mon Jun 01 00:35:30 2009 -0700
+@@ -2057,6 +2057,7 @@
        /* Execute the query (note that we bypass dispatch_command()) */
        const char* found_semicolon= NULL;
        mysql_parse(thd, thd->query, thd->query_length, &found_semicolon);
@@ -1241,14 +1255,13 @@ diff -r 04958490fc6d sql/log_event.cc
  
      }
      else
-diff -r 04958490fc6d sql/mysql_priv.h
---- a/sql/mysql_priv.h Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/mysql_priv.h Tue Feb 17 22:33:00 2009 -0800
-@@ -494,6 +494,78 @@
- #define WEEK_FIRST_WEEKDAY   4
+diff -r 069dc6d4f269 sql/mysql_priv.h
+--- a/sql/mysql_priv.h Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/mysql_priv.h Mon Jun 01 00:35:30 2009 -0700
+@@ -507,6 +507,78 @@
  
  #define STRING_BUFFER_USUAL_SIZE 80
-+
 +/* Slow log */
 +
 +struct msl_opts
@@ -1320,10 +1333,11 @@ diff -r 04958490fc6d sql/mysql_priv.h
 +  { SLOG_F_FILESORT_DISK, "filesort_on_disk" },
 +  { SLOG_F_INVALID,       (char *)0 }
 +};
++
  enum enum_parsing_place
  {
-@@ -1351,6 +1423,7 @@
+   NO_MATTER,
+@@ -1365,6 +1437,7 @@
  extern bool using_update_log, opt_large_files, server_id_supplied;
  extern bool opt_update_log, opt_bin_log, opt_error_log;
  extern my_bool opt_log, opt_slow_log, opt_log_queries_not_using_indexes;
@@ -1331,7 +1345,7 @@ diff -r 04958490fc6d sql/mysql_priv.h
  extern bool opt_disable_networking, opt_skip_show_db;
  extern my_bool opt_character_set_client_handshake;
  extern bool volatile abort_loop, shutdown_in_progress, grant_option;
-@@ -1362,7 +1435,8 @@
+@@ -1376,7 +1449,8 @@
  extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
  extern my_bool opt_secure_auth;
  extern char* opt_secure_file_priv;
@@ -1341,18 +1355,18 @@ diff -r 04958490fc6d sql/mysql_priv.h
  extern my_bool sp_automatic_privileges, opt_noacl;
  extern my_bool opt_old_style_user_limits, trust_function_creators;
  extern uint opt_crash_binlog_innodb;
-diff -r 04958490fc6d sql/mysqld.cc
---- a/sql/mysqld.cc    Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/mysqld.cc    Tue Feb 17 22:33:00 2009 -0800
-@@ -175,7 +175,6 @@
- static void getvolumename();
+diff -r 069dc6d4f269 sql/mysqld.cc
+--- a/sql/mysqld.cc    Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/mysqld.cc    Mon Jun 01 00:35:30 2009 -0700
+@@ -176,7 +176,6 @@
  static void getvolumeID(BYTE *volumeName);
  #endif /* __NETWARE__ */
--
  
+-
  #ifdef _AIX41
  int initgroups(const char *,unsigned int);
-@@ -409,10 +408,13 @@
+ #endif
+@@ -411,10 +410,13 @@
  my_bool opt_secure_auth= 0;
  char* opt_secure_file_priv= 0;
  my_bool opt_log_slow_admin_statements= 0;
@@ -1366,7 +1380,7 @@ diff -r 04958490fc6d sql/mysqld.cc
  /*
    True if there is at least one per-hour limit for some user, so we should
    check them before each query (and possibly reset counters when hour is
-@@ -507,6 +509,7 @@
+@@ -509,6 +511,7 @@
  Ge_creator ge_creator;
  Le_creator le_creator;
  
@@ -1374,7 +1388,7 @@ diff -r 04958490fc6d sql/mysqld.cc
  
  FILE *bootstrap_file;
  int bootstrap_error;
-@@ -584,7 +587,7 @@
+@@ -588,7 +591,7 @@
  static int cleanup_done;
  static ulong opt_specialflag, opt_myisam_block_size;
  static char *opt_logname, *opt_update_logname, *opt_binlog_index_name;
@@ -1383,7 +1397,7 @@ diff -r 04958490fc6d sql/mysqld.cc
  static char *mysql_home_ptr, *pidfile_name_ptr;
  static char **defaults_argv;
  static char *opt_bin_logname;
-@@ -3693,6 +3696,8 @@
+@@ -3697,6 +3700,8 @@
        unireg_abort(1);
      }
    }
@@ -1392,7 +1406,7 @@ diff -r 04958490fc6d sql/mysqld.cc
  #endif /* __WIN__ */
  
    if (init_common_variables(MYSQL_CONFIG_NAME,
-@@ -4943,7 +4948,7 @@
+@@ -4947,7 +4952,7 @@
    OPT_INTERACTIVE_TIMEOUT, OPT_JOIN_BUFF_SIZE,
    OPT_KEY_BUFFER_SIZE, OPT_KEY_CACHE_BLOCK_SIZE,
    OPT_KEY_CACHE_DIVISION_LIMIT, OPT_KEY_CACHE_AGE_THRESHOLD,
@@ -1401,7 +1415,7 @@ diff -r 04958490fc6d sql/mysqld.cc
    OPT_LOWER_CASE_TABLE_NAMES, OPT_MAX_ALLOWED_PACKET,
    OPT_MAX_BINLOG_CACHE_SIZE, OPT_MAX_BINLOG_SIZE,
    OPT_MAX_CONNECTIONS, OPT_MAX_CONNECT_ERRORS,
-@@ -5034,11 +5039,18 @@
+@@ -5038,11 +5043,18 @@
    OPT_TIMED_MUTEXES,
    OPT_OLD_STYLE_USER_LIMITS,
    OPT_LOG_SLOW_ADMIN_STATEMENTS,
@@ -1420,7 +1434,7 @@ diff -r 04958490fc6d sql/mysqld.cc
    OPT_INNODB_ROLLBACK_ON_TIMEOUT,
    OPT_SECURE_FILE_PRIV,
    OPT_KEEP_FILES_ON_CREATE,
-@@ -5428,8 +5440,17 @@
+@@ -5441,10 +5453,19 @@
     (gptr*) &opt_log_slow_admin_statements,
     (gptr*) &opt_log_slow_admin_statements,
     0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -1431,14 +1445,16 @@ diff -r 04958490fc6d sql/mysqld.cc
 +   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
    {"log-slow-queries", OPT_SLOW_QUERY_LOG,
      "Log slow queries to this log file. Defaults logging to hostname-slow.log file. Must be enabled to activate other slow log options.",
-+   (gptr*) &opt_slow_logname, (gptr*) &opt_slow_logname, 0, GET_STR, OPT_ARG,
-+   0, 0, 0, 0, 0, 0},
-+  {"slow_query_log_file", OPT_SLOW_QUERY_LOG_FILE,
-+    "Log slow queries to given log file. Defaults logging to hostname-slow.log. Must be enabled to activate other slow log options.",
     (gptr*) &opt_slow_logname, (gptr*) &opt_slow_logname, 0, GET_STR, OPT_ARG,
     0, 0, 0, 0, 0, 0},
++  {"slow_query_log_file", OPT_SLOW_QUERY_LOG_FILE,
++    "Log slow queries to given log file. Defaults logging to hostname-slow.log. Must be enabled to activate other slow log options.",
++   (gptr*) &opt_slow_logname, (gptr*) &opt_slow_logname, 0, GET_STR, OPT_ARG,
++   0, 0, 0, 0, 0, 0},
    {"log-tc", OPT_LOG_TC,
-@@ -5795,6 +5816,9 @@
+    "Path to transaction coordinator log (used for transactions that affect "
+    "more than one storage engine, when binary log is disabled)",
+@@ -5808,6 +5829,9 @@
     "Tells the slave thread to continue replication when a query returns an error from the provided list.",
     0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
  #endif
@@ -1448,7 +1464,7 @@ diff -r 04958490fc6d sql/mysqld.cc
    {"socket", OPT_SOCKET, "Socket file to use for connection.",
     (gptr*) &mysqld_unix_port, (gptr*) &mysqld_unix_port, 0, GET_STR,
     REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-@@ -6097,11 +6121,31 @@
+@@ -6110,11 +6134,31 @@
     (gptr*) 0,
     0, (GET_ULONG | GET_ASK_ADDR) , REQUIRED_ARG, 100,
     1, 100, 0, 1, 0},
@@ -1471,7 +1487,7 @@ diff -r 04958490fc6d sql/mysqld.cc
 +   {"long_query_time", OPT_LONG_QUERY_TIME,
 +    "Log all queries that have taken more than long_query_time seconds to execute to file.",
 +    (gptr*) &global_system_variables.long_query_time,
-+    (gptr*) &max_system_variables.long_query_time, 0, GET_DOUBLE,
++    (gptr*) &max_system_variables.long_query_time, 0, GET_MICROTIME,
 +    REQUIRED_ARG, 10000000, 0, LONG_TIMEOUT * 1000000, 0, 1, 0},
 +  {"min_examined_row_limit", OPT_MIN_EXAMINED_ROW_LIMIT,
 +    "Don't log queries which examine less than min_examined_row_limit rows to file.",
@@ -1485,7 +1501,7 @@ diff -r 04958490fc6d sql/mysqld.cc
    {"lower_case_table_names", OPT_LOWER_CASE_TABLE_NAMES,
     "If set to 1 table names are stored in lowercase on disk and table names will be case-insensitive.  Should be set to 2 if you are using a case insensitive file system",
     (gptr*) &lower_case_table_names,
-@@ -6878,7 +6922,11 @@
+@@ -6893,7 +6937,11 @@
    global_system_variables.max_join_size= (ulonglong) HA_POS_ERROR;
    max_system_variables.max_join_size=   (ulonglong) HA_POS_ERROR;
    global_system_variables.old_passwords= 0;
@@ -1498,7 +1514,7 @@ diff -r 04958490fc6d sql/mysqld.cc
    /*
      Default behavior for 4.1 and 5.0 is to treat NULL values as unequal
      when collecting index statistics for MyISAM tables.
-@@ -7339,6 +7387,35 @@
+@@ -7364,6 +7412,35 @@
    case OPT_BOOTSTRAP:
      opt_noacl=opt_bootstrap=1;
      break;
@@ -1534,7 +1550,7 @@ diff -r 04958490fc6d sql/mysqld.cc
    case OPT_STORAGE_ENGINE:
    {
      if ((enum db_type)((global_system_variables.table_type=
-@@ -7671,10 +7748,14 @@
+@@ -7696,10 +7773,14 @@
    if (opt_bdb)
      sql_print_warning("this binary does not contain BDB storage engine");
  #endif
@@ -1552,9 +1568,9 @@ diff -r 04958490fc6d sql/mysqld.cc
    if (argc > 0)
    {
      fprintf(stderr, "%s: Too many arguments (first extra is '%s').\nUse --help to get a list of available options\n", my_progname, *argv);
-diff -r 04958490fc6d sql/set_var.cc
---- a/sql/set_var.cc   Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/set_var.cc   Tue Feb 17 22:33:00 2009 -0800
+diff -r 069dc6d4f269 sql/set_var.cc
+--- a/sql/set_var.cc   Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/set_var.cc   Mon Jun 01 00:35:30 2009 -0700
 @@ -217,9 +217,13 @@
    sys_log_queries_not_using_indexes("log_queries_not_using_indexes",
                                      &opt_log_queries_not_using_indexes);
@@ -1600,7 +1616,7 @@ diff -r 04958490fc6d sql/set_var.cc
  sys_var_long_ptr      sys_rpl_recovery_rank("rpl_recovery_rank",
                                              &rpl_recovery_rank);
  sys_var_long_ptr      sys_query_cache_size("query_cache_size",
-@@ -694,6 +714,10 @@
+@@ -697,6 +717,10 @@
    &sys_log_off,
    &sys_log_queries_not_using_indexes,
    &sys_log_slow,
@@ -1611,7 +1627,7 @@ diff -r 04958490fc6d sql/set_var.cc
    &sys_log_update,
    &sys_log_warnings,
    &sys_long_query_time,
-@@ -717,6 +741,7 @@
+@@ -720,6 +744,7 @@
    &sys_max_tmp_tables,
    &sys_max_user_connections,
    &sys_max_write_lock_count,
@@ -1619,7 +1635,7 @@ diff -r 04958490fc6d sql/set_var.cc
    &sys_multi_range_count,
    &sys_myisam_data_pointer_size,
    &sys_myisam_max_sort_file_size,
-@@ -770,6 +795,8 @@
+@@ -773,6 +798,8 @@
    &sys_slave_skip_counter,
  #endif
    &sys_slow_launch_time,
@@ -1628,7 +1644,7 @@ diff -r 04958490fc6d sql/set_var.cc
    &sys_sort_buffer,
    &sys_sql_big_tables,
    &sys_sql_low_priority_updates,
-@@ -986,8 +1013,11 @@
+@@ -994,8 +1021,11 @@
    {"log_slave_updates",       (char*) &opt_log_slave_updates,       SHOW_MY_BOOL},
  #endif
    {sys_log_slow.name,         (char*) &sys_log_slow,                SHOW_SYS},
@@ -1641,7 +1657,7 @@ diff -r 04958490fc6d sql/set_var.cc
    {sys_low_priority_updates.name, (char*) &sys_low_priority_updates, SHOW_SYS},
    {"lower_case_file_system",  (char*) &lower_case_file_system,      SHOW_MY_BOOL},
    {"lower_case_table_names",  (char*) &lower_case_table_names,      SHOW_INT},
-@@ -1014,6 +1044,7 @@
+@@ -1022,6 +1052,7 @@
    {sys_max_tmp_tables.name,   (char*) &sys_max_tmp_tables,        SHOW_SYS},
    {sys_max_user_connections.name,(char*) &sys_max_user_connections, SHOW_SYS},
    {sys_max_write_lock_count.name, (char*) &sys_max_write_lock_count,SHOW_SYS},
@@ -1649,7 +1665,7 @@ diff -r 04958490fc6d sql/set_var.cc
    {sys_multi_range_count.name,  (char*) &sys_multi_range_count,     SHOW_SYS},
    {sys_myisam_data_pointer_size.name, (char*) &sys_myisam_data_pointer_size, SHOW_SYS},
    {sys_myisam_max_sort_file_size.name, (char*) &sys_myisam_max_sort_file_size,
-@@ -1101,6 +1132,8 @@
+@@ -1109,6 +1140,8 @@
    {sys_slave_trans_retries.name,(char*) &sys_slave_trans_retries,   SHOW_SYS},
  #endif
    {sys_slow_launch_time.name, (char*) &sys_slow_launch_time,        SHOW_SYS},
@@ -1658,7 +1674,7 @@ diff -r 04958490fc6d sql/set_var.cc
  #ifdef HAVE_SYS_UN_H
    {"socket",                  (char*) &mysqld_unix_port,             SHOW_CHAR_PTR},
  #endif
-@@ -1141,6 +1174,7 @@
+@@ -1149,6 +1182,7 @@
    {sys_tx_isolation.name,     (char*) &sys_tx_isolation,          SHOW_SYS},
    {sys_updatable_views_with_limit.name,
                                (char*) &sys_updatable_views_with_limit,SHOW_SYS},
@@ -1666,7 +1682,7 @@ diff -r 04958490fc6d sql/set_var.cc
    {sys_version.name,          (char*) &sys_version,                 SHOW_SYS},
  #ifdef HAVE_BERKELEY_DB
    {sys_version_bdb.name,      (char*) &sys_version_bdb,             SHOW_SYS},
-@@ -1769,6 +1803,17 @@
+@@ -1777,6 +1811,17 @@
  }
  
  
@@ -1684,11 +1700,10 @@ diff -r 04958490fc6d sql/set_var.cc
  bool sys_var_thd_bool::update(THD *thd,  set_var *var)
  {
    if (var->type == OPT_GLOBAL)
-@@ -1924,6 +1969,19 @@
-     value= *(longlong*) value_ptr(thd, var_type, base);
+@@ -1933,6 +1978,19 @@
      pthread_mutex_unlock(&LOCK_global_system_variables);
      return new Item_int(value);
-+  }
+   }
 +  case SHOW_MICROTIME:
 +  {
 +    longlong value;
@@ -1701,10 +1716,11 @@ diff -r 04958490fc6d sql/set_var.cc
 +
 +    len = snprintf(buff, 80, "%f", ((double) value) / 1000000.0);
 +    return new Item_float(buff,len);
-   }
++  }
    case SHOW_HA_ROWS:
    {
-@@ -2757,6 +2815,30 @@
+     ha_rows value;
+@@ -2765,6 +2823,30 @@
  }
  
  
@@ -1735,7 +1751,7 @@ diff -r 04958490fc6d sql/set_var.cc
  #ifdef HAVE_REPLICATION
  bool sys_var_slave_skip_counter::check(THD *thd, set_var *var)
  {
-@@ -3526,6 +3608,191 @@
+@@ -3534,6 +3616,191 @@
  #endif
  }
  
@@ -1927,9 +1943,9 @@ diff -r 04958490fc6d sql/set_var.cc
  /****************************************************************************
   Functions to handle table_type
  ****************************************************************************/
-diff -r 04958490fc6d sql/set_var.h
---- a/sql/set_var.h    Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/set_var.h    Tue Feb 17 22:33:00 2009 -0800
+diff -r 069dc6d4f269 sql/set_var.h
+--- a/sql/set_var.h    Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/set_var.h    Mon Jun 01 00:35:30 2009 -0700
 @@ -132,6 +132,7 @@
  };
  
@@ -1968,14 +1984,14 @@ diff -r 04958490fc6d sql/set_var.h
  class sys_var_thd_ha_rows :public sys_var_thd
  {
  public:
-@@ -377,7 +383,6 @@
-   SHOW_TYPE show_type() { return SHOW_HA_ROWS; }
+@@ -378,7 +384,6 @@
    byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
  };
--
  
+-
  class sys_var_thd_ulonglong :public sys_var_thd
  {
+ public:
 @@ -407,6 +412,19 @@
    }
  };
@@ -1996,11 +2012,10 @@ diff -r 04958490fc6d sql/set_var.h
  
  class sys_var_thd_bool :public sys_var_thd
  {
-@@ -477,6 +495,66 @@
-                                             ulong *length);
+@@ -478,6 +496,66 @@
  };
  
-+
 +class sys_var_thd_msl_option :public sys_var_thd
 +{
 +protected:
@@ -2060,9 +2075,10 @@ diff -r 04958490fc6d sql/set_var.h
 +  bool update(THD *thd, set_var *var);
 +  byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
 +};
++
  class sys_var_thd_storage_engine :public sys_var_thd
  {
+ protected:
 @@ -1087,3 +1165,11 @@
  bool process_key_caches(int (* func) (const char *name, KEY_CACHE *));
  void delete_elements(I_List<NAMED_LIST> *list,
@@ -2075,10 +2091,10 @@ diff -r 04958490fc6d sql/set_var.h
 +                               const ulong none_val, const ulong invalid_val);
 +const char *msl_option_get_name(const struct msl_opts *opts, ulong val);
 +char *msl_flag_get_name(const struct msl_opts *opts, char *buf, ulong val);
-diff -r 04958490fc6d sql/slave.cc
---- a/sql/slave.cc     Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/slave.cc     Tue Feb 17 22:33:00 2009 -0800
-@@ -2925,6 +2925,12 @@
+diff -r 069dc6d4f269 sql/slave.cc
+--- a/sql/slave.cc     Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/slave.cc     Mon Jun 01 00:35:30 2009 -0700
+@@ -2975,6 +2975,12 @@
      + MAX_LOG_EVENT_HEADER;  /* note, incr over the global not session var */
    thd->slave_thread = 1;
    set_slave_thread_options(thd);
@@ -2091,10 +2107,10 @@ diff -r 04958490fc6d sql/slave.cc
    thd->client_capabilities = CLIENT_LOCAL_FILES;
    thd->real_id=pthread_self();
    pthread_mutex_lock(&LOCK_thread_count);
-diff -r 04958490fc6d sql/sql_cache.cc
---- a/sql/sql_cache.cc Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/sql_cache.cc Tue Feb 17 22:33:00 2009 -0800
-@@ -1341,6 +1341,7 @@
+diff -r 069dc6d4f269 sql/sql_cache.cc
+--- a/sql/sql_cache.cc Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/sql_cache.cc Mon Jun 01 00:35:30 2009 -0700
+@@ -1402,6 +1402,7 @@
  
    thd->limit_found_rows = query->found_rows();
    thd->status_var.last_query_cost= 0.0;
@@ -2102,7 +2118,7 @@ diff -r 04958490fc6d sql/sql_cache.cc
  
    BLOCK_UNLOCK_RD(query_block);
    DBUG_RETURN(1);                             // Result sent to client
-@@ -1348,6 +1349,7 @@
+@@ -1409,6 +1410,7 @@
  err_unlock:
    STRUCT_UNLOCK(&structure_guard_mutex);
  err:
@@ -2110,19 +2126,19 @@ diff -r 04958490fc6d sql/sql_cache.cc
    DBUG_RETURN(0);                             // Query was not cached
  }
  
-diff -r 04958490fc6d sql/sql_class.cc
---- a/sql/sql_class.cc Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/sql_class.cc Tue Feb 17 22:33:00 2009 -0800
-@@ -188,7 +188,7 @@
-    lock_id(&main_lock_id),
-    user_time(0), in_sub_stmt(0), global_read_lock(0), is_fatal_error(0),
+diff -r 069dc6d4f269 sql/sql_class.cc
+--- a/sql/sql_class.cc Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/sql_class.cc Mon Jun 01 00:35:30 2009 -0700
+@@ -190,7 +190,7 @@
+    table_map_for_update(0),
+    global_read_lock(0), is_fatal_error(0),
     transaction_rollback_request(0), is_fatal_sub_stmt_error(0),
 -   rand_used(0), time_zone_used(0),
 +   rand_used(0), time_zone_used(0), user_timer(0),
     last_insert_id_used(0), last_insert_id_used_bin_log(0), insert_id_used(0),
     clear_next_insert_id(0), in_lock_tables(0), bootstrap(0),
     derived_tables_processing(FALSE), spcont(NULL),
-@@ -2224,6 +2224,12 @@
+@@ -2251,6 +2251,12 @@
    backup->cuted_fields=     cuted_fields;
    backup->client_capabilities= client_capabilities;
    backup->savepoints= transaction.savepoints;
@@ -2135,7 +2151,7 @@ diff -r 04958490fc6d sql/sql_class.cc
  
    if (!lex->requires_prelocking() || is_update_query(lex->sql_command))
      options&= ~OPTION_BIN_LOG;
-@@ -2240,7 +2246,13 @@
+@@ -2267,7 +2273,13 @@
    sent_row_count= 0;
    cuted_fields= 0;
    transaction.savepoints= 0;
@@ -2150,7 +2166,7 @@ diff -r 04958490fc6d sql/sql_class.cc
    /* Surpress OK packets in case if we will execute statements */
    net.no_send_ok= TRUE;
  }
-@@ -2293,6 +2305,12 @@
+@@ -2320,6 +2332,12 @@
    */
    examined_row_count+= backup->examined_row_count;
    cuted_fields+=       backup->cuted_fields;
@@ -2163,9 +2179,9 @@ diff -r 04958490fc6d sql/sql_class.cc
  }
  
  
-diff -r 04958490fc6d sql/sql_class.h
---- a/sql/sql_class.h  Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/sql_class.h  Tue Feb 17 22:33:00 2009 -0800
+diff -r 069dc6d4f269 sql/sql_class.h
+--- a/sql/sql_class.h  Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/sql_class.h  Mon Jun 01 00:35:30 2009 -0700
 @@ -43,6 +43,7 @@
  extern char internal_table_name[2];
  extern char empty_c_string[1];
@@ -2213,7 +2229,7 @@ diff -r 04958490fc6d sql/sql_class.h
    ulong table_type;
    ulong tx_isolation;
    ulong completion_type;
-@@ -1128,6 +1133,12 @@
+@@ -1129,6 +1134,12 @@
    uint in_sub_stmt;
    bool enable_slow_log, insert_id_used, clear_next_insert_id;
    bool last_insert_id_used;
@@ -2226,7 +2242,7 @@ diff -r 04958490fc6d sql/sql_class.h
    my_bool no_send_ok;
    SAVEPOINT *savepoints;
  };
-@@ -1184,6 +1195,11 @@
+@@ -1185,6 +1196,11 @@
  class THD :public Statement,
             public Open_tables_state
  {
@@ -2238,7 +2254,7 @@ diff -r 04958490fc6d sql/sql_class.h
  public:
    /*
      Constant for THD::where initialization in the beginning of every query.
-@@ -1292,10 +1308,24 @@
+@@ -1293,10 +1309,24 @@
    */
    const char *where;
    time_t     start_time,time_after_lock,user_time;
@@ -2263,7 +2279,7 @@ diff -r 04958490fc6d sql/sql_class.h
    /* <> 0 if we are inside of trigger or stored function. */
    uint in_sub_stmt;
  
-@@ -1685,11 +1715,11 @@
+@@ -1696,11 +1726,11 @@
        sql_print_information("time() failed with %d", errno);
    }
  
@@ -2280,8 +2296,9 @@ diff -r 04958490fc6d sql/sql_class.h
    inline void insert_id(ulonglong id_arg)
    {
      last_insert_id= id_arg;
---- mysql-5.0.81-inno/sql/sql_parse.cc 2009-05-21 19:11:27.050444461 +0300
-+++ mysql-5.0.81/sql/sql_parse.cc      2009-05-21 19:12:17.201898080 +0300
+diff -r 069dc6d4f269 sql/sql_parse.cc
+--- a/sql/sql_parse.cc Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/sql_parse.cc Mon Jun 01 00:35:30 2009 -0700
 @@ -20,6 +20,7 @@
  #include <m_ctype.h>
  #include <myisam.h>
@@ -2290,7 +2307,7 @@ diff -r 04958490fc6d sql/sql_class.h
  
  #ifdef HAVE_INNOBASE_DB
  #include "ha_innodb.h"
-@@ -1230,6 +1231,15 @@
+@@ -1227,6 +1228,15 @@
      my_net_set_read_timeout(net, thd->variables.net_read_timeout);
      my_net_set_write_timeout(net, thd->variables.net_write_timeout);
  
@@ -2306,37 +2323,39 @@ diff -r 04958490fc6d sql/sql_class.h
      while (!net->error && net->vio != 0 &&
             !(thd->killed == THD::KILL_CONNECTION))
      {
-@@ -2356,28 +2366,56 @@
+@@ -2353,28 +2363,58 @@
      return;                                     // Don't set time for sub stmt
  
    start_of_query= thd->start_time;
+-  thd->end_time();                            // Set start time
 +  ulonglong start_of_query_timer= thd->start_timer;
-   thd->end_time();                            // Set start time
++  thd->end_time();                            // Set start timea
++
 +
 +  /* Follow the slow log filter configuration. */
-+  if (thd->variables.log_slow_filter != SLOG_F_NONE && 
++  if (thd->variables.log_slow_filter != SLOG_F_NONE &&
 +      (!(thd->variables.log_slow_filter & thd->query_plan_flags) ||
-+       ((thd->variables.log_slow_filter & SLOG_F_QC_NO) && 
++       ((thd->variables.log_slow_filter & SLOG_F_QC_NO) &&
 +        (thd->query_plan_flags & QPLAN_QC))))
 +    return;
 +
 +  /*
-+    Low long_query_time value most likely means user is debugging stuff and even 
-+    though some thread's queries are not supposed to be logged b/c of the rate 
-+    limit, if one of them takes long enough (>= 1 second) it will be sensible 
++    Low long_query_time value most likely means user is debugging stuff and even
++    though some thread's queries are not supposed to be logged b/c of the rate
++    limit, if one of them takes long enough (>= 1 second) it will be sensible
 +    to make an exception and write to slow log anyway.
 +  */
++
 +  if (opt_use_global_long_query_time)
 +    thd->variables.long_query_time = global_system_variables.long_query_time;
-+  if (thd->write_to_slow_log != TRUE && thd->variables.long_query_time < 1000000 &&
-+      (ulong) (thd->start_timer - thd->timer_after_lock) >= 1000000)
-+    thd->write_to_slow_log= TRUE;
 +
 +  /* Do not log this thread's queries due to rate limiting. */
-+  if (thd->write_to_slow_log != TRUE)
++  if (thd->write_to_slow_log != TRUE
++      && (thd->variables.long_query_time >= 1000000
++          || (ulong) (thd->start_timer - thd->timer_after_lock) < 1000000))
 +    return;
 +
    /*
      Do not log administrative statements unless the appropriate option is
      set; do not log into slow log if reading from backup.
@@ -2345,21 +2364,27 @@ diff -r 04958490fc6d sql/sql_class.h
 +  if (thd->enable_slow_log &&
 +      (!thd->user_time || (thd->slave_thread && opt_log_slow_slave_statements))
 +     )
++
    {
      thd_proc_info(thd, "logging slow query");
  
 -    if ((thd->start_time > thd->time_after_lock && 
 -         (ulong) (thd->start_time - thd->time_after_lock) >
-+    if (((thd->start_time > thd->time_after_lock && 
-+         (ulong) (thd->start_time - thd->time_after_lock) >=
-       thd->variables.long_query_time) ||
-         (thd->server_status &
-         (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
-         opt_log_queries_not_using_indexes &&
-         /* == SQLCOM_END unless this is a SHOW command */
+-      thd->variables.long_query_time) ||
+-        (thd->server_status &
+-        (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
+-        opt_log_queries_not_using_indexes &&
+-        /* == SQLCOM_END unless this is a SHOW command */
 -        thd->lex->orig_sql_command == SQLCOM_END)
-+        thd->lex->orig_sql_command == SQLCOM_END) &&
-+          thd->examined_row_count >= thd->variables.min_examined_row_limit)
++    if (((ulong) (thd->start_timer - thd->timer_after_lock) >=
++         thd->variables.long_query_time ||
++         (thd->server_status &
++              (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
++         opt_log_queries_not_using_indexes &&
++         /* == SQLCOM_END unless this is a SHOW command */
++         thd->lex->orig_sql_command == SQLCOM_END) &&
++        thd->examined_row_count >= thd->variables.min_examined_row_limit)
++
      {
        thd_proc_info(thd, "logging slow query");
        thd->status_var.long_query_count++;
@@ -2368,10 +2393,35 @@ diff -r 04958490fc6d sql/sql_class.h
      }
    }
  }
-diff -r 04958490fc6d sql/sql_select.cc
---- a/sql/sql_select.cc        Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/sql_select.cc        Tue Feb 17 22:33:00 2009 -0800
-@@ -6224,8 +6224,11 @@
+@@ -2669,6 +2709,8 @@
+     context.resolve_in_table_list_only((TABLE_LIST*)select_lex->
+                                        table_list.first);
++  /* Reset the counter at all cases for the extended slow query log */
++  thd->row_count= 1;
+   /*
+     Reset warning count for each query that uses tables
+     A better approach would be to reset this for any commands
+@@ -6203,6 +6245,15 @@
+     thd->total_warn_count=0;                  // Warnings for this query
+     thd->rand_used= 0;
+     thd->sent_row_count= thd->examined_row_count= 0;
++    thd->innodb_was_used= FALSE;
++    thd->innodb_io_reads= 0;
++    thd->innodb_io_read= 0;
++    thd->innodb_io_reads_wait_timer= 0;
++    thd->innodb_lock_que_wait_timer= 0;
++    thd->innodb_innodb_que_wait_timer= 0;
++    thd->innodb_page_access= 0;
++    thd->query_plan_flags= QPLAN_NONE;
++    thd->query_plan_fsort_passes= 0;
+   }
+   DBUG_VOID_RETURN;
+ }
+diff -r 069dc6d4f269 sql/sql_select.cc
+--- a/sql/sql_select.cc        Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/sql_select.cc        Mon Jun 01 00:35:30 2009 -0700
+@@ -6262,8 +6262,11 @@
          {
            join->thd->server_status|=SERVER_QUERY_NO_INDEX_USED;
            if (statistics)
@@ -2383,7 +2433,7 @@ diff -r 04958490fc6d sql/sql_select.cc
          }
        }
        else
-@@ -6240,8 +6243,11 @@
+@@ -6278,8 +6281,11 @@
          {
            join->thd->server_status|=SERVER_QUERY_NO_INDEX_USED;
            if (statistics)
@@ -2395,7 +2445,7 @@ diff -r 04958490fc6d sql/sql_select.cc
          }
        }
        if (!table->no_keyread)
-@@ -9305,6 +9311,7 @@
+@@ -9340,6 +9346,7 @@
                      (ulong) rows_limit,test(group)));
  
    statistic_increment(thd->status_var.created_tmp_tables, &LOCK_status);
@@ -2403,7 +2453,7 @@ diff -r 04958490fc6d sql/sql_select.cc
  
    if (use_temp_pool && !(test_flags & TEST_KEEP_TMP_TABLES))
      temp_pool_slot = bitmap_set_next(&temp_pool);
-@@ -10165,6 +10172,7 @@
+@@ -10200,6 +10207,7 @@
    }
    statistic_increment(table->in_use->status_var.created_tmp_disk_tables,
                      &LOCK_status);
@@ -2411,25 +2461,25 @@ diff -r 04958490fc6d sql/sql_select.cc
    table->s->db_record_offset= 1;
    DBUG_RETURN(0);
   err:
-diff -r 04958490fc6d sql/sql_show.cc
---- a/sql/sql_show.cc  Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/sql_show.cc  Tue Feb 17 22:33:00 2009 -0800
-@@ -1544,6 +1544,12 @@
-           value= ((char *) status_var + (ulonglong) value);
+diff -r 069dc6d4f269 sql/sql_show.cc
+--- a/sql/sql_show.cc  Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/sql_show.cc  Mon Jun 01 00:35:30 2009 -0700
+@@ -1560,6 +1560,12 @@
          case SHOW_LONGLONG:
            end= longlong10_to_str(*(longlong*) value, buff, 10);
-+          break;
+           break;
 +        case SHOW_MICROTIME:
 +          show_type= ((sys_var*) value)->show_type();
 +          value=     (char*) ((sys_var*) value)->value_ptr(thd, value_type,
 +                                                           &null_lex_str);
 +          end= buff + sprintf(buff, "%f", (((double) (*(ulonglong*)value))) / 1000000.0);
-           break;
++          break;
          case SHOW_HA_ROWS:
            end= longlong10_to_str((longlong) *(ha_rows*) value, buff, 10);
-diff -r 04958490fc6d sql/structs.h
---- a/sql/structs.h    Tue Feb 17 22:32:27 2009 -0800
-+++ b/sql/structs.h    Tue Feb 17 22:33:00 2009 -0800
+           break;
+diff -r 069dc6d4f269 sql/structs.h
+--- a/sql/structs.h    Mon Jun 01 00:35:20 2009 -0700
++++ b/sql/structs.h    Mon Jun 01 00:35:30 2009 -0700
 @@ -168,8 +168,8 @@
  enum SHOW_TYPE
  {
index f817c0453fc0bea58e3907771e6ae28ef792e6a8..a3719a10f90b8b2f26cc41e7cb9ff6c89ff509d0 100644 (file)
@@ -1,6 +1,6 @@
-diff -r 23e5576aa59a BUILD/Makefile.in
---- a/BUILD/Makefile.in        Tue Feb 17 22:33:00 2009 -0800
-+++ b/BUILD/Makefile.in        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 BUILD/Makefile.in
+--- a/BUILD/Makefile.in        Mon Jun 01 00:35:44 2009 -0700
++++ b/BUILD/Makefile.in        Mon Jun 01 00:36:01 2009 -0700
 @@ -146,6 +146,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -9,9 +9,9 @@ diff -r 23e5576aa59a BUILD/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a Docs/Makefile.in
---- a/Docs/Makefile.in Tue Feb 17 22:33:00 2009 -0800
-+++ b/Docs/Makefile.in Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 Docs/Makefile.in
+--- a/Docs/Makefile.in Mon Jun 01 00:35:44 2009 -0700
++++ b/Docs/Makefile.in Mon Jun 01 00:36:01 2009 -0700
 @@ -144,6 +144,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -20,9 +20,9 @@ diff -r 23e5576aa59a Docs/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a Makefile.in
---- a/Makefile.in      Tue Feb 17 22:33:00 2009 -0800
-+++ b/Makefile.in      Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 Makefile.in
+--- a/Makefile.in      Mon Jun 01 00:35:44 2009 -0700
++++ b/Makefile.in      Mon Jun 01 00:36:01 2009 -0700
 @@ -171,6 +171,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -31,9 +31,9 @@ diff -r 23e5576aa59a Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a SSL/Makefile.in
---- a/SSL/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/SSL/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 SSL/Makefile.in
+--- a/SSL/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/SSL/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -144,6 +144,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -42,9 +42,9 @@ diff -r 23e5576aa59a SSL/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a client/Makefile.in
---- a/client/Makefile.in       Tue Feb 17 22:33:00 2009 -0800
-+++ b/client/Makefile.in       Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 client/Makefile.in
+--- a/client/Makefile.in       Mon Jun 01 00:35:44 2009 -0700
++++ b/client/Makefile.in       Mon Jun 01 00:36:01 2009 -0700
 @@ -247,6 +247,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -53,9 +53,9 @@ diff -r 23e5576aa59a client/Makefile.in
  LIBS = @CLIENT_LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a cmd-line-utils/Makefile.in
---- a/cmd-line-utils/Makefile.in       Tue Feb 17 22:33:00 2009 -0800
-+++ b/cmd-line-utils/Makefile.in       Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 cmd-line-utils/Makefile.in
+--- a/cmd-line-utils/Makefile.in       Mon Jun 01 00:35:44 2009 -0700
++++ b/cmd-line-utils/Makefile.in       Mon Jun 01 00:36:01 2009 -0700
 @@ -157,6 +157,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -64,10 +64,10 @@ diff -r 23e5576aa59a cmd-line-utils/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a cmd-line-utils/libedit/Makefile.in
---- a/cmd-line-utils/libedit/Makefile.in       Tue Feb 17 22:33:00 2009 -0800
-+++ b/cmd-line-utils/libedit/Makefile.in       Tue Feb 17 22:33:23 2009 -0800
-@@ -175,6 +175,7 @@
+diff -r 1ac0113deff5 cmd-line-utils/libedit/Makefile.in
+--- a/cmd-line-utils/libedit/Makefile.in       Mon Jun 01 00:35:44 2009 -0700
++++ b/cmd-line-utils/libedit/Makefile.in       Mon Jun 01 00:36:01 2009 -0700
+@@ -166,6 +166,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
  LIBOBJS = @LIBOBJS@
@@ -75,9 +75,9 @@ diff -r 23e5576aa59a cmd-line-utils/libedit/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a cmd-line-utils/readline/Makefile.in
---- a/cmd-line-utils/readline/Makefile.in      Tue Feb 17 22:33:00 2009 -0800
-+++ b/cmd-line-utils/readline/Makefile.in      Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 cmd-line-utils/readline/Makefile.in
+--- a/cmd-line-utils/readline/Makefile.in      Mon Jun 01 00:35:44 2009 -0700
++++ b/cmd-line-utils/readline/Makefile.in      Mon Jun 01 00:36:01 2009 -0700
 @@ -173,6 +173,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -86,10 +86,10 @@ diff -r 23e5576aa59a cmd-line-utils/readline/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a configure
---- a/configure        Tue Feb 17 22:33:00 2009 -0800
-+++ b/configure        Tue Feb 17 22:33:23 2009 -0800
-@@ -39583,7 +39583,91 @@
+diff -r 1ac0113deff5 configure
+--- a/configure        Mon Jun 01 00:35:44 2009 -0700
++++ b/configure        Mon Jun 01 00:36:01 2009 -0700
+@@ -35333,7 +35333,91 @@
        # We also disable for SCO for the time being, the headers for the
        # thread library we use conflicts with other headers.
      ;;
@@ -182,7 +182,7 @@ diff -r 23e5576aa59a configure
  for ac_func in clock_gettime
  do
  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-@@ -42956,7 +43040,7 @@
+@@ -38777,7 +38861,7 @@
  
  fi
  
@@ -191,10 +191,10 @@ diff -r 23e5576aa59a configure
  
  
  
-diff -r 23e5576aa59a configure.in
---- a/configure.in     Tue Feb 17 22:33:00 2009 -0800
-+++ b/configure.in     Tue Feb 17 22:33:23 2009 -0800
-@@ -2098,7 +2098,18 @@
+diff -r 1ac0113deff5 configure.in
+--- a/configure.in     Mon Jun 01 00:35:44 2009 -0700
++++ b/configure.in     Mon Jun 01 00:36:01 2009 -0700
+@@ -2122,7 +2122,18 @@
        # We also disable for SCO for the time being, the headers for the
        # thread library we use conflicts with other headers.
      ;;
@@ -214,7 +214,7 @@ diff -r 23e5576aa59a configure.in
      ;;
  esac
  
-@@ -2713,7 +2724,7 @@
+@@ -2758,7 +2769,7 @@
    AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should be client be thread safe])
  fi
  
@@ -223,9 +223,9 @@ diff -r 23e5576aa59a configure.in
  
  AC_SUBST(CLIENT_LIBS)
  AC_SUBST(NON_THREADED_LIBS)
-diff -r 23e5576aa59a dbug/Makefile.in
---- a/dbug/Makefile.in Tue Feb 17 22:33:00 2009 -0800
-+++ b/dbug/Makefile.in Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 dbug/Makefile.in
+--- a/dbug/Makefile.in Mon Jun 01 00:35:44 2009 -0700
++++ b/dbug/Makefile.in Mon Jun 01 00:36:01 2009 -0700
 @@ -192,6 +192,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -234,9 +234,9 @@ diff -r 23e5576aa59a dbug/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a extra/Makefile.in
---- a/extra/Makefile.in        Tue Feb 17 22:33:00 2009 -0800
-+++ b/extra/Makefile.in        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 extra/Makefile.in
+--- a/extra/Makefile.in        Mon Jun 01 00:35:44 2009 -0700
++++ b/extra/Makefile.in        Mon Jun 01 00:36:01 2009 -0700
 @@ -240,6 +240,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -245,9 +245,9 @@ diff -r 23e5576aa59a extra/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a extra/yassl/Makefile.in
---- a/extra/yassl/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/extra/yassl/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 extra/yassl/Makefile.in
+--- a/extra/yassl/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/extra/yassl/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -142,6 +142,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -256,9 +256,9 @@ diff -r 23e5576aa59a extra/yassl/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a extra/yassl/src/Makefile.in
---- a/extra/yassl/src/Makefile.in      Tue Feb 17 22:33:00 2009 -0800
-+++ b/extra/yassl/src/Makefile.in      Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 extra/yassl/src/Makefile.in
+--- a/extra/yassl/src/Makefile.in      Mon Jun 01 00:35:44 2009 -0700
++++ b/extra/yassl/src/Makefile.in      Mon Jun 01 00:36:01 2009 -0700
 @@ -151,6 +151,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -267,9 +267,9 @@ diff -r 23e5576aa59a extra/yassl/src/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a extra/yassl/taocrypt/Makefile.in
---- a/extra/yassl/taocrypt/Makefile.in Tue Feb 17 22:33:00 2009 -0800
-+++ b/extra/yassl/taocrypt/Makefile.in Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 extra/yassl/taocrypt/Makefile.in
+--- a/extra/yassl/taocrypt/Makefile.in Mon Jun 01 00:35:44 2009 -0700
++++ b/extra/yassl/taocrypt/Makefile.in Mon Jun 01 00:36:01 2009 -0700
 @@ -142,6 +142,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -278,9 +278,9 @@ diff -r 23e5576aa59a extra/yassl/taocrypt/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a extra/yassl/taocrypt/benchmark/Makefile.in
---- a/extra/yassl/taocrypt/benchmark/Makefile.in       Tue Feb 17 22:33:00 2009 -0800
-+++ b/extra/yassl/taocrypt/benchmark/Makefile.in       Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 extra/yassl/taocrypt/benchmark/Makefile.in
+--- a/extra/yassl/taocrypt/benchmark/Makefile.in       Mon Jun 01 00:35:44 2009 -0700
++++ b/extra/yassl/taocrypt/benchmark/Makefile.in       Mon Jun 01 00:36:01 2009 -0700
 @@ -153,6 +153,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -289,9 +289,9 @@ diff -r 23e5576aa59a extra/yassl/taocrypt/benchmark/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a extra/yassl/taocrypt/src/Makefile.in
---- a/extra/yassl/taocrypt/src/Makefile.in     Tue Feb 17 22:33:00 2009 -0800
-+++ b/extra/yassl/taocrypt/src/Makefile.in     Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 extra/yassl/taocrypt/src/Makefile.in
+--- a/extra/yassl/taocrypt/src/Makefile.in     Mon Jun 01 00:35:44 2009 -0700
++++ b/extra/yassl/taocrypt/src/Makefile.in     Mon Jun 01 00:36:01 2009 -0700
 @@ -164,6 +164,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -300,9 +300,9 @@ diff -r 23e5576aa59a extra/yassl/taocrypt/src/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a extra/yassl/taocrypt/test/Makefile.in
---- a/extra/yassl/taocrypt/test/Makefile.in    Tue Feb 17 22:33:00 2009 -0800
-+++ b/extra/yassl/taocrypt/test/Makefile.in    Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 extra/yassl/taocrypt/test/Makefile.in
+--- a/extra/yassl/taocrypt/test/Makefile.in    Mon Jun 01 00:35:44 2009 -0700
++++ b/extra/yassl/taocrypt/test/Makefile.in    Mon Jun 01 00:36:01 2009 -0700
 @@ -153,6 +153,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -311,9 +311,9 @@ diff -r 23e5576aa59a extra/yassl/taocrypt/test/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a extra/yassl/testsuite/Makefile.in
---- a/extra/yassl/testsuite/Makefile.in        Tue Feb 17 22:33:00 2009 -0800
-+++ b/extra/yassl/testsuite/Makefile.in        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 extra/yassl/testsuite/Makefile.in
+--- a/extra/yassl/testsuite/Makefile.in        Mon Jun 01 00:35:44 2009 -0700
++++ b/extra/yassl/testsuite/Makefile.in        Mon Jun 01 00:36:01 2009 -0700
 @@ -156,6 +156,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -322,9 +322,9 @@ diff -r 23e5576aa59a extra/yassl/testsuite/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a heap/Makefile.in
---- a/heap/Makefile.in Tue Feb 17 22:33:00 2009 -0800
-+++ b/heap/Makefile.in Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 heap/Makefile.in
+--- a/heap/Makefile.in Mon Jun 01 00:35:44 2009 -0700
++++ b/heap/Makefile.in Mon Jun 01 00:36:01 2009 -0700
 @@ -202,6 +202,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -333,9 +333,9 @@ diff -r 23e5576aa59a heap/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a include/Makefile.in
---- a/include/Makefile.in      Tue Feb 17 22:33:00 2009 -0800
-+++ b/include/Makefile.in      Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 include/Makefile.in
+--- a/include/Makefile.in      Mon Jun 01 00:35:44 2009 -0700
++++ b/include/Makefile.in      Mon Jun 01 00:36:01 2009 -0700
 @@ -160,6 +160,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -344,9 +344,9 @@ diff -r 23e5576aa59a include/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a include/mysql_com.h
---- a/include/mysql_com.h      Tue Feb 17 22:33:00 2009 -0800
-+++ b/include/mysql_com.h      Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 include/mysql_com.h
+--- a/include/mysql_com.h      Mon Jun 01 00:35:44 2009 -0700
++++ b/include/mysql_com.h      Mon Jun 01 00:36:01 2009 -0700
 @@ -106,6 +106,11 @@
                                           thread */
  #define REFRESH_MASTER          128     /* Remove all bin logs in the index
@@ -359,9 +359,9 @@ diff -r 23e5576aa59a include/mysql_com.h
  
  /* The following can't be set with mysql_refresh() */
  #define REFRESH_READ_LOCK     16384   /* Lock tables for read */
-diff -r 23e5576aa59a libmysql/Makefile.in
---- a/libmysql/Makefile.in     Tue Feb 17 22:33:00 2009 -0800
-+++ b/libmysql/Makefile.in     Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 libmysql/Makefile.in
+--- a/libmysql/Makefile.in     Mon Jun 01 00:35:44 2009 -0700
++++ b/libmysql/Makefile.in     Mon Jun 01 00:36:01 2009 -0700
 @@ -224,6 +224,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -370,9 +370,9 @@ diff -r 23e5576aa59a libmysql/Makefile.in
  LIBS = @CLIENT_LIBS@ 
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a libmysql_r/Makefile.in
---- a/libmysql_r/Makefile.in   Tue Feb 17 22:33:00 2009 -0800
-+++ b/libmysql_r/Makefile.in   Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 libmysql_r/Makefile.in
+--- a/libmysql_r/Makefile.in   Mon Jun 01 00:35:44 2009 -0700
++++ b/libmysql_r/Makefile.in   Mon Jun 01 00:36:01 2009 -0700
 @@ -221,6 +221,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -381,9 +381,9 @@ diff -r 23e5576aa59a libmysql_r/Makefile.in
  LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a libmysqld/Makefile.in
---- a/libmysqld/Makefile.in    Tue Feb 17 22:33:00 2009 -0800
-+++ b/libmysqld/Makefile.in    Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 libmysqld/Makefile.in
+--- a/libmysqld/Makefile.in    Mon Jun 01 00:35:44 2009 -0700
++++ b/libmysqld/Makefile.in    Mon Jun 01 00:36:01 2009 -0700
 @@ -246,6 +246,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -392,9 +392,9 @@ diff -r 23e5576aa59a libmysqld/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a libmysqld/examples/Makefile.in
---- a/libmysqld/examples/Makefile.in   Tue Feb 17 22:33:00 2009 -0800
-+++ b/libmysqld/examples/Makefile.in   Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 libmysqld/examples/Makefile.in
+--- a/libmysqld/examples/Makefile.in   Mon Jun 01 00:35:44 2009 -0700
++++ b/libmysqld/examples/Makefile.in   Mon Jun 01 00:36:01 2009 -0700
 @@ -192,6 +192,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -403,9 +403,9 @@ diff -r 23e5576aa59a libmysqld/examples/Makefile.in
  LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs)
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a man/Makefile.in
---- a/man/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/man/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 man/Makefile.in
+--- a/man/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/man/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -151,6 +151,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -414,9 +414,9 @@ diff -r 23e5576aa59a man/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a myisam/Makefile.in
---- a/myisam/Makefile.in       Tue Feb 17 22:33:00 2009 -0800
-+++ b/myisam/Makefile.in       Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 myisam/Makefile.in
+--- a/myisam/Makefile.in       Mon Jun 01 00:35:44 2009 -0700
++++ b/myisam/Makefile.in       Mon Jun 01 00:36:01 2009 -0700
 @@ -235,6 +235,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -425,9 +425,9 @@ diff -r 23e5576aa59a myisam/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a myisammrg/Makefile.in
---- a/myisammrg/Makefile.in    Tue Feb 17 22:33:00 2009 -0800
-+++ b/myisammrg/Makefile.in    Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 myisammrg/Makefile.in
+--- a/myisammrg/Makefile.in    Mon Jun 01 00:35:44 2009 -0700
++++ b/myisammrg/Makefile.in    Mon Jun 01 00:36:01 2009 -0700
 @@ -183,6 +183,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -436,9 +436,9 @@ diff -r 23e5576aa59a myisammrg/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a mysql-test/Makefile.in
---- a/mysql-test/Makefile.in   Tue Feb 17 22:33:00 2009 -0800
-+++ b/mysql-test/Makefile.in   Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 mysql-test/Makefile.in
+--- a/mysql-test/Makefile.in   Mon Jun 01 00:35:44 2009 -0700
++++ b/mysql-test/Makefile.in   Mon Jun 01 00:36:01 2009 -0700
 @@ -161,6 +161,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -447,9 +447,9 @@ diff -r 23e5576aa59a mysql-test/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a mysql-test/ndb/Makefile.in
---- a/mysql-test/ndb/Makefile.in       Tue Feb 17 22:33:00 2009 -0800
-+++ b/mysql-test/ndb/Makefile.in       Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 mysql-test/ndb/Makefile.in
+--- a/mysql-test/ndb/Makefile.in       Mon Jun 01 00:35:44 2009 -0700
++++ b/mysql-test/ndb/Makefile.in       Mon Jun 01 00:36:01 2009 -0700
 @@ -147,6 +147,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -458,9 +458,9 @@ diff -r 23e5576aa59a mysql-test/ndb/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a mysql-test/r/information_schema.result
---- a/mysql-test/r/information_schema.result   Tue Feb 17 22:33:00 2009 -0800
-+++ b/mysql-test/r/information_schema.result   Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 mysql-test/r/information_schema.result
+--- a/mysql-test/r/information_schema.result   Mon Jun 01 00:35:44 2009 -0700
++++ b/mysql-test/r/information_schema.result   Mon Jun 01 00:36:01 2009 -0700
 @@ -37,10 +37,12 @@
  select * from v1;
  c
@@ -643,9 +643,9 @@ diff -r 23e5576aa59a mysql-test/r/information_schema.result
  VIEWS information_schema.VIEWS        1
  show global status like "Uptime_%";
  Variable_name Value
-diff -r 23e5576aa59a mysql-test/r/information_schema_db.result
---- a/mysql-test/r/information_schema_db.result        Tue Feb 17 22:33:00 2009 -0800
-+++ b/mysql-test/r/information_schema_db.result        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 mysql-test/r/information_schema_db.result
+--- a/mysql-test/r/information_schema_db.result        Mon Jun 01 00:35:44 2009 -0700
++++ b/mysql-test/r/information_schema_db.result        Mon Jun 01 00:36:01 2009 -0700
 @@ -6,10 +6,12 @@
  show tables;
  Tables_in_information_schema
@@ -677,9 +677,9 @@ diff -r 23e5576aa59a mysql-test/r/information_schema_db.result
  TRIGGERS
  create database `inf%`;
  create database mbase;
-diff -r 23e5576aa59a mysql-test/r/mysqlshow.result
---- a/mysql-test/r/mysqlshow.result    Tue Feb 17 22:33:00 2009 -0800
-+++ b/mysql-test/r/mysqlshow.result    Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 mysql-test/r/mysqlshow.result
+--- a/mysql-test/r/mysqlshow.result    Mon Jun 01 00:35:44 2009 -0700
++++ b/mysql-test/r/mysqlshow.result    Mon Jun 01 00:36:01 2009 -0700
 @@ -80,10 +80,12 @@
  |                Tables                 |
  +---------------------------------------+
@@ -728,9 +728,9 @@ diff -r 23e5576aa59a mysql-test/r/mysqlshow.result
  | VIEWS                                 |
  +---------------------------------------+
  Wildcard: inf_rmation_schema
-diff -r 23e5576aa59a mysys/Makefile.in
---- a/mysys/Makefile.in        Tue Feb 17 22:33:00 2009 -0800
-+++ b/mysys/Makefile.in        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 mysys/Makefile.in
+--- a/mysys/Makefile.in        Mon Jun 01 00:35:44 2009 -0700
++++ b/mysys/Makefile.in        Mon Jun 01 00:36:01 2009 -0700
 @@ -228,6 +228,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -739,9 +739,9 @@ diff -r 23e5576aa59a mysys/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/Makefile.in
---- a/ndb/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/Makefile.in
+--- a/ndb/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -171,6 +171,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -750,9 +750,9 @@ diff -r 23e5576aa59a ndb/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/docs/Makefile.in
---- a/ndb/docs/Makefile.in     Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/docs/Makefile.in     Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/docs/Makefile.in
+--- a/ndb/docs/Makefile.in     Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/docs/Makefile.in     Mon Jun 01 00:36:01 2009 -0700
 @@ -149,6 +149,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -761,9 +761,9 @@ diff -r 23e5576aa59a ndb/docs/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/include/Makefile.in
---- a/ndb/include/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/include/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/include/Makefile.in
+--- a/ndb/include/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/include/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -179,6 +179,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -772,9 +772,9 @@ diff -r 23e5576aa59a ndb/include/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/Makefile.in
---- a/ndb/src/Makefile.in      Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/Makefile.in      Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/Makefile.in
+--- a/ndb/src/Makefile.in      Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/Makefile.in      Mon Jun 01 00:36:01 2009 -0700
 @@ -204,6 +204,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -783,9 +783,9 @@ diff -r 23e5576aa59a ndb/src/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/common/Makefile.in
---- a/ndb/src/common/Makefile.in       Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/common/Makefile.in       Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/common/Makefile.in
+--- a/ndb/src/common/Makefile.in       Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/common/Makefile.in       Mon Jun 01 00:36:01 2009 -0700
 @@ -174,6 +174,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -794,9 +794,9 @@ diff -r 23e5576aa59a ndb/src/common/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/common/debugger/Makefile.in
---- a/ndb/src/common/debugger/Makefile.in      Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/common/debugger/Makefile.in      Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/common/debugger/Makefile.in
+--- a/ndb/src/common/debugger/Makefile.in      Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/common/debugger/Makefile.in      Mon Jun 01 00:36:01 2009 -0700
 @@ -206,6 +206,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -805,9 +805,9 @@ diff -r 23e5576aa59a ndb/src/common/debugger/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/common/debugger/signaldata/Makefile.in
---- a/ndb/src/common/debugger/signaldata/Makefile.in   Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/common/debugger/signaldata/Makefile.in   Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/common/debugger/signaldata/Makefile.in
+--- a/ndb/src/common/debugger/signaldata/Makefile.in   Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/common/debugger/signaldata/Makefile.in   Mon Jun 01 00:36:01 2009 -0700
 @@ -211,6 +211,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -816,9 +816,9 @@ diff -r 23e5576aa59a ndb/src/common/debugger/signaldata/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/common/logger/Makefile.in
---- a/ndb/src/common/logger/Makefile.in        Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/common/logger/Makefile.in        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/common/logger/Makefile.in
+--- a/ndb/src/common/logger/Makefile.in        Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/common/logger/Makefile.in        Mon Jun 01 00:36:01 2009 -0700
 @@ -197,6 +197,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -827,9 +827,9 @@ diff -r 23e5576aa59a ndb/src/common/logger/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/common/mgmcommon/Makefile.in
---- a/ndb/src/common/mgmcommon/Makefile.in     Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/common/mgmcommon/Makefile.in     Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/common/mgmcommon/Makefile.in
+--- a/ndb/src/common/mgmcommon/Makefile.in     Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/common/mgmcommon/Makefile.in     Mon Jun 01 00:36:01 2009 -0700
 @@ -211,6 +211,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -838,9 +838,9 @@ diff -r 23e5576aa59a ndb/src/common/mgmcommon/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/common/portlib/Makefile.in
---- a/ndb/src/common/portlib/Makefile.in       Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/common/portlib/Makefile.in       Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/common/portlib/Makefile.in
+--- a/ndb/src/common/portlib/Makefile.in       Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/common/portlib/Makefile.in       Mon Jun 01 00:36:01 2009 -0700
 @@ -222,6 +222,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -849,9 +849,9 @@ diff -r 23e5576aa59a ndb/src/common/portlib/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/common/transporter/Makefile.in
---- a/ndb/src/common/transporter/Makefile.in   Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/common/transporter/Makefile.in   Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/common/transporter/Makefile.in
+--- a/ndb/src/common/transporter/Makefile.in   Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/common/transporter/Makefile.in   Mon Jun 01 00:36:01 2009 -0700
 @@ -197,6 +197,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -860,9 +860,9 @@ diff -r 23e5576aa59a ndb/src/common/transporter/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/common/util/Makefile.in
---- a/ndb/src/common/util/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/common/util/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/common/util/Makefile.in
+--- a/ndb/src/common/util/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/common/util/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -217,6 +217,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -871,9 +871,9 @@ diff -r 23e5576aa59a ndb/src/common/util/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/cw/Makefile.in
---- a/ndb/src/cw/Makefile.in   Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/cw/Makefile.in   Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/cw/Makefile.in
+--- a/ndb/src/cw/Makefile.in   Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/cw/Makefile.in   Mon Jun 01 00:36:01 2009 -0700
 @@ -156,6 +156,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -882,9 +882,9 @@ diff -r 23e5576aa59a ndb/src/cw/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/cw/cpcd/Makefile.in
---- a/ndb/src/cw/cpcd/Makefile.in      Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/cw/cpcd/Makefile.in      Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/cw/cpcd/Makefile.in
+--- a/ndb/src/cw/cpcd/Makefile.in      Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/cw/cpcd/Makefile.in      Mon Jun 01 00:36:01 2009 -0700
 @@ -207,6 +207,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -893,9 +893,9 @@ diff -r 23e5576aa59a ndb/src/cw/cpcd/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/Makefile.in
---- a/ndb/src/kernel/Makefile.in       Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/Makefile.in       Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/Makefile.in
+--- a/ndb/src/kernel/Makefile.in       Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/Makefile.in       Mon Jun 01 00:36:01 2009 -0700
 @@ -227,6 +227,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -904,9 +904,9 @@ diff -r 23e5576aa59a ndb/src/kernel/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/Makefile.in
---- a/ndb/src/kernel/blocks/Makefile.in        Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/Makefile.in        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/Makefile.in
+--- a/ndb/src/kernel/blocks/Makefile.in        Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/Makefile.in        Mon Jun 01 00:36:01 2009 -0700
 @@ -156,6 +156,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -915,9 +915,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/backup/Makefile.in
---- a/ndb/src/kernel/blocks/backup/Makefile.in Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/backup/Makefile.in Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/backup/Makefile.in
+--- a/ndb/src/kernel/blocks/backup/Makefile.in Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/backup/Makefile.in Mon Jun 01 00:36:01 2009 -0700
 @@ -196,6 +196,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -926,9 +926,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/backup/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/cmvmi/Makefile.in
---- a/ndb/src/kernel/blocks/cmvmi/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/cmvmi/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/cmvmi/Makefile.in
+--- a/ndb/src/kernel/blocks/cmvmi/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/cmvmi/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -196,6 +196,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -937,9 +937,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/cmvmi/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/dbacc/Makefile.in
---- a/ndb/src/kernel/blocks/dbacc/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/dbacc/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbacc/Makefile.in
+--- a/ndb/src/kernel/blocks/dbacc/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/dbacc/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -196,6 +196,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -948,9 +948,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/dbacc/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/dbdict/Makefile.in
---- a/ndb/src/kernel/blocks/dbdict/Makefile.in Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/dbdict/Makefile.in Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbdict/Makefile.in
+--- a/ndb/src/kernel/blocks/dbdict/Makefile.in Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/dbdict/Makefile.in Mon Jun 01 00:36:01 2009 -0700
 @@ -206,6 +206,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -959,9 +959,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/dbdict/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/dbdih/Makefile.in
---- a/ndb/src/kernel/blocks/dbdih/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/dbdih/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbdih/Makefile.in
+--- a/ndb/src/kernel/blocks/dbdih/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/dbdih/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -203,6 +203,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -970,9 +970,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/dbdih/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/dblqh/Makefile.in
---- a/ndb/src/kernel/blocks/dblqh/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/dblqh/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/dblqh/Makefile.in
+--- a/ndb/src/kernel/blocks/dblqh/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/dblqh/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -204,6 +204,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -981,9 +981,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/dblqh/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/dbtc/Makefile.in
---- a/ndb/src/kernel/blocks/dbtc/Makefile.in   Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/dbtc/Makefile.in   Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbtc/Makefile.in
+--- a/ndb/src/kernel/blocks/dbtc/Makefile.in   Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/dbtc/Makefile.in   Mon Jun 01 00:36:01 2009 -0700
 @@ -196,6 +196,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -992,9 +992,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/dbtc/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/dbtup/Makefile.in
---- a/ndb/src/kernel/blocks/dbtup/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/dbtup/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbtup/Makefile.in
+--- a/ndb/src/kernel/blocks/dbtup/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/dbtup/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -204,6 +204,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1003,9 +1003,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/dbtup/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/dbtux/Makefile.in
---- a/ndb/src/kernel/blocks/dbtux/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/dbtux/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbtux/Makefile.in
+--- a/ndb/src/kernel/blocks/dbtux/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/dbtux/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -199,6 +199,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1014,9 +1014,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/dbtux/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/dbutil/Makefile.in
---- a/ndb/src/kernel/blocks/dbutil/Makefile.in Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/dbutil/Makefile.in Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/dbutil/Makefile.in
+--- a/ndb/src/kernel/blocks/dbutil/Makefile.in Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/dbutil/Makefile.in Mon Jun 01 00:36:01 2009 -0700
 @@ -196,6 +196,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1025,9 +1025,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/dbutil/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/ndbcntr/Makefile.in
---- a/ndb/src/kernel/blocks/ndbcntr/Makefile.in        Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/ndbcntr/Makefile.in        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/ndbcntr/Makefile.in
+--- a/ndb/src/kernel/blocks/ndbcntr/Makefile.in        Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/ndbcntr/Makefile.in        Mon Jun 01 00:36:01 2009 -0700
 @@ -197,6 +197,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1036,9 +1036,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/ndbcntr/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/ndbfs/Makefile.in
---- a/ndb/src/kernel/blocks/ndbfs/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/ndbfs/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/ndbfs/Makefile.in
+--- a/ndb/src/kernel/blocks/ndbfs/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/ndbfs/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -197,6 +197,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1047,9 +1047,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/ndbfs/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/qmgr/Makefile.in
---- a/ndb/src/kernel/blocks/qmgr/Makefile.in   Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/qmgr/Makefile.in   Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/qmgr/Makefile.in
+--- a/ndb/src/kernel/blocks/qmgr/Makefile.in   Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/qmgr/Makefile.in   Mon Jun 01 00:36:01 2009 -0700
 @@ -196,6 +196,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1058,9 +1058,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/qmgr/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/suma/Makefile.in
---- a/ndb/src/kernel/blocks/suma/Makefile.in   Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/suma/Makefile.in   Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/suma/Makefile.in
+--- a/ndb/src/kernel/blocks/suma/Makefile.in   Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/suma/Makefile.in   Mon Jun 01 00:36:01 2009 -0700
 @@ -196,6 +196,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1069,9 +1069,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/suma/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/blocks/trix/Makefile.in
---- a/ndb/src/kernel/blocks/trix/Makefile.in   Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/blocks/trix/Makefile.in   Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/blocks/trix/Makefile.in
+--- a/ndb/src/kernel/blocks/trix/Makefile.in   Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/blocks/trix/Makefile.in   Mon Jun 01 00:36:01 2009 -0700
 @@ -196,6 +196,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1080,9 +1080,9 @@ diff -r 23e5576aa59a ndb/src/kernel/blocks/trix/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/error/Makefile.in
---- a/ndb/src/kernel/error/Makefile.in Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/error/Makefile.in Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/error/Makefile.in
+--- a/ndb/src/kernel/error/Makefile.in Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/error/Makefile.in Mon Jun 01 00:36:01 2009 -0700
 @@ -206,6 +206,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1091,9 +1091,9 @@ diff -r 23e5576aa59a ndb/src/kernel/error/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/kernel/vm/Makefile.in
---- a/ndb/src/kernel/vm/Makefile.in    Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/kernel/vm/Makefile.in    Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/kernel/vm/Makefile.in
+--- a/ndb/src/kernel/vm/Makefile.in    Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/kernel/vm/Makefile.in    Mon Jun 01 00:36:01 2009 -0700
 @@ -207,6 +207,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1102,9 +1102,9 @@ diff -r 23e5576aa59a ndb/src/kernel/vm/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/mgmapi/Makefile.in
---- a/ndb/src/mgmapi/Makefile.in       Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/mgmapi/Makefile.in       Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/mgmapi/Makefile.in
+--- a/ndb/src/mgmapi/Makefile.in       Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/mgmapi/Makefile.in       Mon Jun 01 00:36:01 2009 -0700
 @@ -205,6 +205,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1113,9 +1113,9 @@ diff -r 23e5576aa59a ndb/src/mgmapi/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/mgmclient/Makefile.in
---- a/ndb/src/mgmclient/Makefile.in    Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/mgmclient/Makefile.in    Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/mgmclient/Makefile.in
+--- a/ndb/src/mgmclient/Makefile.in    Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/mgmclient/Makefile.in    Mon Jun 01 00:36:01 2009 -0700
 @@ -216,6 +216,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1124,9 +1124,9 @@ diff -r 23e5576aa59a ndb/src/mgmclient/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/mgmsrv/Makefile.in
---- a/ndb/src/mgmsrv/Makefile.in       Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/mgmsrv/Makefile.in       Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/mgmsrv/Makefile.in
+--- a/ndb/src/mgmsrv/Makefile.in       Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/mgmsrv/Makefile.in       Mon Jun 01 00:36:01 2009 -0700
 @@ -213,6 +213,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1135,9 +1135,9 @@ diff -r 23e5576aa59a ndb/src/mgmsrv/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/src/ndbapi/Makefile.in
---- a/ndb/src/ndbapi/Makefile.in       Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/src/ndbapi/Makefile.in       Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/src/ndbapi/Makefile.in
+--- a/ndb/src/ndbapi/Makefile.in       Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/src/ndbapi/Makefile.in       Mon Jun 01 00:36:01 2009 -0700
 @@ -215,6 +215,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1146,9 +1146,9 @@ diff -r 23e5576aa59a ndb/src/ndbapi/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/test/Makefile.in
---- a/ndb/test/Makefile.in     Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/test/Makefile.in     Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/test/Makefile.in
+--- a/ndb/test/Makefile.in     Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/test/Makefile.in     Mon Jun 01 00:36:01 2009 -0700
 @@ -156,6 +156,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1157,9 +1157,9 @@ diff -r 23e5576aa59a ndb/test/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/test/ndbapi/Makefile.in
---- a/ndb/test/ndbapi/Makefile.in      Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/test/ndbapi/Makefile.in      Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/test/ndbapi/Makefile.in
+--- a/ndb/test/ndbapi/Makefile.in      Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/test/ndbapi/Makefile.in      Mon Jun 01 00:36:01 2009 -0700
 @@ -595,6 +595,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1168,9 +1168,9 @@ diff -r 23e5576aa59a ndb/test/ndbapi/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/test/ndbapi/bank/Makefile.in
---- a/ndb/test/ndbapi/bank/Makefile.in Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/test/ndbapi/bank/Makefile.in Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/test/ndbapi/bank/Makefile.in
+--- a/ndb/test/ndbapi/bank/Makefile.in Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/test/ndbapi/bank/Makefile.in Mon Jun 01 00:36:01 2009 -0700
 @@ -282,6 +282,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1179,9 +1179,9 @@ diff -r 23e5576aa59a ndb/test/ndbapi/bank/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/test/run-test/Makefile.in
---- a/ndb/test/run-test/Makefile.in    Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/test/run-test/Makefile.in    Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/test/run-test/Makefile.in
+--- a/ndb/test/run-test/Makefile.in    Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/test/run-test/Makefile.in    Mon Jun 01 00:36:01 2009 -0700
 @@ -243,6 +243,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1190,9 +1190,9 @@ diff -r 23e5576aa59a ndb/test/run-test/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/test/src/Makefile.in
---- a/ndb/test/src/Makefile.in Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/test/src/Makefile.in Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/test/src/Makefile.in
+--- a/ndb/test/src/Makefile.in Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/test/src/Makefile.in Mon Jun 01 00:36:01 2009 -0700
 @@ -213,6 +213,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1201,9 +1201,9 @@ diff -r 23e5576aa59a ndb/test/src/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/test/tools/Makefile.in
---- a/ndb/test/tools/Makefile.in       Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/test/tools/Makefile.in       Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/test/tools/Makefile.in
+--- a/ndb/test/tools/Makefile.in       Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/test/tools/Makefile.in       Mon Jun 01 00:36:01 2009 -0700
 @@ -325,6 +325,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1212,9 +1212,9 @@ diff -r 23e5576aa59a ndb/test/tools/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a ndb/tools/Makefile.in
---- a/ndb/tools/Makefile.in    Tue Feb 17 22:33:00 2009 -0800
-+++ b/ndb/tools/Makefile.in    Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 ndb/tools/Makefile.in
+--- a/ndb/tools/Makefile.in    Mon Jun 01 00:35:44 2009 -0700
++++ b/ndb/tools/Makefile.in    Mon Jun 01 00:36:01 2009 -0700
 @@ -344,6 +344,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1223,9 +1223,9 @@ diff -r 23e5576aa59a ndb/tools/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a netware/Makefile.in
---- a/netware/Makefile.in      Tue Feb 17 22:33:00 2009 -0800
-+++ b/netware/Makefile.in      Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 netware/Makefile.in
+--- a/netware/Makefile.in      Mon Jun 01 00:35:44 2009 -0700
++++ b/netware/Makefile.in      Mon Jun 01 00:36:01 2009 -0700
 @@ -199,6 +199,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1234,9 +1234,9 @@ diff -r 23e5576aa59a netware/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a os2/Makefile.in
---- a/os2/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/os2/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 os2/Makefile.in
+--- a/os2/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/os2/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -156,6 +156,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1245,9 +1245,9 @@ diff -r 23e5576aa59a os2/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a os2/include/Makefile.in
---- a/os2/include/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/os2/include/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 os2/include/Makefile.in
+--- a/os2/include/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/os2/include/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -156,6 +156,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1256,9 +1256,9 @@ diff -r 23e5576aa59a os2/include/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a os2/include/sys/Makefile.in
---- a/os2/include/sys/Makefile.in      Tue Feb 17 22:33:00 2009 -0800
-+++ b/os2/include/sys/Makefile.in      Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 os2/include/sys/Makefile.in
+--- a/os2/include/sys/Makefile.in      Mon Jun 01 00:35:44 2009 -0700
++++ b/os2/include/sys/Makefile.in      Mon Jun 01 00:36:01 2009 -0700
 @@ -144,6 +144,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1267,9 +1267,9 @@ diff -r 23e5576aa59a os2/include/sys/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a patch_info/userstats.info
+diff -r 1ac0113deff5 patch_info/userstats.info
 --- /dev/null  Thu Jan 01 00:00:00 1970 +0000
-+++ b/patch_info/userstats.info        Tue Feb 17 22:33:23 2009 -0800
++++ b/patch_info/userstats.info        Mon Jun 01 00:36:01 2009 -0700
 @@ -0,0 +1,14 @@
 +File=userstatsv2.patch
 +Name=SHOW USER/TABLE/INDEX statistics
@@ -1285,9 +1285,9 @@ diff -r 23e5576aa59a patch_info/userstats.info
 +
 +2008-12-09
 +YK: fixed "Row_sent: 0" problem at microslow_innodb.patch
-diff -r 23e5576aa59a pstack/Makefile.in
---- a/pstack/Makefile.in       Tue Feb 17 22:33:00 2009 -0800
-+++ b/pstack/Makefile.in       Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 pstack/Makefile.in
+--- a/pstack/Makefile.in       Mon Jun 01 00:35:44 2009 -0700
++++ b/pstack/Makefile.in       Mon Jun 01 00:36:01 2009 -0700
 @@ -196,6 +196,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1296,9 +1296,9 @@ diff -r 23e5576aa59a pstack/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a pstack/aout/Makefile.in
---- a/pstack/aout/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/pstack/aout/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 pstack/aout/Makefile.in
+--- a/pstack/aout/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/pstack/aout/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -134,6 +134,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1307,9 +1307,9 @@ diff -r 23e5576aa59a pstack/aout/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a regex/Makefile.in
---- a/regex/Makefile.in        Tue Feb 17 22:33:00 2009 -0800
-+++ b/regex/Makefile.in        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 regex/Makefile.in
+--- a/regex/Makefile.in        Mon Jun 01 00:35:44 2009 -0700
++++ b/regex/Makefile.in        Mon Jun 01 00:36:01 2009 -0700
 @@ -180,6 +180,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1318,9 +1318,9 @@ diff -r 23e5576aa59a regex/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a scripts/Makefile.in
---- a/scripts/Makefile.in      Tue Feb 17 22:33:00 2009 -0800
-+++ b/scripts/Makefile.in      Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 scripts/Makefile.in
+--- a/scripts/Makefile.in      Mon Jun 01 00:35:44 2009 -0700
++++ b/scripts/Makefile.in      Mon Jun 01 00:36:01 2009 -0700
 @@ -176,6 +176,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1329,9 +1329,9 @@ diff -r 23e5576aa59a scripts/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a server-tools/Makefile.in
---- a/server-tools/Makefile.in Tue Feb 17 22:33:00 2009 -0800
-+++ b/server-tools/Makefile.in Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 server-tools/Makefile.in
+--- a/server-tools/Makefile.in Mon Jun 01 00:35:44 2009 -0700
++++ b/server-tools/Makefile.in Mon Jun 01 00:36:01 2009 -0700
 @@ -155,6 +155,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1340,9 +1340,9 @@ diff -r 23e5576aa59a server-tools/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a server-tools/instance-manager/Makefile.in
---- a/server-tools/instance-manager/Makefile.in        Tue Feb 17 22:33:00 2009 -0800
-+++ b/server-tools/instance-manager/Makefile.in        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 server-tools/instance-manager/Makefile.in
+--- a/server-tools/instance-manager/Makefile.in        Mon Jun 01 00:35:44 2009 -0700
++++ b/server-tools/instance-manager/Makefile.in        Mon Jun 01 00:36:01 2009 -0700
 @@ -205,6 +205,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1351,9 +1351,9 @@ diff -r 23e5576aa59a server-tools/instance-manager/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a sql/Makefile.in
---- a/sql/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 sql/Makefile.in
+--- a/sql/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -274,6 +274,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -1362,10 +1362,10 @@ diff -r 23e5576aa59a sql/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a sql/ha_innodb.cc
---- a/sql/ha_innodb.cc Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/ha_innodb.cc Tue Feb 17 22:33:23 2009 -0800
-@@ -3324,6 +3324,8 @@
+diff -r 1ac0113deff5 sql/ha_innodb.cc
+--- a/sql/ha_innodb.cc Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/ha_innodb.cc Mon Jun 01 00:36:01 2009 -0700
+@@ -3338,6 +3338,8 @@
  
        error = row_insert_for_mysql((byte*) record, prebuilt);
  
@@ -1374,7 +1374,7 @@ diff -r 23e5576aa59a sql/ha_innodb.cc
        if (error == DB_SUCCESS && auto_inc_used) {
  
                /* Fetch the value that was set in the autoincrement field */
-@@ -3596,6 +3598,8 @@
+@@ -3610,6 +3612,8 @@
                }
        }
  
@@ -1383,16 +1383,16 @@ diff -r 23e5576aa59a sql/ha_innodb.cc
        innodb_srv_conc_exit_innodb(prebuilt->trx);
  
        error = convert_error_code_to_mysql(error, user_thd);
-@@ -3643,6 +3647,8 @@
-       innodb_srv_conc_enter_innodb(prebuilt->trx);
+@@ -3658,6 +3662,8 @@
  
        error = row_update_for_mysql((byte*) record, prebuilt);
-+
-+      if (error == DB_SUCCESS) rows_changed++;
  
++      if (error == DB_SUCCESS) rows_changed++;
++
        innodb_srv_conc_exit_innodb(prebuilt->trx);
  
-@@ -4076,6 +4082,9 @@
+       error = convert_error_code_to_mysql(error, user_thd);
+@@ -4089,6 +4095,9 @@
        if (ret == DB_SUCCESS) {
                error = 0;
                table->status = 0;
@@ -1402,9 +1402,9 @@ diff -r 23e5576aa59a sql/ha_innodb.cc
  
        } else if (ret == DB_RECORD_NOT_FOUND) {
                error = HA_ERR_END_OF_FILE;
-diff -r 23e5576aa59a sql/ha_myisam.cc
---- a/sql/ha_myisam.cc Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/ha_myisam.cc Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 sql/ha_myisam.cc
+--- a/sql/ha_myisam.cc Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/ha_myisam.cc Mon Jun 01 00:36:01 2009 -0700
 @@ -670,7 +670,9 @@
      if ((error= update_auto_increment()))
        return error;
@@ -1564,10 +1564,10 @@ diff -r 23e5576aa59a sql/ha_myisam.cc
    return error;
  }
  
-diff -r 23e5576aa59a sql/handler.cc
---- a/sql/handler.cc   Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/handler.cc   Tue Feb 17 22:33:23 2009 -0800
-@@ -725,6 +725,8 @@
+diff -r 1ac0113deff5 sql/handler.cc
+--- a/sql/handler.cc   Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/handler.cc   Mon Jun 01 00:36:01 2009 -0700
+@@ -726,6 +726,8 @@
      if (cookie)
        tc_log->unlog(cookie, xid);
      DBUG_EXECUTE_IF("crash_commit_after", abort(););
@@ -1576,15 +1576,15 @@ diff -r 23e5576aa59a sql/handler.cc
  end:
      if (is_real_trans)
        start_waiting_global_read_lock(thd);
-@@ -829,6 +831,7 @@
+@@ -783,6 +785,7 @@
        thd->transaction.cleanup();
      }
    }
 +  thd->diff_rollback_trans++;
  #endif /* USING_TRANSACTIONS */
-   if (all)
-     thd->transaction_rollback_request= FALSE;
-@@ -1212,6 +1215,7 @@
+   DBUG_RETURN(error);
+ }
+@@ -1223,6 +1226,7 @@
      statistic_increment(thd->status_var.ha_rollback_count,&LOCK_status);
      *ht=0; // keep it conveniently zero-filled
    }
@@ -1592,7 +1592,7 @@ diff -r 23e5576aa59a sql/handler.cc
    DBUG_RETURN(error);
  }
  
-@@ -1442,6 +1446,8 @@
+@@ -1453,6 +1457,8 @@
      else
        dupp_ref=ref+ALIGN_SIZE(ref_length);
    }
@@ -1601,7 +1601,7 @@ diff -r 23e5576aa59a sql/handler.cc
    DBUG_RETURN(error);
  }
  
-@@ -2276,6 +2282,111 @@
+@@ -2287,6 +2293,111 @@
    return error;
  }
  
@@ -1713,20 +1713,20 @@ diff -r 23e5576aa59a sql/handler.cc
  
  /****************************************************************************
  ** Some general functions that isn't in the handler class
-diff -r 23e5576aa59a sql/handler.h
---- a/sql/handler.h    Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/handler.h    Tue Feb 17 22:33:23 2009 -0800
-@@ -30,6 +30,10 @@
- #if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || \
-     defined(HAVE_NDBCLUSTER_DB)
+diff -r 1ac0113deff5 sql/handler.h
+--- a/sql/handler.h    Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/handler.h    Mon Jun 01 00:36:01 2009 -0700
+@@ -32,6 +32,10 @@
  #define USING_TRANSACTIONS
-+#endif
-+
-+#if MAX_KEY > 128
-+#error MAX_KEY is too large.  Values up to 128 are supported.
  #endif
  
++#if MAX_KEY > 128
++#error MAX_KEY is too large.  Values up to 128 are supported.
++#endif
++
  // the following is for checking tables
+ #define HA_ADMIN_ALREADY_DONE   1
 @@ -604,6 +608,9 @@
    bool  auto_increment_column_changed;
    bool implicit_emptied;                /* Can be !=0 only if HEAP */
@@ -1773,9 +1773,9 @@ diff -r 23e5576aa59a sql/handler.h
    /*
      default rename_table() and delete_table() rename/delete files with a
      given name and extensions from bas_ext()
-diff -r 23e5576aa59a sql/lex.h
---- a/sql/lex.h        Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/lex.h        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 sql/lex.h
+--- a/sql/lex.h        Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/lex.h        Mon Jun 01 00:36:01 2009 -0700
 @@ -109,6 +109,7 @@
    { "CHECKSUM",               SYM(CHECKSUM_SYM)},
    { "CIPHER",         SYM(CIPHER_SYM)},
@@ -1816,10 +1816,10 @@ diff -r 23e5576aa59a sql/lex.h
    { "USE_FRM",                SYM(USE_FRM)},
    { "USING",          SYM(USING)},
    { "UTC_DATE",         SYM(UTC_DATE_SYM)},
-diff -r 23e5576aa59a sql/log.cc
---- a/sql/log.cc       Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/log.cc       Tue Feb 17 22:33:23 2009 -0800
-@@ -1954,18 +1954,24 @@
+diff -r 1ac0113deff5 sql/log.cc
+--- a/sql/log.cc       Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/log.cc       Mon Jun 01 00:36:01 2009 -0700
+@@ -1958,18 +1958,24 @@
                           thd->current_insert_id);
        if (e.write(file))
          goto err;
@@ -1844,7 +1844,7 @@ diff -r 23e5576aa59a sql/log.cc
        }
        if (thd->user_var_events.elements)
        {
-@@ -1981,6 +1987,8 @@
+@@ -1985,6 +1991,8 @@
                               user_var_event->charset_number);
          if (e.write(file))
            goto err;
@@ -1853,7 +1853,7 @@ diff -r 23e5576aa59a sql/log.cc
        }
        }
      }
-@@ -1991,6 +1999,8 @@
+@@ -1995,6 +2003,8 @@
  
      if (event_info->write(file))
        goto err;
@@ -1862,7 +1862,7 @@ diff -r 23e5576aa59a sql/log.cc
  
      if (file == &log_file) // we are writing to the real log (disk)
      {
-@@ -2112,6 +2122,7 @@
+@@ -2117,6 +2127,7 @@
      */
      if (qinfo.write(&log_file))
        goto err;
@@ -1870,7 +1870,7 @@ diff -r 23e5576aa59a sql/log.cc
  
      /* Read from the file used to cache the queries .*/
      if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0))
-@@ -2158,6 +2169,7 @@
+@@ -2163,6 +2174,7 @@
          /* write the first half of the split header */
          if (my_b_write(&log_file, header, carry))
            goto err;
@@ -1878,7 +1878,7 @@ diff -r 23e5576aa59a sql/log.cc
  
          /*
            copy fixed second half of header to cache so the correct
-@@ -2226,6 +2238,8 @@
+@@ -2231,6 +2243,8 @@
        /* Write data to the binary log file */
        if (my_b_write(&log_file, cache->read_pos, length))
          goto err;
@@ -1887,7 +1887,7 @@ diff -r 23e5576aa59a sql/log.cc
        cache->read_pos=cache->read_end;                // Mark buffer used up
        DBUG_EXECUTE_IF("half_binlogged_transaction", goto DBUG_skip_commit;);
      } while ((length=my_b_fill(cache)));
-@@ -2234,6 +2248,8 @@
+@@ -2239,6 +2253,8 @@
  
      if (commit_event->write(&log_file))
        goto err;
@@ -1896,10 +1896,10 @@ diff -r 23e5576aa59a sql/log.cc
  #ifndef DBUG_OFF
  DBUG_skip_commit:
  #endif
-diff -r 23e5576aa59a sql/mysql_priv.h
---- a/sql/mysql_priv.h Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/mysql_priv.h Tue Feb 17 22:33:23 2009 -0800
-@@ -823,7 +823,15 @@
+diff -r 1ac0113deff5 sql/mysql_priv.h
+--- a/sql/mysql_priv.h Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/mysql_priv.h Mon Jun 01 00:36:01 2009 -0700
+@@ -837,7 +837,15 @@
  bool multi_delete_set_locks_and_link_aux_tables(LEX *lex);
  void init_max_user_conn(void);
  void init_update_queries(void);
@@ -1915,7 +1915,7 @@ diff -r 23e5576aa59a sql/mysql_priv.h
  pthread_handler_t handle_one_connection(void *arg);
  pthread_handler_t handle_bootstrap(void *arg);
  void end_thread(THD *thd,bool put_in_cache);
-@@ -1402,6 +1410,7 @@
+@@ -1416,6 +1424,7 @@
  extern ulong max_connections,max_connect_errors, connect_timeout;
  extern ulong slave_net_timeout, slave_trans_retries;
  extern uint max_user_connections;
@@ -1923,7 +1923,7 @@ diff -r 23e5576aa59a sql/mysql_priv.h
  extern ulong what_to_log,flush_time;
  extern ulong query_buff_size, thread_stack;
  extern ulong max_prepared_stmt_count, prepared_stmt_count;
-@@ -1432,6 +1441,7 @@
+@@ -1446,6 +1455,7 @@
  extern my_bool opt_safe_show_db, opt_local_infile;
  extern my_bool opt_slave_compressed_protocol, use_temp_pool;
  extern my_bool opt_readonly, lower_case_file_system;
@@ -1931,7 +1931,7 @@ diff -r 23e5576aa59a sql/mysql_priv.h
  extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
  extern my_bool opt_secure_auth;
  extern char* opt_secure_file_priv;
-@@ -1479,6 +1489,14 @@
+@@ -1493,6 +1503,14 @@
  extern struct system_variables max_system_variables;
  extern struct system_status_var global_status_var;
  extern struct rand_struct sql_rand;
@@ -1946,10 +1946,10 @@ diff -r 23e5576aa59a sql/mysql_priv.h
  
  extern const char *opt_date_time_formats[];
  extern KNOWN_DATE_TIME_FORMAT known_date_time_formats[];
-diff -r 23e5576aa59a sql/mysqld.cc
---- a/sql/mysqld.cc    Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/mysqld.cc    Tue Feb 17 22:33:23 2009 -0800
-@@ -415,6 +415,7 @@
+diff -r 1ac0113deff5 sql/mysqld.cc
+--- a/sql/mysqld.cc    Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/mysqld.cc    Mon Jun 01 00:36:01 2009 -0700
+@@ -417,6 +417,7 @@
  uint    opt_large_page_size= 0;
  my_bool opt_old_style_user_limits= 0, trust_function_creators= 0;
  char* opt_slow_logname= 0;
@@ -1957,7 +1957,7 @@ diff -r 23e5576aa59a sql/mysqld.cc
  /*
    True if there is at least one per-hour limit for some user, so we should
    check them before each query (and possibly reset counters when hour is
-@@ -451,6 +452,7 @@
+@@ -453,6 +454,7 @@
  ulong binlog_cache_use= 0, binlog_cache_disk_use= 0;
  ulong max_connections, max_connect_errors;
  uint  max_user_connections= 0;
@@ -1965,7 +1965,7 @@ diff -r 23e5576aa59a sql/mysqld.cc
  /*
    Limit of the total number of prepared statements in the server.
    Is necessary to protect the server against out-of-memory attacks.
-@@ -551,6 +553,10 @@
+@@ -555,6 +557,10 @@
                LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
                LOCK_global_system_variables,
                LOCK_user_conn, LOCK_slave_list, LOCK_active_mi;
@@ -1976,7 +1976,7 @@ diff -r 23e5576aa59a sql/mysqld.cc
  /*
    The below lock protects access to two global server variables:
    max_prepared_stmt_count and prepared_stmt_count. These variables
-@@ -1192,6 +1198,10 @@
+@@ -1196,6 +1202,10 @@
    x_free(opt_secure_file_priv);
    bitmap_free(&temp_pool);
    free_max_user_conn();
@@ -1987,7 +1987,7 @@ diff -r 23e5576aa59a sql/mysqld.cc
  #ifdef HAVE_REPLICATION
    end_slave_list();
    free_list(&replicate_do_db);
-@@ -1306,6 +1316,10 @@
+@@ -1310,6 +1320,10 @@
    (void) pthread_cond_destroy(&COND_thread_cache);
    (void) pthread_cond_destroy(&COND_flush_thread_cache);
    (void) pthread_cond_destroy(&COND_manager);
@@ -1998,7 +1998,7 @@ diff -r 23e5576aa59a sql/mysqld.cc
  }
  
  #endif /*EMBEDDED_LIBRARY*/
-@@ -3153,6 +3167,10 @@
+@@ -3157,6 +3171,10 @@
    (void) pthread_mutex_init(&LOCK_rpl_status, MY_MUTEX_INIT_FAST);
    (void) pthread_cond_init(&COND_rpl_status, NULL);
  #endif
@@ -2009,7 +2009,7 @@ diff -r 23e5576aa59a sql/mysqld.cc
    sp_cache_init();
    /* Parameter for threads created for connections */
    (void) pthread_attr_init(&connection_attrib);
-@@ -3424,6 +3442,10 @@
+@@ -3428,6 +3446,10 @@
      sql_print_error("Out of memory");
      unireg_abort(1);
    }
@@ -2020,7 +2020,7 @@ diff -r 23e5576aa59a sql/mysqld.cc
    if (ha_init())
    {
      sql_print_error("Can't init databases");
-@@ -3506,6 +3528,8 @@
+@@ -3510,6 +3532,8 @@
  
    init_max_user_conn();
    init_update_queries();
@@ -2029,7 +2029,7 @@ diff -r 23e5576aa59a sql/mysqld.cc
    DBUG_RETURN(0);
  }
  
-@@ -4232,6 +4256,7 @@
+@@ -4236,6 +4260,7 @@
    {
      DBUG_PRINT("error",("Too many connections"));
      close_connection(thd, ER_CON_COUNT_ERROR, 1);
@@ -2037,15 +2037,15 @@ diff -r 23e5576aa59a sql/mysqld.cc
      delete thd;
      DBUG_VOID_RETURN;
    }
-@@ -5050,6 +5075,7 @@
-   OPT_PROFILING,
+@@ -5056,6 +5081,7 @@
+   OPT_PROFILING_USE_GETRUSAGE,
    OPT_SLOW_LOG,
    OPT_SLOW_QUERY_LOG_FILE,
 +  OPT_USERSTAT_RUNNING,
    OPT_USE_GLOBAL_LONG_QUERY_TIME,
    OPT_INNODB_ROLLBACK_ON_TIMEOUT,
    OPT_SECURE_FILE_PRIV,
-@@ -6498,6 +6524,10 @@
+@@ -6523,6 +6549,10 @@
     (gptr*) &max_system_variables.net_wait_timeout, 0, GET_ULONG,
     REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT),
     0, 1, 0},
@@ -2056,9 +2056,9 @@ diff -r 23e5576aa59a sql/mysqld.cc
    {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
  };
  
-diff -r 23e5576aa59a sql/set_var.cc
---- a/sql/set_var.cc   Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/set_var.cc   Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 sql/set_var.cc
+--- a/sql/set_var.cc   Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/set_var.cc   Mon Jun 01 00:36:01 2009 -0700
 @@ -325,6 +325,7 @@
  sys_var_thd_ulong     sys_read_buff_size("read_buffer_size",
                                           &SV::read_buff_size);
@@ -2067,7 +2067,7 @@ diff -r 23e5576aa59a sql/set_var.cc
  sys_var_thd_ulong     sys_read_rnd_buff_size("read_rnd_buffer_size",
                                               &SV::read_rnd_buff_size);
  sys_var_thd_ulong     sys_div_precincrement("div_precision_increment",
-@@ -828,6 +829,7 @@
+@@ -837,6 +838,7 @@
    &sys_trans_alloc_block_size,
    &sys_trans_prealloc_size,
    &sys_tx_isolation,
@@ -2075,7 +2075,7 @@ diff -r 23e5576aa59a sql/set_var.cc
    &sys_version,
  #ifdef HAVE_BERKELEY_DB
    &sys_version_bdb,
-@@ -1174,6 +1176,7 @@
+@@ -1190,6 +1192,7 @@
    {sys_tx_isolation.name,     (char*) &sys_tx_isolation,          SHOW_SYS},
    {sys_updatable_views_with_limit.name,
                                (char*) &sys_updatable_views_with_limit,SHOW_SYS},
@@ -2083,9 +2083,9 @@ diff -r 23e5576aa59a sql/set_var.cc
    {sys_use_global_long_query_time.name, (char*) &sys_use_global_long_query_time, SHOW_SYS},
    {sys_version.name,          (char*) &sys_version,                 SHOW_SYS},
  #ifdef HAVE_BERKELEY_DB
-diff -r 23e5576aa59a sql/share/Makefile.in
---- a/sql/share/Makefile.in    Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/share/Makefile.in    Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 sql/share/Makefile.in
+--- a/sql/share/Makefile.in    Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/share/Makefile.in    Mon Jun 01 00:36:01 2009 -0700
 @@ -144,6 +144,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -2094,9 +2094,9 @@ diff -r 23e5576aa59a sql/share/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a sql/sql_base.cc
---- a/sql/sql_base.cc  Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/sql_base.cc  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 sql/sql_base.cc
+--- a/sql/sql_base.cc  Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/sql_base.cc  Mon Jun 01 00:36:01 2009 -0700
 @@ -624,6 +624,12 @@
    DBUG_ENTER("close_thread_table");
    DBUG_ASSERT(table->key_read == 0);
@@ -2120,10 +2120,10 @@ diff -r 23e5576aa59a sql/sql_base.cc
    db_type table_type=table->s->db_type;
    strmov(path,table->s->path);
    free_io_cache(table);
-diff -r 23e5576aa59a sql/sql_class.cc
---- a/sql/sql_class.cc Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/sql_class.cc Tue Feb 17 22:33:23 2009 -0800
-@@ -236,6 +236,13 @@
+diff -r 1ac0113deff5 sql/sql_class.cc
+--- a/sql/sql_class.cc Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/sql_class.cc Mon Jun 01 00:36:01 2009 -0700
+@@ -239,6 +239,13 @@
    bzero(ha_data, sizeof(ha_data));
    mysys_var=0;
    binlog_evt_union.do_union= FALSE;
@@ -2137,7 +2137,7 @@ diff -r 23e5576aa59a sql/sql_class.cc
  #ifndef DBUG_OFF
    dbug_sentry=THD_SENTRY_MAGIC;
  #endif
-@@ -369,6 +376,88 @@
+@@ -378,6 +385,88 @@
    total_warn_count= 0;
    update_charset();
    bzero((char *) &status_var, sizeof(status_var));
@@ -2226,7 +2226,7 @@ diff -r 23e5576aa59a sql/sql_class.cc
  }
  
  
-@@ -892,6 +984,33 @@
+@@ -907,6 +996,33 @@
  }
  #endif
  
@@ -2260,15 +2260,15 @@ diff -r 23e5576aa59a sql/sql_class.cc
  
  struct Item_change_record: public ilink
  {
-@@ -1062,6 +1181,7 @@
-     }
+@@ -1082,6 +1198,7 @@
+     buffer.set(buff, sizeof(buff), &my_charset_bin);
    }
    thd->sent_row_count++;
 +  thd->sent_row_count_2++;
    if (!thd->vio_ok())
      DBUG_RETURN(0);
    if (!thd->net.report_error)
-@@ -1154,6 +1274,7 @@
+@@ -1174,6 +1291,7 @@
  select_export::~select_export()
  {
    thd->sent_row_count=row_count;
@@ -2276,7 +2276,7 @@ diff -r 23e5576aa59a sql/sql_class.cc
  }
  
  
-@@ -2088,6 +2209,7 @@
+@@ -2108,6 +2226,7 @@
    if (likely(thd != 0))
    { /* current_thd==0 when close_connection() calls net_send_error() */
      thd->status_var.bytes_sent+= length;
@@ -2284,7 +2284,7 @@ diff -r 23e5576aa59a sql/sql_class.cc
    }
  }
  
-@@ -2095,6 +2217,7 @@
+@@ -2115,6 +2234,7 @@
  void thd_increment_bytes_received(ulong length)
  {
    current_thd->status_var.bytes_received+= length;
@@ -2292,10 +2292,10 @@ diff -r 23e5576aa59a sql/sql_class.cc
  }
  
  
-diff -r 23e5576aa59a sql/sql_class.h
---- a/sql/sql_class.h  Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/sql_class.h  Tue Feb 17 22:33:23 2009 -0800
-@@ -1299,6 +1299,8 @@
+diff -r 1ac0113deff5 sql/sql_class.h
+--- a/sql/sql_class.h  Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/sql_class.h  Mon Jun 01 00:36:01 2009 -0700
+@@ -1302,6 +1302,8 @@
      first byte of the packet in do_command()
    */
    enum enum_server_command command;
@@ -2304,7 +2304,7 @@ diff -r 23e5576aa59a sql/sql_class.h
    uint32     server_id;
    uint32     file_id;                 // for LOAD DATA INFILE
    /*
-@@ -1488,6 +1490,8 @@
+@@ -1498,6 +1500,8 @@
    /* variables.transaction_isolation is reset to this after each commit */
    enum_tx_isolation session_tx_isolation;
    enum_check_fields count_cuted_fields;
@@ -2313,7 +2313,7 @@ diff -r 23e5576aa59a sql/sql_class.h
  
    DYNAMIC_ARRAY user_var_events;        /* For user variables replication */
    MEM_ROOT      *user_var_events_alloc; /* Allocate above array elements here */
-@@ -1594,6 +1598,49 @@
+@@ -1607,6 +1611,49 @@
    */
    LOG_INFO*  current_linfo;
    NET*       slave_net;                       // network connection from slave -> m.
@@ -2363,7 +2363,7 @@ diff -r 23e5576aa59a sql/sql_class.h
    /* Used by the sys_var class to store temporary values */
    union
    {
-@@ -1649,6 +1696,11 @@
+@@ -1662,6 +1709,11 @@
      alloc_root.
    */
    void init_for_queries();
@@ -2375,7 +2375,7 @@ diff -r 23e5576aa59a sql/sql_class.h
    void change_user(void);
    void cleanup(void);
    void cleanup_after_query();
-@@ -1878,7 +1930,13 @@
+@@ -1891,8 +1943,14 @@
      if (p_db_length)
        *p_db_length= db_length;
      return FALSE;
@@ -2384,12 +2384,13 @@ diff -r 23e5576aa59a sql/sql_class.h
 +  // by 'client' as displayed by SHOW PROCESSLIST. Allocates memory from the heap of
 +  // this THD and that is not reclaimed immediately, so use sparingly. May return NULL.
    }
-+
-+  char *get_client_host_port(THD *client);
  
++  char *get_client_host_port(THD *client);
++
  public:
    /**
-@@ -1922,6 +1980,11 @@
+     Add an internal error handler to the thread execution context.
+@@ -1935,6 +1993,11 @@
    MEM_ROOT main_mem_root;
  };
  
@@ -2401,9 +2402,9 @@ diff -r 23e5576aa59a sql/sql_class.h
  
  #define tmp_disable_binlog(A)       \
    {ulonglong tmp_disable_binlog__save_options= (A)->options; \
-diff -r 23e5576aa59a sql/sql_delete.cc
---- a/sql/sql_delete.cc        Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/sql_delete.cc        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 sql/sql_delete.cc
+--- a/sql/sql_delete.cc        Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/sql_delete.cc        Mon Jun 01 00:36:01 2009 -0700
 @@ -358,6 +358,7 @@
      send_ok(thd,deleted);
      DBUG_PRINT("info",("%ld records deleted",(long) deleted));
@@ -2420,9 +2421,9 @@ diff -r 23e5576aa59a sql/sql_delete.cc
    return 0;
  }
  
-diff -r 23e5576aa59a sql/sql_insert.cc
---- a/sql/sql_insert.cc        Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/sql_insert.cc        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 sql/sql_insert.cc
+--- a/sql/sql_insert.cc        Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/sql_insert.cc        Mon Jun 01 00:36:01 2009 -0700
 @@ -989,6 +989,7 @@
      thd->row_count_func= info.copied + info.deleted + updated;
      ::send_ok(thd, (ulong) thd->row_count_func, id, buff);
@@ -2431,7 +2432,7 @@ diff -r 23e5576aa59a sql/sql_insert.cc
    thd->abort_on_warning= 0;
    DBUG_RETURN(FALSE);
  
-@@ -3036,6 +3037,7 @@
+@@ -3064,6 +3065,7 @@
      autoinc_value_of_first_inserted_row : thd->insert_id_used ?
      thd->last_insert_id : 0;
    ::send_ok(thd, (ulong) thd->row_count_func, id, buff);
@@ -2439,9 +2440,9 @@ diff -r 23e5576aa59a sql/sql_insert.cc
    DBUG_RETURN(0);
  }
  
-diff -r 23e5576aa59a sql/sql_lex.h
---- a/sql/sql_lex.h    Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/sql_lex.h    Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 sql/sql_lex.h
+--- a/sql/sql_lex.h    Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/sql_lex.h    Mon Jun 01 00:36:01 2009 -0700
 @@ -101,6 +101,9 @@
      When a command is added here, be sure it's also added in mysqld.cc
      in "struct show_var_st status_vars[]= {" ...
@@ -2452,9 +2453,9 @@ diff -r 23e5576aa59a sql/sql_lex.h
    /* This should be the last !!! */
    SQLCOM_END
  };
-diff -r 23e5576aa59a sql/sql_parse.cc
---- a/sql/sql_parse.cc Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/sql_parse.cc Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 sql/sql_parse.cc
+--- a/sql/sql_parse.cc Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/sql_parse.cc Mon Jun 01 00:36:01 2009 -0700
 @@ -78,6 +78,12 @@
                               const char *table_name);
  static bool check_show_create_table_access(THD *thd, TABLE_LIST *table);
@@ -2468,11 +2469,10 @@ diff -r 23e5576aa59a sql/sql_parse.cc
  const char *any_db="*any*";   // Special symbol for check_access
  
  const char *command_name[]={
-@@ -145,6 +151,17 @@
- #ifndef EMBEDDED_LIBRARY
+@@ -146,6 +152,17 @@
  static bool do_command(THD *thd);
  #endif // EMBEDDED_LIBRARY
-+
 +HASH global_user_stats;
 +HASH global_client_stats;
 +// Protects global_user_stats and global_client_stats
@@ -2483,9 +2483,10 @@ diff -r 23e5576aa59a sql/sql_parse.cc
 +
 +HASH global_index_stats;
 +extern pthread_mutex_t LOCK_global_index_stats;
++
  #ifdef __WIN__
  extern void win_install_sigabrt_handler(void);
+ #endif
 @@ -504,6 +521,7 @@
      mysql_log.write(thd,COM_CONNECT,ER(ER_NOT_SUPPORTED_AUTH_MODE));
      DBUG_RETURN(-1);
@@ -3016,7 +3017,7 @@ diff -r 23e5576aa59a sql/sql_parse.cc
    /*
      Commands which always take a long time are logged into
      the slow log only if opt_log_slow_admin_statements is set.
-@@ -4428,6 +4883,15 @@
+@@ -4540,6 +4995,15 @@
      if (check_global_access(thd,RELOAD_ACL))
        goto error;
  
@@ -3032,7 +3033,7 @@ diff -r 23e5576aa59a sql/sql_parse.cc
      /*
        reload_acl_and_cache() will tell us if we are allowed to write to the
        binlog or not.
-@@ -4735,6 +5199,7 @@
+@@ -4848,6 +5312,7 @@
      {
        if (check_global_access(thd, SUPER_ACL))
        {
@@ -3040,7 +3041,7 @@ diff -r 23e5576aa59a sql/sql_parse.cc
          my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER");
          goto create_sp_error;
        }
-@@ -5571,6 +6036,7 @@
+@@ -5692,6 +6157,7 @@
        if (!no_errors)
        {
          const char *db_name= db ? db : thd->db;
@@ -3048,7 +3049,7 @@ diff -r 23e5576aa59a sql/sql_parse.cc
          my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
                   sctx->priv_user, sctx->priv_host, db_name);
        }
-@@ -5606,6 +6072,7 @@
+@@ -5727,6 +6193,7 @@
    {                                           // We can never grant this
      DBUG_PRINT("error",("No possible access"));
      if (!no_errors)
@@ -3056,7 +3057,7 @@ diff -r 23e5576aa59a sql/sql_parse.cc
        my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
                 sctx->priv_user,
                 sctx->priv_host,
-@@ -5638,11 +6105,15 @@
+@@ -5759,11 +6226,15 @@
  
    DBUG_PRINT("error",("Access denied"));
    if (!no_errors)
@@ -3072,7 +3073,7 @@ diff -r 23e5576aa59a sql/sql_parse.cc
    DBUG_RETURN(TRUE);                          /* purecov: tested */
  #endif /* NO_EMBEDDED_ACCESS_CHECKS */
  }
-@@ -5676,6 +6147,7 @@
+@@ -5797,6 +6268,7 @@
    if ((thd->security_ctx->master_access & want_access))
      return 0;
    get_privilege_desc(command, sizeof(command), want_access);
@@ -3080,7 +3081,7 @@ diff -r 23e5576aa59a sql/sql_parse.cc
    my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), command);
    return 1;
  #endif /* NO_EMBEDDED_ACCESS_CHECKS */
-@@ -5708,6 +6180,7 @@
+@@ -5829,6 +6301,7 @@
  
        if (!thd->col_access && check_grant_db(thd, dst_db_name))
        {
@@ -3088,7 +3089,7 @@ diff -r 23e5576aa59a sql/sql_parse.cc
          my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
                   thd->security_ctx->priv_user,
                   thd->security_ctx->priv_host,
-@@ -5739,6 +6212,12 @@
+@@ -5860,6 +6333,12 @@
               check_grant(thd, SELECT_ACL, dst_table, 2, UINT_MAX, FALSE);
      }
  
@@ -3101,7 +3102,7 @@ diff -r 23e5576aa59a sql/sql_parse.cc
    case SCH_OPEN_TABLES:
    case SCH_VARIABLES:
    case SCH_STATUS:
-@@ -5792,8 +6271,8 @@
+@@ -5913,8 +6392,8 @@
  #ifndef NO_EMBEDDED_ACCESS_CHECKS
    TABLE_LIST *org_tables= tables;
  #endif
@@ -3111,7 +3112,7 @@ diff -r 23e5576aa59a sql/sql_parse.cc
    /*
      The check that first_not_own_table is not reached is for the case when
      the given table list refers to the list for prelocking (contains tables
-@@ -5810,9 +6289,12 @@
+@@ -5931,9 +6410,12 @@
          (want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))
      {
        if (!no_errors)
@@ -3124,11 +3125,10 @@ diff -r 23e5576aa59a sql/sql_parse.cc
        return TRUE;
      }
      /*
-@@ -6321,6 +6803,30 @@
-   */
+@@ -6443,6 +6925,30 @@
    lex_start(thd);
    mysql_reset_thd_for_next_command(thd);
-+
 +  int start_time_error = 0;
 +  int end_time_error = 0;
 +  struct timeval start_time, end_time;
@@ -3152,10 +3152,11 @@ diff -r 23e5576aa59a sql/sql_parse.cc
 +      start_usecs = start_time.tv_sec * 1000000.0 + start_time.tv_usec;
 +    }
 +  }
++
    if (query_cache_send_result_to_client(thd, (char*) inBuf, length) <= 0)
    {
-@@ -6400,6 +6906,43 @@
+     LEX *lex= thd->lex;
+@@ -6521,6 +7027,43 @@
      *found_semicolon= NULL;
    }
  
@@ -3199,7 +3200,7 @@ diff -r 23e5576aa59a sql/sql_parse.cc
    DBUG_VOID_RETURN;
  }
  
-@@ -7411,8 +7954,35 @@
+@@ -7532,8 +8075,35 @@
     pthread_mutex_unlock(&LOCK_active_mi);
   }
  #endif
@@ -3237,19 +3238,19 @@ diff -r 23e5576aa59a sql/sql_parse.cc
   *write_to_binlog= tmp_write_to_binlog;
   return result;
  }
-diff -r 23e5576aa59a sql/sql_prepare.cc
---- a/sql/sql_prepare.cc       Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/sql_prepare.cc       Tue Feb 17 22:33:23 2009 -0800
-@@ -80,6 +80,9 @@
- #else
+diff -r 1ac0113deff5 sql/sql_prepare.cc
+--- a/sql/sql_prepare.cc       Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/sql_prepare.cc       Mon Jun 01 00:36:01 2009 -0700
+@@ -81,6 +81,9 @@
  #include <mysql_com.h>
  #endif
-+
 +// Uses the THD to update the global stats by user name and client IP
 +void update_global_user_stats(THD* thd, bool create_user, time_t now);
++
  /* A result class used to send cursor rows using the binary protocol. */
  
+ class Select_fetch_protocol_prep: public select_send
 @@ -1910,8 +1913,32 @@
    /* First of all clear possible warnings from the previous command */
    mysql_reset_thd_for_next_command(thd);
@@ -3370,7 +3371,7 @@ diff -r 23e5576aa59a sql/sql_prepare.cc
 -    DBUG_VOID_RETURN;
 +    goto end;
  
- #ifdef ENABLED_PROFILING
+ #if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
    thd->profiling.set_query_source(stmt->query, stmt->query_length);
 @@ -2325,11 +2414,50 @@
                         test(flags & (ulong) CURSOR_TYPE_READ_ONLY));
@@ -3531,11 +3532,10 @@ diff -r 23e5576aa59a sql/sql_prepare.cc
    statistic_increment(thd->status_var.com_stmt_reset, &LOCK_status);
    if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_reset")))
      DBUG_VOID_RETURN;
-@@ -2502,6 +2716,43 @@
-   stmt->state= Query_arena::PREPARED;
+@@ -2503,6 +2717,43 @@
  
    send_ok(thd);
-+
 +  if (opt_userstat_running) {
 +    // Gets the end time.
 +    if (!(end_time_error = gettimeofday(&end_time, NULL))) {
@@ -3572,13 +3572,14 @@ diff -r 23e5576aa59a sql/sql_prepare.cc
 +  // Updates THD stats and the global user stats.
 +  thd->update_stats(true);
 +  update_global_user_stats(thd, true, time(NULL));
++
    DBUG_VOID_RETURN;
  }
-diff -r 23e5576aa59a sql/sql_show.cc
---- a/sql/sql_show.cc  Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/sql_show.cc  Tue Feb 17 22:33:23 2009 -0800
-@@ -530,6 +530,7 @@
+diff -r 1ac0113deff5 sql/sql_show.cc
+--- a/sql/sql_show.cc  Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/sql_show.cc  Mon Jun 01 00:36:01 2009 -0700
+@@ -540,6 +540,7 @@
                sctx->master_access);
    if (!(db_access & DB_ACLS) && (!grant_option || check_grant_db(thd,dbname)))
    {
@@ -3586,7 +3587,7 @@ diff -r 23e5576aa59a sql/sql_show.cc
      my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
               sctx->priv_user, sctx->host_or_ip, dbname);
      mysql_log.write(thd,COM_INIT_DB,ER(ER_DBACCESS_DENIED_ERROR),
-@@ -1872,6 +1873,300 @@
+@@ -1890,6 +1891,300 @@
    DBUG_RETURN(FALSE);
  }
  
@@ -3887,7 +3888,7 @@ diff -r 23e5576aa59a sql/sql_show.cc
  
  /* collect status for all running threads */
  
-@@ -4482,6 +4777,77 @@
+@@ -4500,6 +4795,77 @@
    {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
  };
  
@@ -3965,7 +3966,7 @@ diff -r 23e5576aa59a sql/sql_show.cc
  
  /*
    Description of ST_FIELD_INFO in table.h
-@@ -4491,6 +4857,8 @@
+@@ -4509,6 +4875,8 @@
  {
    {"CHARACTER_SETS", charsets_fields_info, create_schema_table, 
     fill_schema_charsets, make_character_sets_old_format, 0, -1, -1, 0},
@@ -3974,7 +3975,7 @@ diff -r 23e5576aa59a sql/sql_show.cc
    {"COLLATIONS", collation_fields_info, create_schema_table, 
     fill_schema_collation, make_old_format, 0, -1, -1, 0},
    {"COLLATION_CHARACTER_SET_APPLICABILITY", coll_charset_app_fields_info,
-@@ -4499,6 +4867,8 @@
+@@ -4517,6 +4885,8 @@
     get_all_tables, make_columns_old_format, get_schema_column_record, 1, 2, 0},
    {"COLUMN_PRIVILEGES", column_privileges_fields_info, create_schema_table,
      fill_schema_column_privileges, 0, 0, -1, -1, 0},
@@ -3983,7 +3984,7 @@ diff -r 23e5576aa59a sql/sql_show.cc
    {"KEY_COLUMN_USAGE", key_column_usage_fields_info, create_schema_table,
      get_all_tables, 0, get_schema_key_column_usage_record, 4, 5, 0},
    {"OPEN_TABLES", open_tables_fields_info, create_schema_table,
-@@ -4524,10 +4894,14 @@
+@@ -4542,10 +4912,14 @@
     get_all_tables, make_table_names_old_format, 0, 1, 2, 1},
    {"TABLE_PRIVILEGES", table_privileges_fields_info, create_schema_table,
      fill_schema_table_privileges, 0, 0, -1, -1, 0},
@@ -3998,10 +3999,10 @@ diff -r 23e5576aa59a sql/sql_show.cc
    {"VARIABLES", variables_fields_info, create_schema_table, fill_variables,
     make_old_format, 0, -1, -1, 1},
    {"VIEWS", view_fields_info, create_schema_table, 
-diff -r 23e5576aa59a sql/sql_update.cc
---- a/sql/sql_update.cc        Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/sql_update.cc        Tue Feb 17 22:33:23 2009 -0800
-@@ -601,7 +601,8 @@
+diff -r 1ac0113deff5 sql/sql_update.cc
+--- a/sql/sql_update.cc        Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/sql_update.cc        Mon Jun 01 00:36:01 2009 -0700
+@@ -604,7 +604,8 @@
        (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
      send_ok(thd, (ulong) thd->row_count_func,
            thd->insert_id_used ? thd->last_insert_id : 0L,buff);
@@ -4011,16 +4012,16 @@ diff -r 23e5576aa59a sql/sql_update.cc
    }
    thd->count_cuted_fields= CHECK_FIELD_IGNORE;                /* calc cuted fields */
    thd->abort_on_warning= 0;
-@@ -1832,5 +1833,6 @@
+@@ -1835,5 +1836,6 @@
      (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
    ::send_ok(thd, (ulong) thd->row_count_func,
            thd->insert_id_used ? thd->last_insert_id : 0L,buff);
 +  thd->updated_row_count += thd->row_count_func;
    return FALSE;
  }
-diff -r 23e5576aa59a sql/sql_yacc.yy
---- a/sql/sql_yacc.yy  Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/sql_yacc.yy  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 sql/sql_yacc.yy
+--- a/sql/sql_yacc.yy  Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/sql_yacc.yy  Mon Jun 01 00:36:01 2009 -0700
 @@ -523,6 +523,7 @@
  %token  CHECK_SYM
  %token  CIPHER_SYM
@@ -4061,7 +4062,7 @@ diff -r 23e5576aa59a sql/sql_yacc.yy
  %token  USE_FRM
  %token  USE_SYM
  %token  USING
-@@ -8244,6 +8249,38 @@
+@@ -8255,6 +8260,38 @@
            {
            Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
            }
@@ -4100,7 +4101,7 @@ diff -r 23e5576aa59a sql/sql_yacc.yy
        | CREATE PROCEDURE sp_name
          {
            LEX *lex= Lex;
-@@ -8448,9 +8485,14 @@
+@@ -8459,9 +8496,14 @@
        | LOGS_SYM      { Lex->type|= REFRESH_LOG; }
        | STATUS_SYM    { Lex->type|= REFRESH_STATUS; }
          | SLAVE         { Lex->type|= REFRESH_SLAVE; }
@@ -4116,7 +4117,7 @@ diff -r 23e5576aa59a sql/sql_yacc.yy
  
  opt_table_list:
        /* empty */  {;}
-@@ -9439,6 +9481,7 @@
+@@ -9450,6 +9492,7 @@
        | CHAIN_SYM             {}
        | CHANGED               {}
        | CIPHER_SYM            {}
@@ -4124,7 +4125,7 @@ diff -r 23e5576aa59a sql/sql_yacc.yy
        | CLIENT_SYM            {}
          | CODE_SYM              {}
        | COLLATION_SYM         {}
-@@ -9491,6 +9534,7 @@
+@@ -9502,6 +9545,7 @@
        | HOSTS_SYM             {}
        | HOUR_SYM              {}
        | IDENTIFIED_SYM        {}
@@ -4132,7 +4133,7 @@ diff -r 23e5576aa59a sql/sql_yacc.yy
        | INVOKER_SYM           {}
        | IMPORT                {}
        | INDEXES               {}
-@@ -9600,6 +9644,7 @@
+@@ -9611,6 +9655,7 @@
        | SIMPLE_SYM            {}
        | SHARE_SYM             {}
        | SHUTDOWN              {}
@@ -4140,7 +4141,7 @@ diff -r 23e5576aa59a sql/sql_yacc.yy
        | SNAPSHOT_SYM          {}
        | SOUNDS_SYM            {}
        | SOURCE_SYM            {}
-@@ -9616,6 +9661,7 @@
+@@ -9627,6 +9672,7 @@
          | SUSPEND_SYM           {}
          | SWAPS_SYM             {}
        | SWITCHES_SYM          {}
@@ -4148,7 +4149,7 @@ diff -r 23e5576aa59a sql/sql_yacc.yy
          | TABLES                {}
        | TABLESPACE            {}
        | TEMPORARY             {}
-@@ -9636,6 +9682,7 @@
+@@ -9647,6 +9693,7 @@
        | UNKNOWN_SYM           {}
        | UNTIL_SYM             {}
        | USER                  {}
@@ -4156,9 +4157,9 @@ diff -r 23e5576aa59a sql/sql_yacc.yy
        | USE_FRM               {}
        | VARIABLES             {}
        | VIEW_SYM              {}
-diff -r 23e5576aa59a sql/structs.h
---- a/sql/structs.h    Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/structs.h    Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 sql/structs.h
+--- a/sql/structs.h    Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/structs.h    Mon Jun 01 00:36:01 2009 -0700
 @@ -273,6 +273,98 @@
    time_t intime;
  } USER_CONN;
@@ -4258,9 +4259,9 @@ diff -r 23e5576aa59a sql/structs.h
        /* Bits in form->update */
  #define REG_MAKE_DUPP         1       /* Make a copy of record when read */
  #define REG_NEW_RECORD                2       /* Write a new record if not found */
-diff -r 23e5576aa59a sql/table.h
---- a/sql/table.h      Tue Feb 17 22:33:00 2009 -0800
-+++ b/sql/table.h      Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 sql/table.h
+--- a/sql/table.h      Mon Jun 01 00:35:44 2009 -0700
++++ b/sql/table.h      Mon Jun 01 00:36:01 2009 -0700
 @@ -371,10 +371,12 @@
  enum enum_schema_tables
  {
@@ -4285,9 +4286,9 @@ diff -r 23e5576aa59a sql/table.h
    SCH_VARIABLES,
    SCH_VIEWS
  };
-diff -r 23e5576aa59a strings/Makefile.in
---- a/strings/Makefile.in      Tue Feb 17 22:33:00 2009 -0800
-+++ b/strings/Makefile.in      Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 strings/Makefile.in
+--- a/strings/Makefile.in      Mon Jun 01 00:35:44 2009 -0700
++++ b/strings/Makefile.in      Mon Jun 01 00:36:01 2009 -0700
 @@ -342,6 +342,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -4296,9 +4297,9 @@ diff -r 23e5576aa59a strings/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a support-files/MacOSX/Makefile.in
---- a/support-files/MacOSX/Makefile.in Tue Feb 17 22:33:00 2009 -0800
-+++ b/support-files/MacOSX/Makefile.in Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 support-files/MacOSX/Makefile.in
+--- a/support-files/MacOSX/Makefile.in Mon Jun 01 00:35:44 2009 -0700
++++ b/support-files/MacOSX/Makefile.in Mon Jun 01 00:36:01 2009 -0700
 @@ -148,6 +148,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -4307,9 +4308,9 @@ diff -r 23e5576aa59a support-files/MacOSX/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a support-files/Makefile.in
---- a/support-files/Makefile.in        Tue Feb 17 22:33:00 2009 -0800
-+++ b/support-files/Makefile.in        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 support-files/Makefile.in
+--- a/support-files/Makefile.in        Mon Jun 01 00:35:44 2009 -0700
++++ b/support-files/Makefile.in        Mon Jun 01 00:36:01 2009 -0700
 @@ -171,6 +171,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -4318,9 +4319,9 @@ diff -r 23e5576aa59a support-files/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a support-files/RHEL4-SElinux/Makefile.in
---- a/support-files/RHEL4-SElinux/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/support-files/RHEL4-SElinux/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 support-files/RHEL4-SElinux/Makefile.in
+--- a/support-files/RHEL4-SElinux/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/support-files/RHEL4-SElinux/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -146,6 +146,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -4329,9 +4330,9 @@ diff -r 23e5576aa59a support-files/RHEL4-SElinux/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a tests/Makefile.in
---- a/tests/Makefile.in        Tue Feb 17 22:33:00 2009 -0800
-+++ b/tests/Makefile.in        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 tests/Makefile.in
+--- a/tests/Makefile.in        Mon Jun 01 00:35:44 2009 -0700
++++ b/tests/Makefile.in        Mon Jun 01 00:36:01 2009 -0700
 @@ -193,6 +193,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -4340,9 +4341,9 @@ diff -r 23e5576aa59a tests/Makefile.in
  LIBS = @CLIENT_LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a tools/Makefile.in
---- a/tools/Makefile.in        Tue Feb 17 22:33:00 2009 -0800
-+++ b/tools/Makefile.in        Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 tools/Makefile.in
+--- a/tools/Makefile.in        Mon Jun 01 00:35:44 2009 -0700
++++ b/tools/Makefile.in        Mon Jun 01 00:36:01 2009 -0700
 @@ -167,6 +167,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -4351,9 +4352,9 @@ diff -r 23e5576aa59a tools/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a vio/Makefile.in
---- a/vio/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/vio/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 vio/Makefile.in
+--- a/vio/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/vio/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -176,6 +176,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -4362,9 +4363,9 @@ diff -r 23e5576aa59a vio/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a win/Makefile.in
---- a/win/Makefile.in  Tue Feb 17 22:33:00 2009 -0800
-+++ b/win/Makefile.in  Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 win/Makefile.in
+--- a/win/Makefile.in  Mon Jun 01 00:35:44 2009 -0700
++++ b/win/Makefile.in  Mon Jun 01 00:36:01 2009 -0700
 @@ -144,6 +144,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
@@ -4373,9 +4374,9 @@ diff -r 23e5576aa59a win/Makefile.in
  LIBS = @LIBS@
  LIBTOOL = @LIBTOOL@
  LIB_EXTRA_CCFLAGS = @LIB_EXTRA_CCFLAGS@
-diff -r 23e5576aa59a zlib/Makefile.in
---- a/zlib/Makefile.in Tue Feb 17 22:33:00 2009 -0800
-+++ b/zlib/Makefile.in Tue Feb 17 22:33:23 2009 -0800
+diff -r 1ac0113deff5 zlib/Makefile.in
+--- a/zlib/Makefile.in Mon Jun 01 00:35:44 2009 -0700
++++ b/zlib/Makefile.in Mon Jun 01 00:36:01 2009 -0700
 @@ -187,6 +187,7 @@
  LIBDL = @LIBDL@
  LIBEDIT_LOBJECTS = @LIBEDIT_LOBJECTS@
index d1be9175f65e18331d7735a99566a86199a844bd..baf49b170863b6de8fb27eae816f6aba167ac775 100644 (file)
@@ -1,7 +1,296 @@
---- mysql-5.0.75/innobase/log/log0recv.c        2008-12-19 02:19:36.000000000 +0900
-+++ mysql-5.0.75_1/innobase/log/log0recv.c      2009-02-27 19:41:07.000000000 +0900
+diff -ru a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c
+--- a/innobase/buf/buf0buf.c   2008-12-19 02:19:35.000000000 +0900
++++ b/innobase/buf/buf0buf.c   2009-04-08 10:52:42.000000000 +0900
+@@ -314,7 +314,7 @@
+               return(TRUE);
+       }
+-#ifndef UNIV_HOTBACKUP
++#ifdef UNDEFINED
+       if (recv_lsn_checks_on && log_peek_lsn(&current_lsn)) {
+               if (ut_dulint_cmp(current_lsn,
+                                 mach_read_from_8(read_buf + FIL_PAGE_LSN))
+diff -ru a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c
+--- a/innobase/buf/buf0rea.c   2008-12-19 02:19:35.000000000 +0900
++++ b/innobase/buf/buf0rea.c   2009-04-09 18:18:30.000000000 +0900
+@@ -125,6 +125,45 @@
+       block = buf_page_init_for_read(err, mode, space, tablespace_version,
+                                                               offset);
+       if (block == NULL) {
++              if (recv_recovery_is_on() && *err == DB_TABLESPACE_DELETED) {
++                      /* hashed log recs must be treated here */
++                      recv_addr_t*    recv_addr;
++
++                      mutex_enter(&(recv_sys->mutex));
++
++                      if (recv_sys->apply_log_recs == FALSE) {
++                              mutex_exit(&(recv_sys->mutex));
++                              goto not_to_recover;
++                      }
++
++                      /* recv_get_fil_addr_struct() */
++                      recv_addr = HASH_GET_FIRST(recv_sys->addr_hash,
++                                      hash_calc_hash(ut_fold_ulint_pair(space, offset),
++                                              recv_sys->addr_hash));
++                      while (recv_addr) {
++                              if ((recv_addr->space == space)
++                                      && (recv_addr->page_no == offset)) {
++                                      break;
++                              }
++                              recv_addr = HASH_GET_NEXT(addr_hash, recv_addr);
++                      }
++
++                      if ((recv_addr == NULL)
++                          || (recv_addr->state == RECV_BEING_PROCESSED)
++                          || (recv_addr->state == RECV_PROCESSED)) {
++                              mutex_exit(&(recv_sys->mutex));
++                              goto not_to_recover;
++                      }
++
++                      fprintf(stderr, " (space:%lu is deleted)", space);
++                      recv_addr->state = RECV_PROCESSED;
++
++                      ut_a(recv_sys->n_addrs);
++                      recv_sys->n_addrs--;
++
++                      mutex_exit(&(recv_sys->mutex));
++              }
++not_to_recover:
+               
+               return(0);
+       }
+@@ -684,11 +723,11 @@
+               while (buf_pool->n_pend_reads >= recv_n_pool_free_frames / 2) {
+                       os_aio_simulated_wake_handler_threads();
+-                      os_thread_sleep(500000);
++                      os_thread_sleep(20000);
+                       count++;
+-                      if (count > 100) {
++                      if (count > 2500) {
+                               fprintf(stderr,
+ "InnoDB: Error: InnoDB has waited for 50 seconds for pending\n"
+ "InnoDB: reads to the buffer pool to be finished.\n"
+diff -ru a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c
+--- a/innobase/fil/fil0fil.c   2008-12-19 02:19:35.000000000 +0900
++++ b/innobase/fil/fil0fil.c   2009-04-08 10:52:42.000000000 +0900
+@@ -2027,7 +2027,7 @@
+       }
+       if (success) {
+-#ifndef UNIV_HOTBACKUP
++#ifdef UNDEFINED
+               /* Write a log record about the deletion of the .ibd
+               file, so that ibbackup can replay it in the
+               --apply-log phase. We use a dummy mtr and the familiar
+@@ -2300,7 +2300,7 @@
+       mutex_exit(&(system->mutex));
+-#ifndef UNIV_HOTBACKUP        
++#ifdef UNDEFINED      
+       if (success) {
+               mtr_t           mtr;
+@@ -2471,7 +2471,7 @@
+       fil_node_create(path, size, *space_id, FALSE);
+-#ifndef UNIV_HOTBACKUP        
++#ifdef UNDEFINED      
+       {
+       mtr_t           mtr;
+@@ -2890,7 +2890,7 @@
+       cannot be ok. */
+       size = (((ib_longlong)size_high) << 32) + (ib_longlong)size_low;
+-#ifndef UNIV_HOTBACKUP
++#ifdef UNDEFINED
+       if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
+               fprintf(stderr,
+ "InnoDB: Error: the size of single-table tablespace file %s\n"
+@@ -3009,7 +3009,7 @@
+ A fault-tolerant function that tries to read the next file name in the
+ directory. We retry 100 times if os_file_readdir_next_file() returns -1. The
+ idea is to read as much good data as we can and jump over bad data. */
+-static
++//static
+ int
+ fil_file_readdir_next_file(
+ /*=======================*/
+@@ -3949,6 +3949,16 @@
+       ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));
++      if (space->size <= block_offset) {
++              ulint   actual_size;
++
++              mutex_exit(&(system->mutex));
++              fil_extend_space_to_desired_size(&actual_size, space->id,
++                                               ((block_offset + 1) / 64 + 1) * 64);
++              mutex_enter(&(system->mutex));
++              /* should retry? but it may safe for xtrabackup for now. */
++      }
++
+       node = UT_LIST_GET_FIRST(space->chain);
+       for (;;) {
+diff -ru a/innobase/include/mem0mem.h b/innobase/include/mem0mem.h
+--- a/innobase/include/mem0mem.h       2008-12-19 02:19:36.000000000 +0900
++++ b/innobase/include/mem0mem.h       2009-04-08 10:52:42.000000000 +0900
+@@ -352,6 +352,7 @@
+                       allocated buffer frame, which can be appended as a
+                       free block to the heap, if we need more space;
+                       otherwise, this is NULL */
++      ulint   sum_len;        /* sum of all blocks' len belong to the base node */
+ #ifdef MEM_PERIODIC_CHECK     
+       UT_LIST_NODE_T(mem_block_t) mem_block_list;
+                       /* List of all mem blocks allocated; protected
+diff -ru a/innobase/include/mem0mem.ic b/innobase/include/mem0mem.ic
+--- a/innobase/include/mem0mem.ic      2008-12-19 02:19:36.000000000 +0900
++++ b/innobase/include/mem0mem.ic      2009-04-08 10:52:42.000000000 +0900
+@@ -415,6 +415,7 @@
+       /* Add the created block itself as the first block in the list */
+       UT_LIST_ADD_FIRST(list, block->base, block);
++      block->sum_len = block->len;
+ #ifdef UNIV_MEM_DEBUG
+@@ -546,6 +547,7 @@
+       ut_ad(mem_heap_check(heap));
+       
++/*
+       block = heap;
+       while (block != NULL) { 
+@@ -553,6 +555,8 @@
+               size += mem_block_get_len(block);
+               block = UT_LIST_GET_NEXT(list, block);
+       }
++*/
++      size = heap->sum_len;
+       if (heap->free_block) {
+               size += UNIV_PAGE_SIZE;
+diff -ru a/innobase/include/srv0start.h b/innobase/include/srv0start.h
+--- a/innobase/include/srv0start.h     2008-12-19 02:19:36.000000000 +0900
++++ b/innobase/include/srv0start.h     2009-04-08 10:52:42.000000000 +0900
+@@ -80,6 +80,7 @@
+                               /* out: DB_SUCCESS or error code */
+ extern        dulint  srv_shutdown_lsn;
+ extern        dulint  srv_start_lsn;
++extern        dulint  srv_oldest_lsn;
+ #ifdef __NETWARE__
+ void set_panic_flag_for_netware(void);
+diff -ru a/innobase/include/ut0byte.ic b/innobase/include/ut0byte.ic
+--- a/innobase/include/ut0byte.ic      2008-12-19 02:19:36.000000000 +0900
++++ b/innobase/include/ut0byte.ic      2009-04-08 10:52:42.000000000 +0900
+@@ -152,6 +152,14 @@
+       dulint  a,      /* in: dulint */
+       ulint   b)      /* in: ulint */
+ {
++      if (sizeof(ulint) != 4) {
++              ulint   b_h;
++
++              b_h = b >> 32;
++              b &= 0xFFFFFFFFUL;
++              a.high += b_h;
++      }
++
+       if (0xFFFFFFFFUL - b >= a.low) {
+               a.low += b;
+@@ -175,6 +183,14 @@
+       dulint  a,      /* in: dulint */
+       ulint   b)      /* in: ulint, b <= a */
+ {
++      if (sizeof(ulint) != 4) {
++              ulint   b_h;
++
++              b_h = b >> 32;
++              b &= 0xFFFFFFFFUL;
++              a.high -= b_h;
++      }
++
+       if (a.low >= b) {
+               a.low -= b;
+@@ -218,6 +234,10 @@
+       diff += 1 + a.low;
+       ut_ad(diff > a.low);
++
++      if (sizeof(ulint) != 4) {
++              diff += (a.high - b.high - 1) << 32;
++      }
+       
+       return(diff);
+ } 
+diff -ru a/innobase/log/log0log.c b/innobase/log/log0log.c
+--- a/innobase/log/log0log.c   2008-12-19 02:19:36.000000000 +0900
++++ b/innobase/log/log0log.c   2009-04-08 10:52:42.000000000 +0900
+@@ -548,7 +548,9 @@
+       offset = (gr_lsn_size_offset + difference) % group_size;
++      if (sizeof(ulint) == 4) {
+       ut_a(offset < (((ib_longlong) 1) << 32)); /* offset must be < 4 GB */
++      }
+       /* fprintf(stderr,
+               "Offset is %lu gr_lsn_offset is %lu difference is %lu\n",
+diff -ru a/innobase/log/log0recv.c b/innobase/log/log0recv.c
+--- a/innobase/log/log0recv.c  2008-12-19 02:19:36.000000000 +0900
++++ b/innobase/log/log0recv.c  2009-04-09 18:34:45.000000000 +0900
+@@ -35,19 +35,19 @@
+ #include "fil0fil.h"
+ #include "sync0sync.h"
+-#ifdef UNIV_HOTBACKUP
++//#ifdef UNIV_HOTBACKUP
+ /* This is set to FALSE if the backup was originally taken with the
+ ibbackup --include regexp option: then we do not want to create tables in
+ directories which were not included */
+ ibool recv_replay_file_ops    = TRUE;
+-#endif /* UNIV_HOTBACKUP */
++//#endif /* UNIV_HOTBACKUP */
+ /* Log records are stored in the hash table in chunks at most of this size;
+ this must be less than UNIV_PAGE_SIZE as it is stored in the buffer pool */
+ #define RECV_DATA_BLOCK_SIZE  (MEM_MAX_ALLOC_IN_BUF - sizeof(recv_data_t))
+ /* Read-ahead area in applying log records to file pages */
+-#define RECV_READ_AHEAD_AREA  32
++#define RECV_READ_AHEAD_AREA  128
+ recv_sys_t*   recv_sys = NULL;
+ ibool         recv_recovery_on = FALSE;
+@@ -101,7 +101,7 @@
+ use these free frames to read in pages when we start applying the
+ log records to the database. */
+-ulint  recv_n_pool_free_frames         = 256;
++ulint  recv_n_pool_free_frames         = 1024;
+ /* The maximum lsn we see for a page during the recovery process. If this
+ is bigger than the lsn we are able to scan up to, that is an indication that
+@@ -450,7 +450,7 @@
+ /***************************************************************************
+ Checks the consistency of the checkpoint info */
+-static
++//static
+ ibool
+ recv_check_cp_is_consistent(
+ /*========================*/
 @@ -479,7 +479,7 @@
-
  /************************************************************
  Looks for the maximum consistent checkpoint from the log groups. */
 -static
  ibool
  log_block_checksum_is_ok_or_old_format(
  /*===================================*/
-
---- mysql-5.0.75/innobase/os/os0file.c  2008-12-19 02:19:36.000000000 +0900
-+++ mysql-5.0.75_1/innobase/os/os0file.c        2009-02-26 11:54:47.000000000 +0900
+@@ -1135,6 +1135,7 @@
+       recv_addr = recv_get_fil_addr_struct(space, page_no);
+       if ((recv_addr == NULL)
++          || (recv_addr->state == RECV_BEING_READ && !just_read_in)
+           || (recv_addr->state == RECV_BEING_PROCESSED)
+           || (recv_addr->state == RECV_PROCESSED)) {
+@@ -2076,7 +2077,7 @@
+               } else if (store_to_hash && (type == MLOG_FILE_CREATE
+                                            || type == MLOG_FILE_RENAME
+                                            || type == MLOG_FILE_DELETE)) {
+-#ifdef UNIV_HOTBACKUP
++//#ifdef UNIV_HOTBACKUP
+                       if (recv_replay_file_ops) {
+                               /* In ibbackup --apply-log, replay an .ibd file
+@@ -2093,7 +2094,7 @@
+                                       ut_a(0);
+                               }
+                       }
+-#endif
++//#endif
+                       /* In normal mysqld crash recovery we do not try to
+                       replay file operations */
+               } else if (store_to_hash) {
+@@ -2514,9 +2515,12 @@
+               if (finished || (recv_scan_print_counter % 80 == 0)) {
+                       fprintf(stderr, 
+-"InnoDB: Doing recovery: scanned up to log sequence number %lu %lu\n",
++"InnoDB: Doing recovery: scanned up to log sequence number %lu %lu (%lu %)\n",
+                               (ulong) ut_dulint_get_high(*group_scanned_lsn),
+-                              (ulong) ut_dulint_get_low(*group_scanned_lsn));
++                              (ulong) ut_dulint_get_low(*group_scanned_lsn),
++                              (ulong) ut_dulint_minus(*group_scanned_lsn, srv_oldest_lsn)
++                              / (8 * log_group_get_capacity(UT_LIST_GET_FIRST(log_sys->log_groups))/900)
++                      );
+               }
+       }
+@@ -2626,12 +2630,14 @@
+       if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
++#ifdef UNDEFINED
+               fprintf(stderr,
+                       "InnoDB: Restoring possible"
+                       " half-written data pages from"
+                       " the doublewrite\n"
+                       "InnoDB: buffer...\n");
+-              trx_sys_doublewrite_init_or_restore_pages(TRUE);
++#endif
++              trx_sys_doublewrite_init_or_restore_pages(FALSE);
+       }
+       
+ }
+@@ -2760,6 +2766,7 @@ 
+               recv_sys->recovered_lsn = checkpoint_lsn;
+               srv_start_lsn = checkpoint_lsn;
++              srv_oldest_lsn = checkpoint_lsn;
+       }
+       contiguous_lsn = ut_dulint_align_down(recv_sys->scanned_lsn,
+diff -ru a/innobase/mem/mem0mem.c b/innobase/mem/mem0mem.c
+--- a/innobase/mem/mem0mem.c   2008-12-19 02:19:36.000000000 +0900
++++ b/innobase/mem/mem0mem.c   2009-04-08 10:52:42.000000000 +0900
+@@ -266,6 +266,7 @@
+       /* Add the new block as the last block */
+       UT_LIST_INSERT_AFTER(list, heap->base, block, new_block);
++      heap->sum_len += new_block->len;
+       return(new_block);
+ }
+@@ -288,6 +289,7 @@
+       }
+       UT_LIST_REMOVE(list, heap->base, block);
++      heap->sum_len -= block->len;
+               
+ #ifdef MEM_PERIODIC_CHECK     
+       mem_pool_mutex_enter();
+diff -ru a/innobase/os/os0file.c b/innobase/os/os0file.c
+--- a/innobase/os/os0file.c    2008-12-19 02:19:36.000000000 +0900
++++ b/innobase/os/os0file.c    2009-04-09 18:22:49.000000000 +0900
 @@ -435,7 +435,7 @@
  }
-
  #undef USE_FILE_LOCK
 -#define USE_FILE_LOCK
 +//#define USE_FILE_LOCK
  #if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__NETWARE__)
  /* InnoDB Hot Backup does not lock the data files.
   * On Windows, mandatory locking is used.
-
---- mysql-5.0.75/innobase/srv/srv0start.c       2008-12-19 02:19:37.000000000 +0900
-+++ mysql-5.0.75_1/innobase/srv/srv0start.c     2009-02-26 11:48:30.000000000 +0900
-@@ -547,7 +547,7 @@
+@@ -3148,6 +3148,13 @@
+       struct aiocb*   control;
+ #endif
+       ulint           i;
++      ulint           prim_segment;
++      ulint           n;
++
++      n = array->n_slots / array->n_segments;
++      /* 64 blocks' striping ( aligning max(BUF_READ_AHEAD_AREA) ) */
++      prim_segment = ( offset >> (UNIV_PAGE_SIZE_SHIFT + 6) ) % (array->n_segments);
++
+ loop:
+       os_mutex_enter(array->mutex);
+@@ -3166,6 +3173,16 @@
+               goto loop;
+       }
++      for (i = prim_segment * n; i < array->n_slots; i++) {
++              slot = os_aio_array_get_nth_slot(array, i);
++
++              if (slot->reserved == FALSE) {
++                      break;
++              }
++      }
++
++      if (slot->reserved == TRUE){
++              /* Not found after the intended segment. So we should search before. */
+       for (i = 0;; i++) {
+               slot = os_aio_array_get_nth_slot(array, i);
+@@ -3173,6 +3190,7 @@
+                       break;
+               }
+       }
++      }
+       array->n_reserved++;
+diff -ru a/innobase/os/os0thread.c b/innobase/os/os0thread.c
+--- a/innobase/os/os0thread.c  2008-12-19 02:19:36.000000000 +0900
++++ b/innobase/os/os0thread.c  2009-04-08 10:52:42.000000000 +0900
+@@ -266,12 +266,17 @@
+ #elif defined(__NETWARE__)
+       delay(tm / 1000);
+ #else
++      /* select() simetimes hang up from xtrabackup */
++      /* change to use usleep() for now */
++      usleep(tm);
++/*
+       struct timeval  t;
+       t.tv_sec = tm / 1000000;
+       t.tv_usec = tm % 1000000;
+       
+       select(0, NULL, NULL, NULL, &t);
++*/
+ #endif
+ }
+diff -ru a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
+--- a/innobase/srv/srv0start.c 2008-12-19 02:19:37.000000000 +0900
++++ b/innobase/srv/srv0start.c 2009-04-09 18:25:02.000000000 +0900
+@@ -61,6 +61,8 @@
+ /* Log sequence number at shutdown */
+ dulint                srv_shutdown_lsn;
++dulint                srv_oldest_lsn;
++
+ #ifdef HAVE_DARWIN_THREADS
+ # include <sys/utsname.h>
+ ibool         srv_have_fullfsync = FALSE;
+@@ -547,7 +549,7 @@
  #ifndef UNIV_HOTBACKUP
  /*************************************************************************
  Creates or opens the log files and closes them. */
  ulint
  open_or_create_log_file(
  /*====================*/
-@@ -693,7 +693,7 @@
-
+@@ -693,7 +695,7 @@
  /*************************************************************************
  Creates or opens database data files and closes them. */
 -static
  ulint
  open_or_create_data_files(
  /*======================*/
---- /dev/null  2006-03-28 14:00:37.000000000 +0300
-+++ mysql-5.0.75/innobase/xtrabackup/Makefile  2009-03-02 17:54:29.089780153 +0200
-@@ -0,0 +1,32 @@
-+LIBS= -lpthread -lrt
-+DEFS= -DUNIV_LINUX -DMYSQL_SERVER
-+
-+#x86_32
-+CFLAGS=       -O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2
-+
-+#5.0
-+INC=  -I. -I.. -I./../include -I./../../include
-+INNODBOBJS=   ../usr/libusr.a ../srv/libsrv.a ../dict/libdict.a ../que/libque.a\
-+              ../srv/libsrv.a ../ibuf/libibuf.a ../row/librow.a ../pars/libpars.a\
-+              ../btr/libbtr.a ../trx/libtrx.a ../read/libread.a ../usr/libusr.a\
-+              ../buf/libbuf.a ../ibuf/libibuf.a ../eval/libeval.a ../log/liblog.a\
-+              ../fsp/libfsp.a ../fut/libfut.a ../fil/libfil.a ../lock/liblock.a\
-+              ../mtr/libmtr.a ../page/libpage.a ../rem/librem.a ../thr/libthr.a\
-+              ../sync/libsync.a ../data/libdata.a ../mach/libmach.a ../ha/libha.a\
-+              ../dyn/libdyn.a ../mem/libmem.a ../sync/libsync.a ../ut/libut.a\
-+              ../os/libos.a ../ut/libut.a
-+MYSQLOBJS=    ../../mysys/libmysys.a ../../strings/libmystrings.a
-+
-+.SUFFIXES: .o .c
-+
-+.c.o:
-+      $(CC) $(CFLAGS) $(INC) $(DEFS) -c $*.c
-+
-+all: xtrabackup
-+
-+xtrabackup : xtrabackup.o $(INNODBOBJS) $(MYSQLOBJS)
-+      $(CC) xtrabackup.o $(INNODBOBJS) $(MYSQLOBJS) $(LIBS) -o xtrabackup
-+
-+clean:
-+      rm -f *.o xtrabackup
-+
---- /dev/null  2006-03-28 14:00:37.000000000 +0300
-+++ mysql-5.0.75/innobase/xtrabackup/xtrabackup.c      2009-03-02 17:54:29.086446549 +0200
-@@ -0,0 +1,1969 @@
-+#define XTRABACKUP_VERSION "prototype-0.0"
-+
-+//#define XTRABACKUP_TARGET_IS_PLUGIN
-+
-+#include <my_base.h>
-+#include <my_getopt.h>
-+#include <mysql_version.h>
-+
-+#include <univ.i>
-+#include <os0file.h>
-+#include <os0thread.h>
-+#include <srv0start.h>
-+#include <srv0srv.h>
-+#include <trx0roll.h>
-+#include <trx0trx.h>
-+#include <trx0sys.h>
-+#include <mtr0mtr.h>
-+#include <row0ins.h>
-+#include <row0mysql.h>
-+#include <row0sel.h>
-+#include <row0upd.h>
-+#include <log0log.h>
-+#include <lock0lock.h>
-+#include <dict0crea.h>
-+#include <btr0cur.h>
-+#include <btr0btr.h>
-+#include <fsp0fsp.h>
-+#include <sync0sync.h>
-+#include <fil0fil.h>
-+#include <trx0xa.h>
-+
-+/* ==start === definition at fil0fil.c === */
-+
-+/* File node of a tablespace or the log data space */
-+struct fil_node_struct {
-+        fil_space_t*    space;  /* backpointer to the space where this node
-+                                belongs */
-+        char*           name;   /* path to the file */
-+        ibool           open;   /* TRUE if file open */
-+        os_file_t       handle; /* OS handle to the file, if file open */
-+        ibool           is_raw_disk;/* TRUE if the 'file' is actually a raw
-+                                device or a raw disk partition */
-+        ulint           size;   /* size of the file in database pages, 0 if
-+                                not known yet; the possible last incomplete
-+                                megabyte may be ignored if space == 0 */
-+        ulint           n_pending;
-+                                /* count of pending i/o's on this file;
-+                                closing of the file is not allowed if
-+                                this is > 0 */
-+        ulint           n_pending_flushes;
-+                                /* count of pending flushes on this file;
-+                                closing of the file is not allowed if
-+                                this is > 0 */
-+        ib_longlong     modification_counter;/* when we write to the file we
-+                                increment this by one */
-+        ib_longlong     flush_counter;/* up to what modification_counter value
-+                                we have flushed the modifications to disk */
-+        UT_LIST_NODE_T(fil_node_t) chain;
-+                                /* link field for the file chain */
-+        UT_LIST_NODE_T(fil_node_t) LRU;
-+                                /* link field for the LRU list */
-+        ulint           magic_n;
-+};
-+
-+struct fil_space_struct {
-+        char*           name;   /* space name = the path to the first file in
-+                                it */
-+        ulint           id;     /* space id */
-+        ib_longlong     tablespace_version;
-+                                /* in DISCARD/IMPORT this timestamp is used to
-+                                check if we should ignore an insert buffer
-+                                merge request for a page because it actually
-+                                was for the previous incarnation of the
-+                                space */
-+        ibool           mark;   /* this is set to TRUE at database startup if
-+                                the space corresponds to a table in the InnoDB
-+                                data dictionary; so we can print a warning of
-+                                orphaned tablespaces */
-+        ibool           stop_ios;/* TRUE if we want to rename the .ibd file of
-+                                tablespace and want to stop temporarily
-+                                posting of new i/o requests on the file */
-+        ibool           stop_ibuf_merges;
-+                                /* we set this TRUE when we start deleting a
-+                                single-table tablespace */
-+        ibool           is_being_deleted;
-+                                /* this is set to TRUE when we start
-+                                deleting a single-table tablespace and its
-+                                file; when this flag is set no further i/o
-+                                or flush requests can be placed on this space,
-+                                though there may be such requests still being
-+                                processed on this space */
-+        ulint           purpose;/* FIL_TABLESPACE, FIL_LOG, or FIL_ARCH_LOG */
-+        UT_LIST_BASE_NODE_T(fil_node_t) chain;
-+                                /* base node for the file chain */
-+        ulint           size;   /* space size in pages; 0 if a single-table
-+                                tablespace whose size we do not know yet;
-+                                last incomplete megabytes in data files may be
-+                                ignored if space == 0 */
-+        ulint           n_reserved_extents;
-+                                /* number of reserved free extents for
-+                                ongoing operations like B-tree page split */
-+        ulint           n_pending_flushes; /* this is > 0 when flushing
-+                                the tablespace to disk; dropping of the
-+                                tablespace is forbidden if this is > 0 */
-+        ulint           n_pending_ibuf_merges;/* this is > 0 when merging
-+                                insert buffer entries to a page so that we
-+                                may need to access the ibuf bitmap page in the
-+                                tablespade: dropping of the tablespace is
-+                                forbidden if this is > 0 */
-+        hash_node_t     hash;   /* hash chain node */
-+        hash_node_t     name_hash;/* hash chain the name_hash table */
-+        rw_lock_t       latch;  /* latch protecting the file space storage
-+                                allocation */
-+        UT_LIST_NODE_T(fil_space_t) unflushed_spaces;
-+                                /* list of spaces with at least one unflushed
-+                                file we have written to */
-+        ibool           is_in_unflushed_spaces; /* TRUE if this space is
-+                                currently in the list above */
-+        UT_LIST_NODE_T(fil_space_t) space_list;
-+                                /* list of all spaces */
-+        ibuf_data_t*    ibuf_data;
-+                                /* insert buffer data */
-+        ulint           magic_n;
-+};
-+typedef struct fil_system_struct        fil_system_t;
-+struct fil_system_struct {
-+        mutex_t         mutex;          /* The mutex protecting the cache */
-+        hash_table_t*   spaces;         /* The hash table of spaces in the
-+                                        system; they are hashed on the space
-+                                        id */
-+        hash_table_t*   name_hash;      /* hash table based on the space
-+                                        name */
-+        UT_LIST_BASE_NODE_T(fil_node_t) LRU;
-+                                        /* base node for the LRU list of the
-+                                        most recently used open files with no
-+                                        pending i/o's; if we start an i/o on
-+                                        the file, we first remove it from this
-+                                        list, and return it to the start of
-+                                        the list when the i/o ends;
-+                                        log files and the system tablespace are
-+                                        not put to this list: they are opened
-+                                        after the startup, and kept open until
-+                                        shutdown */
-+        UT_LIST_BASE_NODE_T(fil_space_t) unflushed_spaces;
-+                                        /* base node for the list of those
-+                                        tablespaces whose files contain
-+                                        unflushed writes; those spaces have
-+                                        at least one file node where
-+                                        modification_counter > flush_counter */
-+        ulint           n_open;         /* number of files currently open */
-+        ulint           max_n_open;     /* n_open is not allowed to exceed
-+                                        this */
-+        ib_longlong     modification_counter;/* when we write to a file we
-+                                        increment this by one */
-+        ulint           max_assigned_id;/* maximum space id in the existing
-+                                        tables, or assigned during the time
-+                                        mysqld has been up; at an InnoDB
-+                                        startup we scan the data dictionary
-+                                        and set here the maximum of the
-+                                        space id's of the tables there */
-+        ib_longlong     tablespace_version;
-+                                        /* a counter which is incremented for
-+                                        every space object memory creation;
-+                                        every space mem object gets a
-+                                        'timestamp' from this; in DISCARD/
-+                                        IMPORT this is used to check if we
-+                                        should ignore an insert buffer merge
-+                                        request */
-+        UT_LIST_BASE_NODE_T(fil_space_t) space_list;
-+                                        /* list of all file spaces */
-+};
-+extern fil_system_t*   fil_system;
-+
-+/* ==end=== definition  at fil0fil.c === */
-+
-+
-+bool innodb_inited= 0;
-+
-+/* === xtrabackup specific options === */
-+char xtrabackup_real_target_dir[FN_REFLEN] = "./xtrabackup_backupfiles/";
-+char *xtrabackup_target_dir= xtrabackup_real_target_dir;
-+my_bool xtrabackup_backup = FALSE;
-+my_bool xtrabackup_prepare = FALSE;
-+
-+my_bool xtrabackup_suspend_at_end = FALSE;
-+longlong xtrabackup_use_memory = 8*1024*1024L;
-+
-+long xtrabackup_throttle = 0; /* 0:unlimited */
-+my_bool xtrabackup_stream = FALSE;
-+
-+static ulint          n[SRV_MAX_N_IO_THREADS + 5];
-+static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 5];
-+
-+dulint checkpoint_lsn_start;
-+dulint checkpoint_no_start;
-+dulint log_copy_scanned_lsn;
-+ib_longlong log_copy_offset = 0;
-+ibool log_copying = TRUE;
-+ibool log_copying_running = FALSE;
-+ibool log_copying_succeed = FALSE;
-+
-+/* === sharing with thread === */
-+os_file_t       dst_log = -1;
-+char            dst_log_path[FN_REFLEN];
-+
-+/* === some variables from mysqld === */
-+char mysql_real_data_home[FN_REFLEN] = "./";
-+char *mysql_data_home= mysql_real_data_home;
-+static char mysql_data_home_buff[2];
-+
-+char *opt_mysql_tmpdir = NULL;
-+MY_TMPDIR mysql_tmpdir_list;
-+
-+/* === static parameters in ha_innodb.cc */
-+
-+#define HA_INNOBASE_ROWS_IN_TABLE 10000 /* to get optimization right */
-+#define HA_INNOBASE_RANGE_COUNT         100
-+
-+ulong         innobase_large_page_size = 0;
-+
-+/* The default values for the following, type long or longlong, start-up
-+parameters are declared in mysqld.cc: */
-+
-+long innobase_additional_mem_pool_size = 1*1024*1024L;
-+long innobase_buffer_pool_awe_mem_mb = 0;
-+long innobase_file_io_threads = 4;
-+long innobase_force_recovery = 0;
-+long innobase_lock_wait_timeout = 50;
-+long innobase_log_buffer_size = 1024*1024L;
-+long innobase_log_files_in_group = 2;
-+long innobase_mirrored_log_groups = 1;
-+long innobase_open_files = 300L;
-+
-+longlong innobase_buffer_pool_size = 8*1024*1024L;
-+longlong innobase_log_file_size = 5*1024*1024L;
-+
-+/* The default values for the following char* start-up parameters
-+are determined in innobase_init below: */
-+
-+char* innobase_data_home_dir                  = NULL;
-+char* innobase_data_file_path                 = NULL;
-+char* innobase_log_group_home_dir             = NULL;
-+char* innobase_log_arch_dir                   = NULL;/* unused */
-+/* The following has a misleading name: starting from 4.0.5, this also
-+affects Windows: */
-+char* innobase_unix_file_flush_method         = NULL;
-+
-+/* Below we have boolean-valued start-up parameters, and their default
-+values */
-+
-+ulong innobase_fast_shutdown                  = 0;
-+my_bool innobase_log_archive                  = FALSE;/* unused */
-+my_bool innobase_use_doublewrite    = TRUE;
-+my_bool innobase_use_checksums      = TRUE;
-+my_bool innobase_use_large_pages    = FALSE;
-+my_bool       innobase_use_native_aio                 = FALSE;
-+my_bool       innobase_file_per_table                 = FALSE;
-+my_bool innobase_locks_unsafe_for_binlog        = FALSE;
-+my_bool innobase_rollback_on_timeout          = FALSE;
-+my_bool innobase_create_status_file           = FALSE;
-+my_bool innobase_adaptive_hash_index          = TRUE;
-+
-+static char *internal_innobase_data_file_path = NULL;
-+
-+/* The following counter is used to convey information to InnoDB
-+about server activity: in selects it is not sensible to call
-+srv_active_wake_master_thread after each fetch or search, we only do
-+it every INNOBASE_WAKE_INTERVAL'th step. */
-+
-+#define INNOBASE_WAKE_INTERVAL        32
-+ulong innobase_active_counter = 0;
-+
-+
-+/* ======== for option and variables ======== */
-+
-+enum options_xtrabackup
-+{
-+  OPT_XTRA_TARGET_DIR=256,
-+  OPT_XTRA_BACKUP,
-+  OPT_XTRA_PREPARE,
-+  OPT_XTRA_SUSPEND_AT_END,
-+  OPT_XTRA_USE_MEMORY,
-+  OPT_XTRA_THROTTLE,
-+  OPT_XTRA_STREAM,
-+  OPT_INNODB_CHECKSUMS,
-+  OPT_INNODB_DATA_FILE_PATH,
-+  OPT_INNODB_DATA_HOME_DIR,
-+  OPT_INNODB_ADAPTIVE_HASH_INDEX,
-+  OPT_INNODB_DOUBLEWRITE,
-+  OPT_INNODB_FAST_SHUTDOWN,
-+  OPT_INNODB_FILE_PER_TABLE,
-+  OPT_INNODB_FLUSH_LOG_AT_TRX_COMMIT,
-+  OPT_INNODB_FLUSH_METHOD,
-+  OPT_INNODB_LOCKS_UNSAFE_FOR_BINLOG,
-+  OPT_INNODB_LOG_ARCH_DIR,
-+  OPT_INNODB_LOG_ARCHIVE,
-+  OPT_INNODB_LOG_GROUP_HOME_DIR,
-+  OPT_INNODB_MAX_DIRTY_PAGES_PCT,
-+  OPT_INNODB_MAX_PURGE_LAG,
-+  OPT_INNODB_ROLLBACK_ON_TIMEOUT,
-+  OPT_INNODB_STATUS_FILE,
-+  OPT_INNODB_ADDITIONAL_MEM_POOL_SIZE,
-+  OPT_INNODB_AUTOEXTEND_INCREMENT,
-+  OPT_INNODB_BUFFER_POOL_SIZE,
-+  OPT_INNODB_COMMIT_CONCURRENCY,
-+  OPT_INNODB_CONCURRENCY_TICKETS,
-+  OPT_INNODB_FILE_IO_THREADS,
-+  OPT_INNODB_FORCE_RECOVERY,
-+  OPT_INNODB_LOCK_WAIT_TIMEOUT,
-+  OPT_INNODB_LOG_BUFFER_SIZE,
-+  OPT_INNODB_LOG_FILE_SIZE,
-+  OPT_INNODB_LOG_FILES_IN_GROUP,
-+  OPT_INNODB_MIRRORED_LOG_GROUPS,
-+  OPT_INNODB_OPEN_FILES,
-+  OPT_INNODB_SYNC_SPIN_LOOPS,
-+  OPT_INNODB_THREAD_CONCURRENCY,
-+  OPT_INNODB_THREAD_SLEEP_DELAY
-+};
-+
-+static struct my_option my_long_options[] =
-+{
-+  {"target-dir", OPT_XTRA_TARGET_DIR, "destination directory", (gptr*) &xtrabackup_target_dir,
-+   (gptr*) &xtrabackup_target_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-+  {"backup", OPT_XTRA_BACKUP, "take backup to target-dir",
-+   (gptr*) &xtrabackup_backup, (gptr*) &xtrabackup_backup,
-+   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-+  {"prepare", OPT_XTRA_PREPARE, "prepare a backup for starting mysql server on the backup.",
-+   (gptr*) &xtrabackup_prepare, (gptr*) &xtrabackup_prepare,
-+   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-+  {"use-memory", OPT_XTRA_USE_MEMORY, "** nothing for now (planned to use instead of buffer_pool_size) **",
-+   (gptr*) &xtrabackup_use_memory, (gptr*) &xtrabackup_use_memory,
-+   0, GET_LL, REQUIRED_ARG, 8*1024*1024L, 1024*1024L, LONGLONG_MAX, 0,
-+   1024*1024L, 0},
-+  {"suspend-at-end", OPT_XTRA_SUSPEND_AT_END, "creates a file 'xtrabackup_suspended' and waits until the user deletes that file at the end of '--backup'",
-+   (gptr*) &xtrabackup_suspend_at_end, (gptr*) &xtrabackup_suspend_at_end,
-+   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-+  {"throttle", OPT_XTRA_THROTTLE, "limit count of IO operations per second to IOS values",
-+   (gptr*) &xtrabackup_throttle, (gptr*) &xtrabackup_throttle,
-+   0, GET_LONG, REQUIRED_ARG, 0, 0, LONG_MAX, 0, 1, 0},
-+  {"stream", OPT_XTRA_STREAM, "** nothing for now **",
-+   (gptr*) &xtrabackup_stream, (gptr*) &xtrabackup_stream,
-+   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-+
-+  {"datadir", 'h', "Path to the database root.", (gptr*) &mysql_data_home,
-+   (gptr*) &mysql_data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-+  {"tmpdir", 't',
-+   "Path for temporary files. Several paths may be specified, separated by a "
-+#if defined(__WIN__) || defined(OS2) || defined(__NETWARE__)
-+   "semicolon (;)"
-+#else
-+   "colon (:)"
-+#endif
-+   ", in this case they are used in a round-robin fashion.",
-+   (gptr*) &opt_mysql_tmpdir,
-+   (gptr*) &opt_mysql_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-+
-+  {"innodb_adaptive_hash_index", OPT_INNODB_ADAPTIVE_HASH_INDEX,
-+   "Enable InnoDB adaptive hash index (enabled by default).  "
-+   "Disable with --skip-innodb-adaptive-hash-index.",
-+   (gptr*) &innobase_adaptive_hash_index,
-+   (gptr*) &innobase_adaptive_hash_index,
-+   0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
-+  {"innodb_additional_mem_pool_size", OPT_INNODB_ADDITIONAL_MEM_POOL_SIZE,
-+   "Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.",
-+   (gptr*) &innobase_additional_mem_pool_size,
-+   (gptr*) &innobase_additional_mem_pool_size, 0, GET_LONG, REQUIRED_ARG,
-+   1*1024*1024L, 512*1024L, LONG_MAX, 0, 1024, 0},
-+  {"innodb_autoextend_increment", OPT_INNODB_AUTOEXTEND_INCREMENT,
-+   "Data file autoextend increment in megabytes",
-+   (gptr*) &srv_auto_extend_increment,
-+   (gptr*) &srv_auto_extend_increment,
-+   0, GET_ULONG, REQUIRED_ARG, 8L, 1L, 1000L, 0, 1L, 0},
-+  {"innodb_buffer_pool_size", OPT_INNODB_BUFFER_POOL_SIZE,
-+   "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
-+   (gptr*) &innobase_buffer_pool_size, (gptr*) &innobase_buffer_pool_size, 0,
-+   GET_LL, REQUIRED_ARG, 8*1024*1024L, 1024*1024L, LONGLONG_MAX, 0,
-+   1024*1024L, 0},
-+  {"innodb_checksums", OPT_INNODB_CHECKSUMS, "Enable InnoDB checksums validation (enabled by default). \
-+Disable with --skip-innodb-checksums.", (gptr*) &innobase_use_checksums,
-+   (gptr*) &innobase_use_checksums, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
-+/*
-+  {"innodb_commit_concurrency", OPT_INNODB_COMMIT_CONCURRENCY,
-+   "Helps in performance tuning in heavily concurrent environments.",
-+   (gptr*) &srv_commit_concurrency, (gptr*) &srv_commit_concurrency,
-+   0, GET_ULONG, REQUIRED_ARG, 0, 0, 1000, 0, 1, 0},
-+*/
-+/*
-+  {"innodb_concurrency_tickets", OPT_INNODB_CONCURRENCY_TICKETS,
-+   "Number of times a thread is allowed to enter InnoDB within the same \
-+    SQL query after it has once got the ticket",
-+   (gptr*) &srv_n_free_tickets_to_enter,
-+   (gptr*) &srv_n_free_tickets_to_enter,
-+   0, GET_ULONG, REQUIRED_ARG, 500L, 1L, ULONG_MAX, 0, 1L, 0},
-+*/
-+  {"innodb_data_file_path", OPT_INNODB_DATA_FILE_PATH,
-+   "Path to individual files and their sizes.", (gptr*) &innobase_data_file_path,
-+   (gptr*) &innobase_data_file_path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-+  {"innodb_data_home_dir", OPT_INNODB_DATA_HOME_DIR,
-+   "The common part for InnoDB table spaces.", (gptr*) &innobase_data_home_dir,
-+   (gptr*) &innobase_data_home_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0,
-+   0},
-+  {"innodb_doublewrite", OPT_INNODB_DOUBLEWRITE, "Enable InnoDB doublewrite buffer (enabled by default). \
-+Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
-+   (gptr*) &innobase_use_doublewrite, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
-+/*
-+  {"innodb_fast_shutdown", OPT_INNODB_FAST_SHUTDOWN,
-+   "Speeds up the shutdown process of the InnoDB storage engine. Possible "
-+   "values are 0, 1 (faster)"
-+   " or 2 (fastest - crash-like)"
-+   ".",
-+   (gptr*) &innobase_fast_shutdown,
-+   (gptr*) &innobase_fast_shutdown, 0, GET_ULONG, OPT_ARG, 1, 0,
-+   2, 0, 0, 0},
-+*/
-+  {"innodb_file_io_threads", OPT_INNODB_FILE_IO_THREADS,
-+   "Number of file I/O threads in InnoDB.", (gptr*) &innobase_file_io_threads,
-+   (gptr*) &innobase_file_io_threads, 0, GET_LONG, REQUIRED_ARG, 4, 4, 64, 0,
-+   1, 0},
-+  {"innodb_file_per_table", OPT_INNODB_FILE_PER_TABLE,
-+   "Stores each InnoDB table to an .ibd file in the database dir.",
-+   (gptr*) &innobase_file_per_table,
-+   (gptr*) &innobase_file_per_table, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-+  {"innodb_flush_log_at_trx_commit", OPT_INNODB_FLUSH_LOG_AT_TRX_COMMIT,
-+   "Set to 0 (write and flush once per second), 1 (write and flush at each commit) or 2 (write at commit, flush once per second).",
-+   (gptr*) &srv_flush_log_at_trx_commit,
-+   (gptr*) &srv_flush_log_at_trx_commit,
-+   0, GET_ULONG, OPT_ARG,  1, 0, 2, 0, 0, 0},
-+  {"innodb_flush_method", OPT_INNODB_FLUSH_METHOD,
-+   "With which method to flush data.", (gptr*) &innobase_unix_file_flush_method,
-+   (gptr*) &innobase_unix_file_flush_method, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
-+   0, 0, 0},
-+
-+/* ####### Should we use this option? ####### */
-+  {"innodb_force_recovery", OPT_INNODB_FORCE_RECOVERY,
-+   "Helps to save your data in case the disk image of the database becomes corrupt.",
-+   (gptr*) &innobase_force_recovery, (gptr*) &innobase_force_recovery, 0,
-+   GET_LONG, REQUIRED_ARG, 0, 0, 6, 0, 1, 0},
-+
-+  {"innodb_lock_wait_timeout", OPT_INNODB_LOCK_WAIT_TIMEOUT,
-+   "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back.",
-+   (gptr*) &innobase_lock_wait_timeout, (gptr*) &innobase_lock_wait_timeout,
-+   0, GET_LONG, REQUIRED_ARG, 50, 1, 1024 * 1024 * 1024, 0, 1, 0},
-+/*
-+  {"innodb_locks_unsafe_for_binlog", OPT_INNODB_LOCKS_UNSAFE_FOR_BINLOG,
-+   "Force InnoDB not to use next-key locking. Instead use only row-level locking",
-+   (gptr*) &innobase_locks_unsafe_for_binlog,
-+   (gptr*) &innobase_locks_unsafe_for_binlog, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-+*/
-+/*
-+  {"innodb_log_arch_dir", OPT_INNODB_LOG_ARCH_DIR,
-+   "Where full logs should be archived.", (gptr*) &innobase_log_arch_dir,
-+   (gptr*) &innobase_log_arch_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-+*/
-+  {"innodb_log_buffer_size", OPT_INNODB_LOG_BUFFER_SIZE,
-+   "The size of the buffer which InnoDB uses to write log to the log files on disk.",
-+   (gptr*) &innobase_log_buffer_size, (gptr*) &innobase_log_buffer_size, 0,
-+   GET_LONG, REQUIRED_ARG, 1024*1024L, 256*1024L, LONG_MAX, 0, 1024, 0},
-+  {"innodb_log_file_size", OPT_INNODB_LOG_FILE_SIZE,
-+   "Size of each log file in a log group.",
-+   (gptr*) &innobase_log_file_size, (gptr*) &innobase_log_file_size, 0,
-+   GET_LL, REQUIRED_ARG, 5*1024*1024L, 1*1024*1024L, LONGLONG_MAX, 0,
-+   1024*1024L, 0},
-+  {"innodb_log_files_in_group", OPT_INNODB_LOG_FILES_IN_GROUP,
-+   "Number of log files in the log group. InnoDB writes to the files in a circular fashion. Value 3 is recommended here.",
-+   (gptr*) &innobase_log_files_in_group, (gptr*) &innobase_log_files_in_group,
-+   0, GET_LONG, REQUIRED_ARG, 2, 2, 100, 0, 1, 0},
-+  {"innodb_log_group_home_dir", OPT_INNODB_LOG_GROUP_HOME_DIR,
-+   "Path to InnoDB log files.", (gptr*) &innobase_log_group_home_dir,
-+   (gptr*) &innobase_log_group_home_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
-+   0, 0},
-+  {"innodb_max_dirty_pages_pct", OPT_INNODB_MAX_DIRTY_PAGES_PCT,
-+   "Percentage of dirty pages allowed in bufferpool.", (gptr*) &srv_max_buf_pool_modified_pct,
-+   (gptr*) &srv_max_buf_pool_modified_pct, 0, GET_ULONG, REQUIRED_ARG, 90, 0, 100, 0, 0, 0},
-+/*
-+  {"innodb_max_purge_lag", OPT_INNODB_MAX_PURGE_LAG,
-+   "Desired maximum length of the purge queue (0 = no limit)",
-+   (gptr*) &srv_max_purge_lag,
-+   (gptr*) &srv_max_purge_lag, 0, GET_ULONG, REQUIRED_ARG, 0, 0, ULONG_MAX,
-+   0, 1L, 0},
-+*/
-+/*
-+  {"innodb_mirrored_log_groups", OPT_INNODB_MIRRORED_LOG_GROUPS,
-+   "Number of identical copies of log groups we keep for the database. Currently this should be set to 1.",
-+   (gptr*) &innobase_mirrored_log_groups,
-+   (gptr*) &innobase_mirrored_log_groups, 0, GET_LONG, REQUIRED_ARG, 1, 1, 10,
-+   0, 1, 0},
-+*/
-+  {"innodb_open_files", OPT_INNODB_OPEN_FILES,
-+   "How many files at the maximum InnoDB keeps open at the same time.",
-+   (gptr*) &innobase_open_files, (gptr*) &innobase_open_files, 0,
-+   GET_LONG, REQUIRED_ARG, 300L, 10L, LONG_MAX, 0, 1L, 0},
-+/*
-+  {"innodb_rollback_on_timeout", OPT_INNODB_ROLLBACK_ON_TIMEOUT,
-+   "Roll back the complete transaction on lock wait timeout, for 4.x compatibility (disabled by default)",
-+   (gptr*) &innobase_rollback_on_timeout, (gptr*) &innobase_rollback_on_timeout,
-+   0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
-+*/
-+/*
-+  {"innodb_status_file", OPT_INNODB_STATUS_FILE,
-+   "Enable SHOW INNODB STATUS output in the innodb_status.<pid> file",
-+   (gptr*) &innobase_create_status_file, (gptr*) &innobase_create_status_file,
-+   0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
-+*/
-+/*
-+  {"innodb_sync_spin_loops", OPT_INNODB_SYNC_SPIN_LOOPS,
-+   "Count of spin-loop rounds in InnoDB mutexes",
-+   (gptr*) &srv_n_spin_wait_rounds,
-+   (gptr*) &srv_n_spin_wait_rounds,
-+   0, GET_ULONG, REQUIRED_ARG, 20L, 0L, ULONG_MAX, 0, 1L, 0},
-+*/
-+/*
-+  {"innodb_thread_concurrency", OPT_INNODB_THREAD_CONCURRENCY,
-+   "Helps in performance tuning in heavily concurrent environments. "
-+   "Sets the maximum number of threads allowed inside InnoDB. Value 0"
-+   " will disable the thread throttling.",
-+   (gptr*) &srv_thread_concurrency, (gptr*) &srv_thread_concurrency,
-+   0, GET_ULONG, REQUIRED_ARG, 8, 0, 1000, 0, 1, 0},
-+*/
-+/*
-+  {"innodb_thread_sleep_delay", OPT_INNODB_THREAD_SLEEP_DELAY,
-+   "Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0"
-+    " disable a sleep",
-+   (gptr*) &srv_thread_sleep_delay,
-+   (gptr*) &srv_thread_sleep_delay,
-+   0, GET_ULONG, REQUIRED_ARG, 10000L, 0L, ULONG_MAX, 0, 1L, 0},
-+*/
-+
-+  { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
-+};
-+
-+static const char *load_default_groups[]= { "mysqld","xtrabackup",0 };
-+
-+static void print_version(void)
-+{
-+  printf("%s  Ver %s for %s %s (%s)\n" ,my_progname,
-+        XTRABACKUP_VERSION, MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
-+}
-+
-+static void usage(void)
-+{
-+  print_version();
-+  puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
-+
-+  printf("Usage: [%s --backup | %s --prepare] [OPTIONS]\n",my_progname,my_progname);
-+  print_defaults("my",load_default_groups);
-+  my_print_help(my_long_options);
-+  my_print_variables(my_long_options);
-+}
-+
-+static my_bool
-+get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
-+             char *argument)
-+{
-+  switch(optid) {
-+  case 'h':
-+    strmake(mysql_real_data_home,argument, sizeof(mysql_real_data_home)-1);
-+    mysql_data_home= mysql_real_data_home;
-+    break;
-+  case OPT_XTRA_TARGET_DIR:
-+    strmake(xtrabackup_real_target_dir,argument, sizeof(xtrabackup_real_target_dir)-1);
-+    xtrabackup_target_dir= xtrabackup_real_target_dir;
-+    break;
-+  case '?':
-+    usage();
-+    exit(0);
-+    break;
-+  default:
-+    break;
-+  }
-+  return 0;
-+}
-+
-+/* ================ Dummys =================== */
-+
-+void
-+innobase_mysql_prepare_print_arbitrary_thd(void)
-+{
-+//fprintf(stderr, "innobase_mysql_prepare_print_arbitrary_thd() is called\n");
-+}
-+
-+void
-+innobase_mysql_end_print_arbitrary_thd(void)
-+{
-+//fprintf(stderr, "innobase_mysql_end_print_arbitrary_thd() is called\n");
-+}
-+
-+void
-+innobase_mysql_print_thd(
-+      FILE*   f,              
-+      void*   input_thd,
-+      uint    max_query_len)
-+{
-+      fprintf(stderr, "innobase_mysql_print_thd() is called\n");
-+      exit(1);
-+}
-+
-+void
-+innobase_get_cset_width(
-+      ulint   cset,
-+      ulint*  mbminlen,
-+      ulint*  mbmaxlen)
-+{
-+      CHARSET_INFO*   cs;
-+      ut_ad(cset < 256);
-+      ut_ad(mbminlen);
-+      ut_ad(mbmaxlen);
-+
-+      cs = all_charsets[cset];
-+      if (cs) {
-+              *mbminlen = cs->mbminlen;
-+              *mbmaxlen = cs->mbmaxlen;
-+      } else {
-+              ut_a(cset == 0);
-+              *mbminlen = *mbmaxlen = 0;
-+      }
-+}
-+
-+int
-+innobase_strcasecmp(
-+      const char*     a,
-+      const char*     b)
-+{
-+      return(my_strcasecmp(&my_charset_utf8_general_ci, a, b));
-+}
-+
-+void
-+innobase_casedn_str(
-+      char*   a)
-+{
-+      fprintf(stderr, "innobase_casedn_str() is called\n");
-+      exit(1);
-+}
-+
-+int
-+innobase_mysql_tmpfile(void)
-+{
-+      char    filename[FN_REFLEN];
-+      int     fd2 = -1;
-+      File    fd = create_temp_file(filename, my_tmpdir(&mysql_tmpdir_list), "ib",
-+#ifdef __WIN__
-+                              O_BINARY | O_TRUNC | O_SEQUENTIAL |
-+                              O_TEMPORARY | O_SHORT_LIVED |
-+#endif /* __WIN__ */
-+                              O_CREAT | O_EXCL | O_RDWR,
-+                              MYF(MY_WME));
-+      if (fd >= 0) {
-+#ifndef __WIN__
-+              /* On Windows, open files cannot be removed, but files can be
-+              created with the O_TEMPORARY flag to the same effect
-+              ("delete on close"). */
-+              unlink(filename);
-+#endif /* !__WIN__ */
-+              /* Copy the file descriptor, so that the additional resources
-+              allocated by create_temp_file() can be freed by invoking
-+              my_close().
-+
-+              Because the file descriptor returned by this function
-+              will be passed to fdopen(), it will be closed by invoking
-+              fclose(), which in turn will invoke close() instead of
-+              my_close(). */
-+              fd2 = dup(fd);
-+              if (fd2 < 0) {
-+                      fprintf(stderr, "Got error %d on dup",fd2);
-+                }
-+              my_close(fd, MYF(MY_WME));
-+      }
-+      return(fd2);
-+}
-+
-+void
-+innobase_invalidate_query_cache(
-+      trx_t*  trx,
-+      char*   full_name,
-+      ulint   full_name_len)
-+{
-+      fprintf(stderr, "innobase_invalidate_query_cache() is called\n");
-+      exit(1);
-+}
-+
-+int
-+mysql_get_identifier_quote_char(
-+      trx_t*          trx,
-+      const char*     name,
-+      ulint           namelen)
-+{
-+      fprintf(stderr, "mysql_get_identifier_quote_char() is called\n");
-+      exit(1);
-+}
-+
-+ibool
-+trx_is_interrupted(
-+      trx_t*  trx)
-+{
-+      fprintf(stderr, "trx_is_interrupted() is called\n");
-+      exit(1);
-+}
-+
-+void*
-+innobase_current_thd(void)
-+{
-+      fprintf(stderr, "innobase_current_thd() is called\n");
-+      exit(1);
-+}
-+
-+int
-+innobase_mysql_cmp(
-+      int             mysql_type,
-+      uint            charset_number,
-+      unsigned char*  a,
-+      unsigned int    a_length,
-+      unsigned char*  b,
-+      unsigned int    b_length)
-+{
-+      fprintf(stderr, "innobase_mysql_cmp() is called\n");
-+      exit(1);
-+}
-+
-+ulint
-+innobase_get_at_most_n_mbchars(
-+      ulint charset_id,
-+      ulint prefix_len,
-+      ulint data_len,
-+      const char* str)
-+{
-+      fprintf(stderr, "innobase_get_at_most_n_mbchars() is called\n");
-+      exit(1);
-+}
-+
-+ibool
-+innobase_query_is_update(void)
-+{
-+      fprintf(stderr, "innobase_query_is_update() is called\n");
-+      exit(1);
-+}
-+
-+/* control innodb */
-+
-+bool
-+innodb_init_param(void)
-+{
-+      /* === some variables from mysqld === */
-+      bzero((gptr) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list));
-+
-+      if (init_tmpdir(&mysql_tmpdir_list, opt_mysql_tmpdir))
-+              exit(1);
-+
-+      /* dummy for initialize all_charsets[] */
-+      get_charset_name(0);
-+
-+
-+      /* innobase_init */
-+
-+      static char     current_dir[3];         /* Set if using current lib */
-+      int             err;
-+      bool            ret;
-+      char            *default_path;
-+
-+      /* Check that values don't overflow on 32-bit systems. */
-+      if (sizeof(ulint) == 4) {
-+              if (innobase_buffer_pool_size > UINT_MAX32) {
-+                      fprintf(stderr,
-+                              "innobase_buffer_pool_size can't be over 4GB"
-+                              " on 32-bit systems");
-+
-+                      goto error;
-+              }
-+
-+              if (innobase_log_file_size > UINT_MAX32) {
-+                      fprintf(stderr,
-+                              "innobase_log_file_size can't be over 4GB"
-+                              " on 32-bit systems");
-+
-+                      goto error;
-+              }
-+      }
-+
-+      os_innodb_umask = (ulint)0664;
-+
-+      /* First calculate the default path for innodb_data_home_dir etc.,
-+      in case the user has not given any value.
-+
-+      Note that when using the embedded server, the datadirectory is not
-+      necessarily the current directory of this program. */
-+
-+              /* It's better to use current lib, to keep paths short */
-+              current_dir[0] = FN_CURLIB;
-+              current_dir[1] = FN_LIBCHAR;
-+              current_dir[2] = 0;
-+              default_path = current_dir;
-+
-+      ut_a(default_path);
-+
-+//    if (specialflag & SPECIAL_NO_PRIOR) {
-+              srv_set_thread_priorities = FALSE;
-+//    } else {
-+//            srv_set_thread_priorities = TRUE;
-+//            srv_query_thread_priority = QUERY_PRIOR;
-+//    }
-+
-+      /* Set InnoDB initialization parameters according to the values
-+      read from MySQL .cnf file */
-+
-+      /*--------------- Data files -------------------------*/
-+
-+      /* The default dir for data files is the datadir of MySQL */
-+
-+      srv_data_home = (innobase_data_home_dir ? innobase_data_home_dir :
-+                       default_path);
-+
-+      /* Set default InnoDB data file size to 10 MB and let it be
-+      auto-extending. Thus users can use InnoDB in >= 4.0 without having
-+      to specify any startup options. */
-+
-+      if (!innobase_data_file_path) {
-+              innobase_data_file_path = (char*) "ibdata1:10M:autoextend";
-+      }
-+
-+      /* Since InnoDB edits the argument in the next call, we make another
-+      copy of it: */
-+
-+      internal_innobase_data_file_path = strdup(innobase_data_file_path);
-+
-+      ret = (bool) srv_parse_data_file_paths_and_sizes(
-+                              internal_innobase_data_file_path,
-+                              &srv_data_file_names,
-+                              &srv_data_file_sizes,
-+                              &srv_data_file_is_raw_partition,
-+                              &srv_n_data_files,
-+                              &srv_auto_extend_last_data_file,
-+                              &srv_last_file_size_max);
-+      if (ret == FALSE) {
-+              fprintf(stderr,
-+                      "InnoDB: syntax error in innodb_data_file_path");
-+              free(internal_innobase_data_file_path);
-+                goto error;
-+      }
-+
-+      /* -------------- Log files ---------------------------*/
-+
-+      /* The default dir for log files is the datadir of MySQL */
-+
-+      if (!innobase_log_group_home_dir) {
-+              innobase_log_group_home_dir = default_path;
-+      }
-+
-+#ifdef UNIV_LOG_ARCHIVE
-+      /* Since innodb_log_arch_dir has no relevance under MySQL,
-+      starting from 4.0.6 we always set it the same as
-+      innodb_log_group_home_dir: */
-+
-+      innobase_log_arch_dir = innobase_log_group_home_dir;
-+
-+      srv_arch_dir = innobase_log_arch_dir;
-+#endif /* UNIG_LOG_ARCHIVE */
-+
-+      ret = (bool)
-+              srv_parse_log_group_home_dirs(innobase_log_group_home_dir,
-+                                              &srv_log_group_home_dirs);
-+
-+      if (ret == FALSE || innobase_mirrored_log_groups != 1) {
-+        fprintf(stderr, "syntax error in innodb_log_group_home_dir, or a "
-+                        "wrong number of mirrored log groups");
-+
-+              free(internal_innobase_data_file_path);
-+                goto error;
-+      }
-+
-+      /* --------------------------------------------------*/
-+
-+      srv_file_flush_method_str = innobase_unix_file_flush_method;
-+
-+      srv_n_log_groups = (ulint) innobase_mirrored_log_groups;
-+      srv_n_log_files = (ulint) innobase_log_files_in_group;
-+      srv_log_file_size = (ulint) innobase_log_file_size;
-+
-+#ifdef UNIV_LOG_ARCHIVE
-+      srv_log_archive_on = (ulint) innobase_log_archive;
-+#endif /* UNIV_LOG_ARCHIVE */
-+      srv_log_buffer_size = (ulint) innobase_log_buffer_size;
-+
-+        /* We set srv_pool_size here in units of 1 kB. InnoDB internally
-+        changes the value so that it becomes the number of database pages. */
-+
-+        if (innobase_buffer_pool_awe_mem_mb == 0) {
-+                /* Careful here: we first convert the signed long int to ulint
-+                and only after that divide */
-+
-+                srv_pool_size = ((ulint) innobase_buffer_pool_size) / 1024;
-+        } else {
-+                srv_use_awe = TRUE;
-+                srv_pool_size = (ulint)
-+                                (1024 * innobase_buffer_pool_awe_mem_mb);
-+                srv_awe_window_size = (ulint) innobase_buffer_pool_size;
-+
-+                /* Note that what the user specified as
-+                innodb_buffer_pool_size is actually the AWE memory window
-+                size in this case, and the real buffer pool size is
-+                determined by .._awe_mem_mb. */
-+        }
-+
-+      srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size;
-+
-+      srv_n_file_io_threads = (ulint) innobase_file_io_threads;
-+
-+      srv_lock_wait_timeout = (ulint) innobase_lock_wait_timeout;
-+      srv_force_recovery = (ulint) innobase_force_recovery;
-+
-+      srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
-+      srv_use_checksums = (ibool) innobase_use_checksums;
-+
-+      srv_use_adaptive_hash_indexes = (ibool) innobase_adaptive_hash_index;
-+
-+      os_use_large_pages = (ibool) innobase_use_large_pages;
-+      os_large_page_size = (ulint) innobase_large_page_size;
-+
-+      row_rollback_on_timeout = (ibool) innobase_rollback_on_timeout;
-+
-+      srv_file_per_table = (ibool) innobase_file_per_table;
-+        srv_locks_unsafe_for_binlog = (ibool) innobase_locks_unsafe_for_binlog;
-+
-+      srv_max_n_open_files = (ulint) innobase_open_files;
-+      srv_innodb_status = (ibool) innobase_create_status_file;
-+
-+      srv_print_verbose_log = 1;
-+
-+      /* Store the default charset-collation number of this MySQL
-+      installation */
-+
-+      /* We cannot treat characterset here for now!! */
-+      data_mysql_default_charset_coll = (ulint)default_charset_info->number;
-+
-+      ut_a(DATA_MYSQL_LATIN1_SWEDISH_CHARSET_COLL ==
-+                                      my_charset_latin1.number);
-+      ut_a(DATA_MYSQL_BINARY_CHARSET_COLL == my_charset_bin.number);
-+
-+      /* Store the latin1_swedish_ci character ordering table to InnoDB. For
-+      non-latin1_swedish_ci charsets we use the MySQL comparison functions,
-+      and consequently we do not need to know the ordering internally in
-+      InnoDB. */
-+
-+      ut_a(0 == strcmp((char*)my_charset_latin1.name,
-+                                              (char*)"latin1_swedish_ci"));
-+      memcpy(srv_latin1_ordering, my_charset_latin1.sort_order, 256);
-+
-+      /* Since we in this module access directly the fields of a trx
-+        struct, and due to different headers and flags it might happen that
-+      mutex_t has a different size in this module and in InnoDB
-+      modules, we check at run time that the size is the same in
-+      these compilation modules. */
-+
-+      srv_sizeof_trx_t_in_ha_innodb_cc = sizeof(trx_t);
-+
-+      return(FALSE);
-+
-+error:
-+      fprintf(stderr, "innodb_init_param(): Error occured.\n");
-+      return(TRUE);
-+}
-+
-+bool
-+innodb_init(void)
-+{
-+      int     err;
-+
-+      err = innobase_start_or_create_for_mysql();
-+
-+      if (err != DB_SUCCESS) {
-+              free(internal_innobase_data_file_path);
-+                goto error;
-+      }
-+
-+      /* They may not be needed for now */
-+//    (void) hash_init(&innobase_open_tables,system_charset_info, 32, 0, 0,
-+//                                    (hash_get_key) innobase_get_key, 0, 0);
-+//        pthread_mutex_init(&innobase_share_mutex, MY_MUTEX_INIT_FAST);
-+//        pthread_mutex_init(&prepare_commit_mutex, MY_MUTEX_INIT_FAST);
-+//        pthread_mutex_init(&commit_threads_m, MY_MUTEX_INIT_FAST);
-+//        pthread_mutex_init(&commit_cond_m, MY_MUTEX_INIT_FAST);
-+//        pthread_cond_init(&commit_cond, NULL);
-+
-+      innodb_inited= 1;
-+
-+      return(FALSE);
-+
-+error:
-+      fprintf(stderr, "innodb_init(): Error occured.\n");
-+      return(TRUE);
-+}
-+
-+bool
-+innodb_end(void)
-+{
-+      srv_fast_shutdown = (ulint) innobase_fast_shutdown;
-+      innodb_inited = 0;
-+      if (innobase_shutdown_for_mysql() != DB_SUCCESS) {
-+              goto error;
-+      }
-+      free(internal_innobase_data_file_path);
-+
-+      /* They may not be needed for now */
-+//    hash_free(&innobase_open_tables);
-+//    pthread_mutex_destroy(&innobase_share_mutex);
-+//    pthread_mutex_destroy(&prepare_commit_mutex);
-+//    pthread_mutex_destroy(&commit_threads_m);
-+//    pthread_mutex_destroy(&commit_cond_m);
-+//    pthread_cond_destroy(&commit_cond);
-+
-+      return(FALSE);
-+
-+error:
-+      fprintf(stderr, "innodb_end(): Error occured.\n");
-+      return(TRUE);
-+}
-+
-+
-+/* ================= backup ================= */
-+
-+/* TODO: We may tune the behavior (e.g. by fil_aio)*/
-+#define COPY_CHUNK 64
-+
-+bool
-+xtrabackup_copy_datafile(fil_node_t* node)
-+{
-+      os_file_t       src_file = -1;
-+      os_file_t       dst_file = -1;
-+      char    dst_path[FN_REFLEN];
-+      ibool           success;
-+      byte*           page;
-+      byte*           buf2 = NULL;
-+      dulint          flush_lsn;
-+      ulint           space_id;
-+      ib_longlong     file_size;
-+      ib_longlong     offset;
-+
-+
-+      sprintf(dst_path, "%s%s", xtrabackup_target_dir, strstr(node->name, "/"));
-+
-+      /* open src_file*/
-+      if (!node->open) {
-+              src_file = os_file_create_simple_no_error_handling(
-+                                              node->name, OS_FILE_OPEN,
-+                                              OS_FILE_READ_ONLY, &success);
-+              if (!success) {
-+                      /* The following call prints an error message */
-+                      os_file_get_last_error(TRUE);
-+
-+                      ut_print_timestamp(stderr);
-+
+@@ -1213,12 +1215,12 @@
+       if (!os_aio_use_native_aio) {
+               /* In simulated aio we currently have use only for 4 threads */
+-              srv_n_file_io_threads = 4;
++              /*srv_n_file_io_threads = 4;*/
+               os_aio_init(8 * SRV_N_PENDING_IOS_PER_THREAD
+                                               * srv_n_file_io_threads,
+                                       srv_n_file_io_threads,
+-                                      SRV_MAX_N_PENDING_SYNC_IOS);
++                                      SRV_MAX_N_PENDING_SYNC_IOS * 8);
+       } else {
+               os_aio_init(SRV_N_PENDING_IOS_PER_THREAD
+                                               * srv_n_file_io_threads,
+@@ -1275,7 +1277,7 @@
+       }
+ #endif /* UNIV_LOG_ARCHIVE */
+-      if (srv_n_log_files * srv_log_file_size >= 262144) {
++      if (sizeof(ulint) == 4 && srv_n_log_files * srv_log_file_size >= 262144) {
+               fprintf(stderr,
+               "InnoDB: Error: combined size of log files must be < 4 GB\n");
+@@ -1609,7 +1611,18 @@
+       if (srv_auto_extend_last_data_file
+               && sum_of_data_file_sizes < tablespace_size_in_header) {
++              /* extend table space size aligning with header */
++              ulint   actual_size;
++              fil_extend_space_to_desired_size(&actual_size, 0, tablespace_size_in_header);
++              if (actual_size < tablespace_size_in_header) {
 +                      fprintf(stderr,
-+"  InnoDB: Fatal error: cannot open %s\n."
-+"InnoDB: Have you deleted .ibd files under a running mysqld server?\n",
-+                              node->name);
-+                      exit(1);
-+              }
-+      } else {
-+              src_file = node->handle;
-+      }
-+
-+      /* open dst_file */
-+      dst_file = os_file_create(dst_path, OS_FILE_OVERWRITE,
-+                                      OS_FILE_AIO, OS_DATA_FILE, &success);
-+                if (!success) {
-+                        /* The following call prints an error message */
-+                        os_file_get_last_error(TRUE);
-+
-+                        ut_print_timestamp(stderr);
-+
-+                        fprintf(stderr,
-+"  InnoDB: error: cannot open %s\n.",
-+                                dst_path);
-+                        exit(1);
-+                }
-+
-+      /* copy : TODO: tune later */
-+      printf("Copying %s \n     to %s\n", node->name, dst_path);
-+
-+      buf2 = ut_malloc((COPY_CHUNK + 1) * UNIV_PAGE_SIZE);
-+      page = ut_align(buf2, UNIV_PAGE_SIZE);
-+
-+      success = os_file_read(src_file, page, 0, 0, UNIV_PAGE_SIZE);
-+      if (!success) {
-+              goto error;
-+      }
-+      flush_lsn = mach_read_from_8(page + FIL_PAGE_FILE_FLUSH_LSN);
-+              /* check current flush lsn newer than checkpoint@start */
-+//    if (ut_dulint_cmp(backup_start_checkpoint, flush_lsn) >= 0) {
-+//            goto error;
-+//    }
-+      space_id = fsp_header_get_space_id(page);
-+
-+      file_size = os_file_get_size_as_iblonglong(src_file);
-+
-+      for (offset = 0; offset < file_size; offset += COPY_CHUNK * UNIV_PAGE_SIZE) {
-+              ulint chunk;
-+copy_loop:
-+              if (file_size - offset > COPY_CHUNK * UNIV_PAGE_SIZE) {
-+                      chunk = COPY_CHUNK * UNIV_PAGE_SIZE;
-+              } else {
-+                      chunk = (ulint)(file_size - offset);
-+              }
-+
-+              success = os_file_read(src_file, page,
-+                              (ulint)(offset & 0xFFFFFFFFUL),
-+                              (ulint)(offset >> 32), chunk);
-+              if (!success) {
-+                      goto error;
-+              }
-+
-+              success = os_file_write(dst_path, dst_file, page,
-+                      (ulint)(offset & 0xFFFFFFFFUL),
-+                      (ulint)(offset >> 32), chunk);
-+              if (!success) {
-+                      goto error;
++"InnoDB: Warning: To extend tablespace size aligning with header seems to be failed.\n"
++"InnoDB: The acutual size %lu must be larger than %lu.\n",
++                              (ulong) actual_size,
++                              (ulong) tablespace_size_in_header);
 +              }
-+
-+      }
-+
-+      success = os_file_flush(dst_file);
-+      if (!success) {
-+              goto error;
-+      }
-+
-+
-+      /* check size again */
-+      /* TODO: but is it needed ?? */
-+      if (file_size < os_file_get_size_as_iblonglong(src_file)) {
-+              offset -= COPY_CHUNK * UNIV_PAGE_SIZE;
-+              file_size = os_file_get_size_as_iblonglong(src_file);
-+              goto copy_loop;
-+      }
-+
-+      /* TODO: How should we treat double_write_buffer here? */
-+      /* (currently, don't care about...) */
-+
-+      /* close */
-+      printf("        ...done\n");
-+      os_file_close(src_file);
-+      os_file_close(dst_file);
-+      ut_free(buf2);
-+      return(FALSE);
-+error:
-+      if (!src_file == -1)
-+              os_file_close(src_file);
-+      if (!dst_file == -1)
-+              os_file_close(dst_file);
-+      if (buf2)
-+              ut_free(buf2);
-+      fprintf(stderr, "Error: xtrabackup_copy_datafile() failed.");
-+      return(TRUE); /*ERROR*/
-+}
-+
-+/* TODO: make this function background thread */
-+bool
-+xtrabackup_copy_logfile(dulint from_lsn)
-+{
-+      char    path[FN_REFLEN];
-+      char    *ptr1, *ptr2;
-+
-+        fil_system_t*   system = fil_system;
-+        fil_space_t*    space;
-+      fil_space_t*    last_src;
-+        fil_node_t*     node;
-+
-+      /* definition from recv_recovery_from_checkpoint_start() */
-+      log_group_t*    group;
-+      log_group_t*    max_cp_group;
-+      log_group_t*    up_to_date_group;
-+      ulint           max_cp_field;
-+      dulint          checkpoint_lsn;
-+      dulint          checkpoint_no;
-+      dulint          old_scanned_lsn;
-+      dulint          group_scanned_lsn;
-+      dulint          contiguous_lsn;
-+      dulint          archived_lsn;
-+      ulint           capacity;
-+      byte*           buf;
-+      byte            log_hdr_buf[LOG_FILE_HDR_SIZE];
-+      ulint           err;
-+
-+      ibool           success;
-+
-+      ut_a(dst_log != -1);
-+
-+      /* read from checkpoint_lsn_start to current */
-+      contiguous_lsn = ut_dulint_align_down(from_lsn,
-+                                              OS_FILE_LOG_BLOCK_SIZE);
-+
-+      /* TODO: We must check the contiguous_lsn still exists in log file.. */
-+
-+      group = UT_LIST_GET_FIRST(log_sys->log_groups);
-+
-+      while (group) {
-+              ibool   finished;
-+              dulint  start_lsn;
-+              dulint  end_lsn;
-+
-+
-+              old_scanned_lsn = from_lsn;
-+
-+/*            recv_group_scan_log_recs(group, &contiguous_lsn,
-+                                                      &group_scanned_lsn);
-+*/
-+      finished = FALSE;
-+
-+      start_lsn = contiguous_lsn;
-+              
-+      while (!finished) {                     
-+              end_lsn = ut_dulint_add(start_lsn, RECV_SCAN_SIZE);
-+
-+              log_group_read_log_seg(LOG_RECOVER, log_sys->buf,
-+                                              group, start_lsn, end_lsn);
-+
-+              printf("log read from (%lu %lu) to (%lu %lu)\n",
-+                      start_lsn.high, start_lsn.low, end_lsn.high, end_lsn.low);
-+
-+//            finished = recv_scan_log_recs(TRUE,
-+//                                (buf_pool->n_frames
-+//                                - recv_n_pool_free_frames) * UNIV_PAGE_SIZE,
-+//                            TRUE, log_sys->buf,
-+//                            RECV_SCAN_SIZE, start_lsn,
-+//                            &contiguous_lsn, &group_scanned_lsn);
-+              {
-+      byte*   log_block;
-+      ulint   no;
-+      dulint  scanned_lsn;
-+      ulint   data_len;
-+      ibool   more_data;
-+
-+      ulint   scanned_checkpoint_no = 0;
-+
-+      finished = FALSE;
-+      
-+      log_block = log_sys->buf;
-+      scanned_lsn = start_lsn;
-+      more_data = FALSE;
-+
-+      while (log_block < log_sys->buf + RECV_SCAN_SIZE && !finished) {
-+
-+              no = log_block_get_hdr_no(log_block);
-+
-+              if (no != log_block_convert_lsn_to_no(scanned_lsn)
-+                  || !log_block_checksum_is_ok_or_old_format(log_block)) {
-+
-+                      if (no == log_block_convert_lsn_to_no(scanned_lsn)
-+                          && !log_block_checksum_is_ok_or_old_format(
-+                                                              log_block)) {
-+                              fprintf(stderr,
-+"InnoDB: Log block no %lu at lsn %lu %lu has\n"
-+"InnoDB: ok header, but checksum field contains %lu, should be %lu\n",
-+                              (ulong) no,
-+                              (ulong) ut_dulint_get_high(scanned_lsn),
-+                              (ulong) ut_dulint_get_low(scanned_lsn),
-+                              (ulong) log_block_get_checksum(log_block),
-+                              (ulong) log_block_calc_checksum(log_block));
-+                      }
-+
-+                      /* Garbage or an incompletely written log block */
-+
-+                      finished = TRUE;
-+
-+                      break;
-+              }
-+
-+              if (log_block_get_flush_bit(log_block)) {
-+                      /* This block was a start of a log flush operation:
-+                      we know that the previous flush operation must have
-+                      been completed for all log groups before this block
-+                      can have been flushed to any of the groups. Therefore,
-+                      we know that log data is contiguous up to scanned_lsn
-+                      in all non-corrupt log groups. */
-+
-+                      if (ut_dulint_cmp(scanned_lsn, contiguous_lsn) > 0) {
-+                              contiguous_lsn = scanned_lsn;
-+                      }
-+              }
-+
-+              data_len = log_block_get_data_len(log_block);
-+
-+              if (
-+                  (scanned_checkpoint_no > 0)
-+                  && (log_block_get_checkpoint_no(log_block)
-+                     < scanned_checkpoint_no)
-+                  && (scanned_checkpoint_no
-+                      - log_block_get_checkpoint_no(log_block)
-+                      > 0x80000000UL)) {
-+
-+                      /* Garbage from a log buffer flush which was made
-+                      before the most recent database recovery */
-+
-+                      finished = TRUE;
-+                      break;
-+              }                   
-+
-+              scanned_lsn = ut_dulint_add(scanned_lsn, data_len);
-+              scanned_checkpoint_no = log_block_get_checkpoint_no(log_block);
-+
-+              if (data_len < OS_FILE_LOG_BLOCK_SIZE) {
-+                      /* Log data for this group ends here */
-+
-+                      finished = TRUE;
-+              } else {
-+                      log_block += OS_FILE_LOG_BLOCK_SIZE;
-+              }
-+      } /* while (log_block < log_sys->buf + RECV_SCAN_SIZE && !finished) */
-+
-+      group_scanned_lsn = scanned_lsn;
-+
-+
-+
-+              }
-+
-+              /* ===== write log to 'xtrabackup_logfile' ====== */
-+              {
-+              ulint write_size;
-+
-+              if (!finished) {
-+                      write_size = RECV_SCAN_SIZE;
-+              } else {
-+                      write_size = ut_dulint_minus(
-+                                      ut_dulint_align_up(group_scanned_lsn, OS_FILE_LOG_BLOCK_SIZE),
-+                                      start_lsn);
-+              }
-+
-+              printf("Wrinting offset= %lld, size= %lu\n", log_copy_offset, write_size);
-+
-+              success = os_file_write(dst_log_path, dst_log, log_sys->buf,
-+                              (ulint)(log_copy_offset & 0xFFFFFFFFUL),
-+                              (ulint)(log_copy_offset >> 32), write_size);
-+              log_copy_offset += write_size;
-+
-+              if (finished) {
-+                      /* if continue, it will start from align_down(group_scanned_lsn) */
-+                      log_copy_offset -= OS_FILE_LOG_BLOCK_SIZE;
-+              }
-+
-+              if(!success) {
-+                      fprintf(stderr, "Error: os_file_write to %s\n", dst_log_path);
-+                      goto error;
-+              }
-+
-+
-+              }
-+
-+
-+
-+
-+
-+              start_lsn = end_lsn;
-+      }
-+
-+
-+
-+              group->scanned_lsn = group_scanned_lsn;
-+              
-+              if (ut_dulint_cmp(old_scanned_lsn, group_scanned_lsn) < 0) {
-+                      /* We found a more up-to-date group */
-+
-+                      up_to_date_group = group;
-+              }
-+
-+              printf("scanned_lsn (%lu %lu)\n",group->scanned_lsn.high,group->scanned_lsn.low);
-+
-+              group = UT_LIST_GET_NEXT(log_groups, group);
-+
-+              /* update global variable*/
-+              log_copy_scanned_lsn = group_scanned_lsn;
-+
-+              /* innodb_mirrored_log_groups must be 1, no other groups */
-+              ut_a(group == NULL);
-+      }
-+
-+
-+      success = os_file_flush(dst_log);
-+      if(!success) {
-+              goto error;
-+      }
-+
-+      /* close it later (end of the thread) */
-+      //os_file_close(dst_log);
-+
-+      return(FALSE);
-+
-+error:
-+      os_file_close(dst_log);
-+      return(TRUE);
-+}
-+
-+/* copying logfile in background */
-+#define SLEEPING_PERIOD 5
-+
-+static
-+#ifndef __WIN__
-+void*
-+#else
-+ulint
++#ifdef UNDEFINED
+               fprintf(stderr,
+ "InnoDB: Error: tablespace size stored in header is %lu pages, but\n"
+ "InnoDB: the sum of data file sizes is only %lu pages\n",
+@@ -1627,6 +1640,7 @@
+                       return(DB_ERROR);
+               }
 +#endif
-+log_copying_thread(
-+      void*   arg)
-+{
-+      log_copying_running = TRUE;
-+
-+      while(log_copying) {
-+              sleep(SLEEPING_PERIOD);
-+
-+              if(xtrabackup_copy_logfile(log_copy_scanned_lsn))
-+                      goto end;
-+      }
-+
-+      log_copying_succeed = TRUE;
-+end:
-+      log_copying_running = FALSE;
-+      os_thread_exit(NULL);
-+}
-+
-+
-+/************************************************************************
-+I/o-handler thread function. */
-+static
-+
-+#ifndef __WIN__
-+void*
-+#else
-+ulint
-+#endif
-+io_handler_thread(
-+/*==============*/
-+      void*   arg)
-+{
-+      ulint   segment;
-+      ulint   i;
-+      
-+      segment = *((ulint*)arg);
-+
-+#ifdef UNIV_DEBUG_THREAD_CREATION
-+      fprintf(stderr, "Io handler thread %lu starts, id %lu\n", segment,
-+                      os_thread_pf(os_thread_get_curr_id()));
-+#endif
-+      for (i = 0;; i++) {
-+              fil_aio_wait(segment);
-+      }
-+
-+      /* We count the number of threads in os_thread_exit(). A created
-+      thread should always use that to exit and not use return() to exit.
-+      The thread actually never comes here because it is exited in an
-+      os_event_wait(). */
-+
-+      os_thread_exit(NULL);
-+
-+#ifndef __WIN__
-+      return(NULL);                           /* Not reached */
-+#else
-+      return(0);
-+#endif
-+}
-+
-+/* CAUTION: Don't rename file_per_table during backup */
-+void
-+xtrabackup_backup_func(void)
-+{
-+      MY_STAT stat_info;
-+
-+      /* cd to datadir */
-+
-+      if (my_setwd(mysql_real_data_home,MYF(MY_WME)))
-+      {
-+              fprintf(stderr, "cannot my_setwd %s\n", mysql_real_data_home);
-+              exit(1);
-+      }
-+      mysql_data_home= mysql_data_home_buff;
-+      mysql_data_home[0]=FN_CURLIB;           // all paths are relative from here
-+      mysql_data_home[1]=0;
-+
-+      /* initialize components */
-+        if(innodb_init_param())
-+                exit(1);
-+
-+        if (srv_pool_size >= 1000 * 1024) {
-+                                  /* Here we still have srv_pool_size counted
-+                                  in kilobytes (in 4.0 this was in bytes)
-+                                srv_boot() converts the value to
-+                                  pages; if buffer pool is less than 1000 MB,
-+                                  assume fewer threads. */
-+                srv_max_n_threads = 50000;
-+
-+        } else if (srv_pool_size >= 8 * 1024) {
-+
-+                srv_max_n_threads = 10000;
-+        } else {
-+              srv_max_n_threads = 1000;       /* saves several MB of memory,
-+                                                especially in 64-bit
-+                                                computers */
-+        }
-+
-+      {
-+      ulint   n;
-+      ulint   i;
-+
-+      n = srv_n_data_files;
-+      
-+      for (i = 0; i < n; i++) {
-+              srv_data_file_sizes[i] = srv_data_file_sizes[i]
-+                                      * ((1024 * 1024) / UNIV_PAGE_SIZE);
-+      }               
-+
-+      srv_last_file_size_max = srv_last_file_size_max
-+                                      * ((1024 * 1024) / UNIV_PAGE_SIZE);
-+              
-+      srv_log_file_size = srv_log_file_size / UNIV_PAGE_SIZE;
-+
-+      srv_log_buffer_size = srv_log_buffer_size / UNIV_PAGE_SIZE;
-+
-+      srv_pool_size = srv_pool_size / (UNIV_PAGE_SIZE / 1024);
-+
-+      srv_awe_window_size = srv_awe_window_size / UNIV_PAGE_SIZE;
-+      
-+      if (srv_use_awe) {
-+              /* If we are using AWE we must save memory in the 32-bit
-+              address space of the process, and cannot bind the lock
-+              table size to the real buffer pool size. */
-+
-+              srv_lock_table_size = 20 * srv_awe_window_size;
-+      } else {
-+              srv_lock_table_size = 5 * srv_pool_size;
-+      }
-+      }
-+
-+      srv_general_init();
-+
-+      {
-+      buf_pool_t*     ret;
-+      ibool   create_new_db;
-+      ibool   log_file_created;
-+      ibool   log_created     = FALSE;
-+      ibool   log_opened      = FALSE;
-+      dulint  min_flushed_lsn;
-+      dulint  max_flushed_lsn;
-+      ulint   sum_of_new_sizes;
-+      ulint   sum_of_data_file_sizes;
-+      ulint   tablespace_size_in_header;
-+      ulint   err;
-+      ulint   i;
-+      ibool   srv_file_per_table_original_value  = srv_file_per_table;
-+      mtr_t   mtr;
-+
-+
-+
-+
-+#define SRV_N_PENDING_IOS_PER_THREAD  OS_AIO_N_PENDING_IOS_PER_THREAD
-+#define SRV_MAX_N_PENDING_SYNC_IOS    100
-+                os_aio_init(8 * SRV_N_PENDING_IOS_PER_THREAD
-+                            * srv_n_file_io_threads,
-+                            srv_n_file_io_threads,
-+                            SRV_MAX_N_PENDING_SYNC_IOS);
-+
-+      fil_init(srv_max_n_open_files);
-+
-+      fsp_init();
-+      log_init();
-+
-+      lock_sys_create(srv_lock_table_size);
-+
-+      for (i = 0; i < srv_n_file_io_threads; i++) {
-+              n[i] = i;
-+
-+              os_thread_create(io_handler_thread, n + i, thread_ids + i);
-+      }
-+
-+      err = open_or_create_data_files(&create_new_db,
-+                                      &min_flushed_lsn, &max_flushed_lsn,
-+                                      &sum_of_new_sizes);
-+      if (err != DB_SUCCESS) {
-+              fprintf(stderr,
-+"InnoDB: Could not open or create data files.\n"
-+"InnoDB: If you tried to add new data files, and it failed here,\n"
-+"InnoDB: you should now edit innodb_data_file_path in my.cnf back\n"
-+"InnoDB: to what it was, and remove the new ibdata files InnoDB created\n"
-+"InnoDB: in this failed attempt. InnoDB only wrote those files full of\n"
-+"InnoDB: zeros, but did not yet use them in any way. But be careful: do not\n"
-+"InnoDB: remove old data files which contain your precious data!\n");
-+
-+              //return((int) err);
-+              exit(1);
-+      }
-+
-+      /* create_new_db must not be TRUE.. */
-+      if (create_new_db) {
-+              fprintf(stderr, "InnoDB: Something wrong with source files...\n");
-+              exit(1);
-+      }
-+
-+      for (i = 0; i < srv_n_log_files; i++) {
-+              err = open_or_create_log_file(create_new_db, &log_file_created,
-+                                                           log_opened, 0, i);
-+              if (err != DB_SUCCESS) {
-+
-+                      //return((int) err);
-+                      exit(1);
-+              }
-+
-+              if (log_file_created) {
-+                      log_created = TRUE;
-+              } else {
-+                      log_opened = TRUE;
-+              }
-+              if ((log_opened && create_new_db)
-+                                      || (log_opened && log_created)) {
-+                      fprintf(stderr, 
-+      "InnoDB: Error: all log files must be created at the same time.\n"
-+      "InnoDB: All log files must be created also in database creation.\n"
-+      "InnoDB: If you want bigger or smaller log files, shut down the\n"
-+      "InnoDB: database and make sure there were no errors in shutdown.\n"
-+      "InnoDB: Then delete the existing log files. Edit the .cnf file\n"
-+      "InnoDB: and start the database again.\n");
-+
-+                      //return(DB_ERROR);
-+                      exit(1);
-+              }
-+      }
-+
-+      /* log_file_created must not be TRUE, if online */
-+      if (log_file_created) {
-+              fprintf(stderr, "InnoDB: Something wrong with source files...\n");
-+              exit(1);
-+      }
-+
-+      fil_load_single_table_tablespaces();
-+
-+      }
-+
-+      /* create target dir if not exist */
-+      if (!my_stat(xtrabackup_target_dir,&stat_info,MYF(0))
-+              && (my_mkdir(xtrabackup_target_dir,0777,MYF(0)) < 0)){
-+              fprintf(stderr,"Error: cannot mkdir %d: %s\n",my_errno,xtrabackup_target_dir);
-+              exit(1);
-+      }
-+
-+
-+        {
-+      char    path[FN_REFLEN];
-+      char    *ptr1, *ptr2;
-+
-+        fil_system_t*   system = fil_system;
-+        fil_space_t*    space;
-+      fil_space_t*    last_src;
-+        fil_node_t*     node;
-+
-+      /* definition from recv_recovery_from_checkpoint_start() */
-+      log_group_t*    group;
-+      log_group_t*    max_cp_group;
-+      log_group_t*    up_to_date_group;
-+      ulint           max_cp_field;
-+      dulint          checkpoint_lsn;
-+      dulint          checkpoint_no;
-+      dulint          old_scanned_lsn;
-+      dulint          group_scanned_lsn;
-+      dulint          contiguous_lsn;
-+      dulint          archived_lsn;
-+      ulint           capacity;
-+      byte*           buf;
-+      byte            log_hdr_buf_[LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE];
-+      byte*           log_hdr_buf;
-+      ulint           err;
-+
-+      ibool           success;
-+
-+      log_hdr_buf = ut_align(log_hdr_buf_, OS_FILE_LOG_BLOCK_SIZE);
-+
-+      /* log space */
-+      space = UT_LIST_GET_NEXT(space_list, UT_LIST_GET_FIRST(system->space_list));
-+      printf("space: name=%s, id=%d, purpose=%d, size=%d\n",
-+              space->name, space->id, space->purpose, space->size);
-+
-+      /* get current checkpoint_lsn */
-+      /* Look for the latest checkpoint from any of the log groups */
-+      
-+      err = recv_find_max_checkpoint(&max_cp_group, &max_cp_field);
-+
-+      if (err != DB_SUCCESS) {
-+
-+              exit(1);
-+      }
-+              
-+      log_group_read_checkpoint_info(max_cp_group, max_cp_field);
-+      buf = log_sys->checkpoint_buf;
-+
-+      checkpoint_lsn_start = mach_read_from_8(buf + LOG_CHECKPOINT_LSN);
-+      checkpoint_no_start = mach_read_from_8(buf + LOG_CHECKPOINT_NO);
-+
-+reread_log_header:
-+      fil_io(OS_FILE_READ | OS_FILE_LOG, TRUE, max_cp_group->space_id,
-+                              0, 0, LOG_FILE_HDR_SIZE,
-+                              log_hdr_buf, max_cp_group);
-+
-+      /* check consistency of log file header to copy */
-+        err = recv_find_max_checkpoint(&max_cp_group, &max_cp_field);
-+
-+        if (err != DB_SUCCESS) {
-+
-+                exit(1);
-+        }
-+
-+        log_group_read_checkpoint_info(max_cp_group, max_cp_field);
-+        buf = log_sys->checkpoint_buf;
-+
-+      if(ut_dulint_cmp(checkpoint_no_start,
-+                      mach_read_from_8(buf + LOG_CHECKPOINT_NO)) != 0) {
-+              checkpoint_lsn_start = mach_read_from_8(buf + LOG_CHECKPOINT_LSN);
-+              checkpoint_no_start = mach_read_from_8(buf + LOG_CHECKPOINT_NO);
-+              goto reread_log_header;
-+      }
-+
-+      /* open 'xtrabackup_logfile' */
-+      sprintf(dst_log_path, "%s%s", xtrabackup_target_dir, "/xtrabackup_logfile");
-+      dst_log = os_file_create(dst_log_path, OS_FILE_OVERWRITE,
-+                                      OS_FILE_AIO, OS_LOG_FILE, &success);
-+
-+                if (!success) {
-+                        /* The following call prints an error message */
-+                        os_file_get_last_error(TRUE);
-+
-+                        ut_print_timestamp(stderr);
-+
-+                        fprintf(stderr,
-+"  InnoDB: error: cannot open %s\n.",
-+                                dst_log_path);
-+                        exit(1);
-+                }
-+
-+      success = os_file_write(dst_log_path, dst_log, log_hdr_buf,
-+                      0, 0, LOG_FILE_HDR_SIZE);
-+      log_copy_offset += LOG_FILE_HDR_SIZE;
-+      if (!success) {
-+              if (!dst_log == -1)
-+                      os_file_close(dst_log);
-+              exit(1);
-+      }
-+
-+      /* copy log file by current position */
-+      if(xtrabackup_copy_logfile(checkpoint_lsn_start))
-+              exit(1);
-+
-+
-+      /* start back ground thread to copy newer log */
-+      os_thread_id_t log_copying_thread_id;
-+
-+      log_copying = TRUE;
-+      os_thread_create(log_copying_thread, NULL, &log_copying_thread_id);
-+
-+
-+
-+        //mutex_enter(&(system->mutex)); /* NOTE: It may not needed at "--backup" for now */
-+
-+        space = UT_LIST_GET_FIRST(system->space_list);
-+      last_src = UT_LIST_GET_LAST(system->space_list);
-+
-+        while (space != NULL) {
-+              if (space->purpose == FIL_TABLESPACE) { /* datafile only */
-+
-+                //printf("space: name=%s, id=%d, purpose=%d, size=%d\n",
-+                //        space->name, space->id, space->purpose, space->size);
-+
-+              /* mkdir if not exist */
-+              ptr1 = strstr(space->name, "/");
-+              ptr2 = strstr(ptr1 + 1, "/");
-+              if(ptr2) {
-+                      /* single table space */
-+                      *ptr2 = 0; /* temporary (it's my lazy..)*/
-+                      sprintf(path, "%s%s",xtrabackup_target_dir,ptr1);
-+                      *ptr2 = '/';
-+
-+                      if (!my_stat(path,&stat_info,MYF(0))
-+                              && (my_mkdir(path,0777,MYF(0)) < 0)){
-+
-+                              fprintf(stderr,"Error: cannot mkdir %d: %s\n",my_errno,path);
-+                              exit(1);
-+                      }
-+              }
-+
-+              node = UT_LIST_GET_FIRST(space->chain);
-+                while (node != NULL) {
-+                        //printf("  node: name=%s, open=%d, size=%d\n",
-+                        //       node->name, node->open, node->size);
-+
-+                      /* copy the datafile */
-+                      if(xtrabackup_copy_datafile(node))
-+                              exit(1);
-+
-+                        node = UT_LIST_GET_NEXT(chain, node);
-+                }
-+              }
-+
-+              if (space == last_src)
-+                      break;
-+
-+                space = UT_LIST_GET_NEXT(space_list, space);
-+        }
-+
-+        //mutex_exit(&(system->mutex));
-+        }
-+
-+
-+
-+      /* stop log_copying_thread */
-+      log_copying = FALSE;
-+      printf("Stopping log copying thread");
-+      while (log_copying_running) {
-+              printf(".");
-+              sleep(1);
-+      }
-+      printf("\n");
-+      if (!log_copying_succeed) {
-+              fprintf(stderr, "Error: log_copying_thread failed.");
-+              exit(1);
-+      }
-+
-+        os_file_close(dst_log);
-+
-+        printf("Transaction log of lsn (%lu %lu) to (%lu %lu) was copied.\n",
-+                checkpoint_lsn_start.high, checkpoint_lsn_start.low,
-+                log_copy_scanned_lsn.high, log_copy_scanned_lsn.low);
-+}
-+
-+/* ================= prepare ================= */
-+
-+void
-+xtrabackup_prepare_func(void)
-+{
-+      /* cd to target-dir */
-+
-+      if (my_setwd(xtrabackup_real_target_dir,MYF(MY_WME)))
-+      {
-+              fprintf(stderr, "cannot my_setwd %s\n", xtrabackup_real_target_dir);
-+              exit(1);
-+      }
-+      xtrabackup_target_dir= mysql_data_home_buff;
-+      xtrabackup_target_dir[0]=FN_CURLIB;             // all paths are relative from here
-+      xtrabackup_target_dir[1]=0;
-+
-+
-+      /* TODO: Create logfiles for recovery from 'xtrabackup_logfile', before start InnoDB */
-+
-+
-+      /* check the accessibility of target-dir */
-+      /* ############# TODO ##################### */
-+
-+      if(innodb_init_param())
-+              exit(1);
-+
-+      if(innodb_init())
-+              exit(1);
-+
-+      printf("Hello InnoDB world!\n");
-+
-+      /* TEST: innodb status*/
-+      ulint   trx_list_start = ULINT_UNDEFINED;
-+      ulint   trx_list_end = ULINT_UNDEFINED;
-+      srv_printf_innodb_monitor(stdout, &trx_list_start, &trx_list_end);
-+
-+      /* TEST: list of datafiles and transaction log files and LSN*/
-+      /* ############# TODO ##################### */
-+
-+      {
-+      fil_system_t*   system = fil_system;
-+      fil_space_t*    space;
-+      fil_node_t*     node;
-+
-+        mutex_enter(&(system->mutex));
-+
-+        space = UT_LIST_GET_FIRST(system->space_list);
-+
-+        while (space != NULL) {
-+              /* print info about space */
-+
-+              printf("space: name=%s, id=%d, purpose=%d, size=%d\n",
-+                      space->name, space->id, space->purpose, space->size);
-+
-+                node = UT_LIST_GET_FIRST(space->chain);
-+
-+                while (node != NULL) {
-+                      /* print info about nodes */
-+
-+                      printf("node: name=%s, open=%d, size=%d\n",
-+                              node->name, node->open, node->size);
-+
-+                        node = UT_LIST_GET_NEXT(chain, node);
-+                }
-+                space = UT_LIST_GET_NEXT(space_list, space);
-+        }
-+
-+        mutex_exit(&(system->mutex));
-+      }
-+
-+      if(innodb_end())
-+              exit(1);
-+
-+      printf("################################################\n");
-+      printf("Attention: --prepare is not implemented yet!!!!!\n");
-+      printf("################################################\n");
-+}
-+
-+/* ================= main =================== */
-+
-+int main(int argc, char **argv)
-+{
-+      int ho_error;
-+
-+      MY_INIT(argv[0]);
-+
-+      load_defaults("my",load_default_groups,&argc,&argv);
-+
-+      /* ignore unsupported options */
-+      {
-+      int i,j,argc_new,find;
-+      char *optend, *prev_found;
-+      argc_new = argc;
-+
-+      j=1;
-+      for (i=1 ; i < argc ; i++) {
-+              optend= strcend((argv)[i], '=');
-+              uint count;
-+              struct my_option *opt= (struct my_option *) my_long_options;
-+              for (count= 0; opt->name; opt++) {
-+                      if (!getopt_compare_strings(opt->name, (argv)[i] + 2,
-+                              (uint)(optend - (argv)[i] - 2))) /* match found */
-+                      {
-+                              if (!opt->name[(uint)(optend - (argv)[i] - 2)]) {
-+                                      find = 1;
-+                                      goto next_opt;
-+                              }
-+                              if (!count) {
-+                                      count= 1;
-+                                      prev_found= (char *) opt->name;
-+                              }
-+                              else if (strcmp(prev_found, opt->name)) {
-+                                      count++;
-+                              }
-+                      }
-+              }
-+              find = count;
-+next_opt:
-+              if(!find){
-+                      argc_new--;
-+              } else {
-+                      (argv)[j]=(argv)[i];
-+                      j++;
-+              }
-+      }
-+      argc = argc_new;
-+      }
-+
-+      if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
-+              exit(ho_error);
-+
-+      /* cannot execute both for now */
-+      if (xtrabackup_backup == xtrabackup_prepare) { /* !XOR (for now) */
-+              usage();
-+              exit(-1);
-+      }
-+
-+      /* --backup */
-+      if (xtrabackup_backup)
-+              xtrabackup_backup_func();
-+
-+      /* --prepare */
-+      if (xtrabackup_prepare)
-+              xtrabackup_prepare_func();
-+
-+      exit(0);
-+}
+       }
+       /* Check that os_fast_mutexes work as expected */
+diff -ru a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c
+--- a/innobase/trx/trx0trx.c   2008-12-19 02:19:37.000000000 +0900
++++ b/innobase/trx/trx0trx.c   2009-06-18 09:56:54.000000000 +0900
+@@ -486,8 +486,8 @@
+                                       ut_dulint_get_low(trx->id));
+                                       if (srv_force_recovery == 0) {
+-
+-                                              trx->conc_state = TRX_PREPARED;
++                                              /* xtrabackup should rollback it */
++                                              trx->conc_state = TRX_ACTIVE;
+                                       } else {
+                                               fprintf(stderr,
+ "InnoDB: Since innodb_force_recovery > 0, we will rollback it anyway.\n");
+@@ -555,8 +555,8 @@
+                                           ut_dulint_get_low(trx->id));
+                                           if (srv_force_recovery == 0) {
+-
+-                                              trx->conc_state = TRX_PREPARED;
++                                              /* xtrabackup should rollback it */
++                                              trx->conc_state = TRX_ACTIVE;
+                                           } else {
+                                               fprintf(stderr,
+ "InnoDB: Since innodb_force_recovery > 0, we will rollback it anyway.\n");
index 469fd8b7f218b014493cfd955bfe632a840cac2b..537923df9b7b8a98bcbbebbe71e3bac3e0a11276 100644 (file)
@@ -26,7 +26,7 @@ Summary(uk.UTF-8):    MySQL - швидкий SQL-сервер
 Summary(zh_CN.UTF-8):  MySQL数据库服务器
 Name:          mysql
 Version:       5.0.83
-Release:       1
+Release:       2
 License:       GPL + MySQL FLOSS Exception
 Group:         Applications/Databases
 #Source0:      ftp://ftp.mysql.com/pub/mysql/src/%{name}-%{version}.tar.gz
@@ -34,8 +34,8 @@ Source0:      http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-5.0/%{name}-%{version
 # Source0-md5: 051392064a1e32cca5c23a593908b10e
 #Source0:      http://mysql.he.net/Downloads/MySQL-5.0/%{name}-%{version}.tar.gz
 #Source0:      http://mirror.provenscaling.com/mysql/enterprise/source/5.0/%{name}-%{version}.tar.gz
-Source100:     http://www.sphinxsearch.com/downloads/sphinx-0.9.9-rc1.tar.gz
-# Source100-md5:       d1506c8f85c045bb682393de0aed30e8
+Source100:     http://www.sphinxsearch.com/downloads/sphinx-0.9.9-rc2.tar.gz
+# Source100-md5:       1ca266613bfdb0e6952d9ca1af93f7cc
 Source1:       %{name}.init
 Source2:       %{name}.sysconfig
 Source3:       %{name}.logrotate
@@ -65,25 +65,30 @@ Patch13:    %{name}-bug-34192.patch
 Patch14:       %{name}-bug-16470.patch
 Patch15:       %{name}-system-users.patch
 # <percona patches, http://www.percona.com/percona-lab.html>
-Patch16:       %{name}-microslow_innodb.patch
-Patch17:       %{name}-userstatv2.patch
-Patch18:       %{name}-innodb_io_patches.patch
-Patch19:       %{name}-microsec_process.patch
-Patch20:       %{name}-innodb_show_bp.patch
-Patch21:       %{name}-innodb_locks_held.patch
-Patch22:       %{name}-innodb_io_pattern.patch
-Patch23:       %{name}-innodb_show_hashed_memory.patch
-Patch24:       %{name}-innodb_rw_lock.patch
-Patch25:       %{name}-innodb_fsync_source.patch
-Patch26:       %{name}-show_patches.patch
-Patch27:       %{name}-split_buf_pool_mutex_fixed_optimistic_safe.patch
-Patch28:       %{name}-innodb_check_fragmentation.patch
+Patch16:       %{name}-show_patches.patch
+Patch17:       %{name}-microslow_innodb.patch
+Patch18:       %{name}-profiling_slow.patch
+Patch19:       %{name}-userstatv2.patch
+Patch20:       %{name}-microsec_process.patch
+Patch21:       %{name}-innodb_io_patches.patch
+Patch22:       %{name}-innodb_locks_held.patch
+Patch23:       %{name}-innodb_show_bp.patch
+Patch24:       %{name}-innodb_check_fragmentation.patch
+Patch25:       %{name}-innodb_io_pattern.patch
+Patch26:       %{name}-innodb_fsync_source.patch
+Patch27:       %{name}-innodb_show_hashed_memory.patch
+Patch28:    %{name}-innodb_dict_size_limit.patch
+Patch29:    %{name}-innodb_extra_rseg.patch
+Patch30:    %{name}-innodb_thread_concurrency_timer_based.patch
+Patch31:    %{name}-split_buf_pool_mutex_fixed_optimistic_safe.patch
+Patch32:    %{name}-innodb_rw_lock.patch
+Patch33:    %{name}-mysql-test.patch
 # </percona>
-Patch29:       %{name}-errorlog-no-rename.patch
-Patch30:       %{name}-alpha-stack.patch
-Patch31:       %{name}-xtrabackup.patch
-Patch32:       %{name}-fixes.patch
-Patch33:       %{name}-gcc3.patch
+Patch34:       %{name}-errorlog-no-rename.patch
+Patch35:       %{name}-alpha-stack.patch
+Patch36:       %{name}-xtrabackup.patch
+Patch37:       %{name}-fixes.patch
+Patch38:       %{name}-gcc3.patch
 URL:           http://www.mysql.com/products/database/mysql/community_edition.html
 BuildRequires: autoconf
 BuildRequires: automake
@@ -524,13 +529,18 @@ mv sphinx-*/mysqlse sql/sphinx
 %patch27 -p1
 %patch28 -p1
 %patch29 -p1
-%ifarch alpha
 %patch30 -p1
-%endif
-%{?with_xtrabackup:%patch31 -p1}
+%patch31 -p1
 %patch32 -p1
-%if "%{cxx_version}" < "4.1"
 %patch33 -p1
+%patch34 -p1
+%ifarch alpha
+%patch35 -p1
+%endif
+%{?with_xtrabackup:%patch36 -p1}
+%patch37 -p1
+%if "%{cxx_version}" < "4.1"
+%patch38 -p1
 %endif
 
 %build
This page took 0.441118 seconds and 4 git commands to generate.