[packages/percona-server/v5.0.x: 116/202] - percona patches updated by Eero Hänninen; rel 2

glen glen at pld-linux.org
Wed Oct 21 16:18:46 CEST 2015


commit 45532174ba2819bbcd2da35c772cdda648b13ae9
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Thu Jul 16 13:01:56 2009 +0000

    - percona patches updated by Eero Hänninen; rel 2
    
    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              |   23 +
 mysql-innodb_io_patches.patch |  215 ++--
 mysql-innodb_io_pattern.patch |   14 +-
 mysql-innodb_locks_held.patch |   82 +-
 mysql-innodb_rw_lock.patch    |  421 +++----
 mysql-microsec_process.patch  |   83 +-
 mysql-microslow_innodb.patch  |  596 +++++-----
 mysql-userstatv2.patch        |  961 ++++++++--------
 mysql-xtrabackup.patch        | 2545 +++++++++--------------------------------
 mysql.spec                    |   60 +-
 10 files changed, 1757 insertions(+), 3243 deletions(-)
---
diff --git a/mysql.spec b/mysql.spec
index 469fd8b..537923d 100644
--- a/mysql.spec
+++ b/mysql.spec
@@ -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
diff --git a/mysql-gcc3.patch b/mysql-gcc3.patch
index 08154f5..b49bd0c 100644
--- a/mysql-gcc3.patch
+++ b/mysql-gcc3.patch
@@ -13,3 +13,26 @@
  #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));
+         		}
diff --git a/mysql-innodb_io_patches.patch b/mysql-innodb_io_patches.patch
index 2677ed4..8247a32 100644
--- a/mysql-innodb_io_patches.patch
+++ b/mysql-innodb_io_patches.patch
@@ -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);
diff --git a/mysql-innodb_io_pattern.patch b/mysql-innodb_io_pattern.patch
index 26c9b69..305f63d 100644
--- a/mysql-innodb_io_pattern.patch
+++ b/mysql-innodb_io_pattern.patch
@@ -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;
  }
diff --git a/mysql-innodb_locks_held.patch b/mysql-innodb_locks_held.patch
index a4ae8ab..65ac766 100644
--- a/mysql-innodb_locks_held.patch
+++ b/mysql-innodb_locks_held.patch
@@ -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 at 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},
diff --git a/mysql-innodb_rw_lock.patch b/mysql-innodb_rw_lock.patch
index f7a3166..e45fccd 100644
--- a/mysql-innodb_rw_lock.patch
+++ b/mysql-innodb_rw_lock.patch
@@ -1,159 +1,18 @@
-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
diff --git a/mysql-microsec_process.patch b/mysql-microsec_process.patch
index 0e094e5..2e68888 100644
--- a/mysql-microsec_process.patch
+++ b/mysql-microsec_process.patch
@@ -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 at 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 at percona.com>
-+License=GPL
-+Comment=
-+ChangeLog=
diff --git a/mysql-microslow_innodb.patch b/mysql-microslow_innodb.patch
index 97ec61d..e28f091 100644
--- a/mysql-microslow_innodb.patch
+++ b/mysql-microslow_innodb.patch
@@ -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 at 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 at 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
  {
diff --git a/mysql-userstatv2.patch b/mysql-userstatv2.patch
index f817c04..a3719a1 100644
--- a/mysql-userstatv2.patch
+++ b/mysql-userstatv2.patch
@@ -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@
<Skipped 4367 lines>
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/percona-server.git/commitdiff/431f68fe79a66d5dfdd53f2655709e6c925fbc22



More information about the pld-cvs-commit mailing list