List:Commits« Previous MessageNext Message »
From:Hakan Kuecuekyilmaz Date:November 5 2008 5:37pm
Subject:bzr push into mysql-6.0-falcon branch (hky:2903 to 2904)
View as plain text  
 2904 Hakan Kuecuekyilmaz	2008-11-05
      Merged:
          mysql-6.0-falcon-team --> mysql-6.0-falcon.
modified:
  .bzr-mysql/default.conf

 2903 Hakan Kuecuekyilmaz	2008-11-05 [merge]
      Merged:
          mysql-6.0 --> mysql-6.0-falcon --> mysql-6.0-falcon-team.
removed:
  mysql-test/suite/falcon/r/falcon_bug_28095_II.result
  mysql-test/suite/falcon/t/falcon_bug_28095_II-master.opt
  mysql-test/suite/falcon/t/falcon_bug_28095_II.test
added:
  mysql-test/include/restart_mysqld.inc
  mysql-test/include/wait_until_disconnected.inc
renamed:
  mysql-test/suite/falcon/r/falcon_bug_28095_I.result =>
mysql-test/suite/falcon/r/falcon_bug_28095.result
  mysql-test/suite/falcon/t/falcon_bug_28095_I.test =>
mysql-test/suite/falcon/t/falcon_bug_28095.test
modified:
  .bzrignore
  BUILD/compile-dist
  client/mysqltest.c
  configure.in
  mysql-test/include/wait_until_connected_again.inc
  mysql-test/r/group_by.result
  mysql-test/r/innodb_mrr.result
  mysql-test/r/myisam_mrr.result
  mysql-test/r/ps_ddl.result
  mysql-test/r/subselect3.result
  mysql-test/r/sum_distinct.result
  mysql-test/suite/falcon/t/disabled.def
  mysql-test/t/group_by.test
  mysql-test/t/innodb_mrr.test
  mysql-test/t/myisam_mrr.test
  mysql-test/t/ps_ddl.test
  mysql-test/t/subselect3.test
  mysql-test/t/sum_distinct.test
  sql/hostname.cc
  sql/item_sum.cc
  sql/item_sum.h
  sql/mysql_priv.h
  sql/mysqld.cc
  sql/net_serv.cc
  sql/sql_select.cc
  sql/sql_select.h
  storage/falcon/StorageVersion.h
  storage/myisam/ha_myisam.cc
  zlib/gzio.c
  mysql-test/suite/falcon/r/falcon_bug_28095.result
  mysql-test/suite/falcon/t/falcon_bug_28095.test

=== modified file '.bzrignore'
--- a/.bzrignore	2008-10-23 21:08:32 +0000
+++ b/.bzrignore	2008-10-29 14:20:12 +0000
@@ -600,6 +600,7 @@ libmysqld/protocol_cursor.cc
 libmysqld/records.cc
 libmysqld/repl_failsafe.cc
 libmysqld/rpl_filter.cc
+libmysqld/rpl_handler.cc
 libmysqld/rpl_injector.cc
 libmysqld/rpl_record.cc
 libmysqld/rpl_record_old.cc
@@ -875,6 +876,7 @@ mysql-test/suite/partitions/r/partition_
 mysql-test/suite/partitions/r/partition_t55.out
 mysql-test/suite/partitions/r/partition_t55.refout
 mysql-test/suite/partitions/t/partition.test
+mysql-test/suite/rpl/t/rpl_view-slave.opt
 mysql-test/t.log
 mysql-test/t/index_merge.load
 mysql-test/t/tmp.test

=== modified file 'BUILD/compile-dist'
--- a/BUILD/compile-dist	2008-05-29 15:44:11 +0000
+++ b/BUILD/compile-dist	2008-10-30 21:49:14 +0000
@@ -13,31 +13,47 @@ path=`dirname $0`
 
 # Default to gcc for CC and CXX
 if test -z "$CXX" ; then
-  export CXX=gcc
+  CXX=gcc
   # Set some required compile options
   if test -z "$CXXFLAGS" ; then
-    export CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
+    CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
   fi
 fi
 
 if test -z "$CC" ; then
-  export CC=gcc
+  CC=gcc
 fi
 
 
 # Use ccache, if available
 if ccache -V > /dev/null 2>&1
 then
-  if ! (echo "$CC" | grep "ccache" > /dev/null)
+  if echo "$CC" | grep "ccache" > /dev/null
   then
-    export CC="ccache $CC"
+    :
+  else
+    CC="ccache $CC"
   fi
-  if ! (echo "$CXX" | grep "ccache" > /dev/null)
+  if echo "$CXX" | grep "ccache" > /dev/null
   then
-    export CXX="ccache $CXX"
+    :
+  else
+    CXX="ccache $CXX"
   fi
 fi
 
+if test -z "$MAKE"
+then
+  if gmake -v > /dev/null 2>&1
+  then
+    MAKE="gmake"
+  else
+    MAKE="make"
+  fi
+fi
+
+export CC CXX MAKE
+
 # Make sure to enable all features that affect "make dist"
 # Remember that configure restricts the man pages to the configured features !
 ./configure \
@@ -45,4 +61,5 @@ fi
   --with-embedded-server \
   --with-falcon \
   --with-ndbcluster
-make
+$MAKE
+

=== modified file 'configure.in'
--- a/configure.in	2008-10-30 15:08:17 +0000
+++ b/configure.in	2008-11-05 15:41:45 +0000
@@ -11,7 +11,7 @@ AC_CANONICAL_SYSTEM
 # When changing major version number please also check switch statement
 # in mysqlbinlog::check_master_version().
 
-AM_INIT_AUTOMAKE(mysql, 6.0.8-alpha)
+AM_INIT_AUTOMAKE(mysql, 6.0.9-alpha)
 AM_CONFIG_HEADER([include/config.h:config.h.in])
 
 NDB_VERSION_MAJOR=6
@@ -431,12 +431,15 @@ dnl Find paths to some shell programs
 AC_PATH_PROG(LN, ln, ln)
 # This must be able to take a -f flag like normal unix ln.
 AC_PATH_PROG(LN_CP_F, ln, ln)
-if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then
-# If ln -f does not exists use -s (AFS systems)
-if test -n "$LN_CP_F"; then
-  LN_CP_F="$LN_CP_F -s"
-fi
-fi
+case $SYSTEM_TYPE in
+  *netware*) ;;
+  *)
+    # If ln -f does not exists use -s (AFS systems)
+    if test -n "$LN_CP_F"; then
+      LN_CP_F="$LN_CP_F -s"
+    fi
+    ;;
+esac
 
 AC_PATH_PROG(MV, mv, mv)
 AC_PATH_PROG(RM, rm, rm)
@@ -1661,14 +1664,16 @@ else
   OPTIMIZE_CXXFLAGS="-O"
 fi
 
-if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then
-  DEBUG_CFLAGS="-g -DDEBUG -sym internal,codeview4"
-  DEBUG_CXXFLAGS="-g -DDEBUG -sym internal,codeview4"
-  DEBUG_OPTIMIZE_CC="-DDEBUG"
-  DEBUG_OPTIMIZE_CXX="-DDEBUG"
-  OPTIMIZE_CFLAGS="-O3 -DNDEBUG"
-  OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG"
-fi
+case $SYSTEM_TYPE in
+  *netware*)
+    DEBUG_CFLAGS="-g -DDEBUG -sym internal,codeview4"
+    DEBUG_CXXFLAGS="-g -DDEBUG -sym internal,codeview4"
+    DEBUG_OPTIMIZE_CC="-DDEBUG"
+    DEBUG_OPTIMIZE_CXX="-DDEBUG"
+    OPTIMIZE_CFLAGS="-O3 -DNDEBUG"
+    OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG"
+    ;;
+esac
 
 # If the user specified CFLAGS, we won't add any optimizations
 if test -n "$SAVE_CFLAGS"
@@ -1795,9 +1800,6 @@ case "$with_atomic_ops" in
    *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
 esac
 
-# Check if we have the atomic_* functions on Solaris
-AC_CHECK_FUNC(atomic_cas_32, AC_DEFINE([HAVE_SOLARIS_ATOMIC], [1], [Define to 1 if
Solaris support atomic functions.]))
-
 # Force static compilation to avoid linking problems/get more speed
 AC_ARG_WITH(mysqld-ldflags,
     [  --with-mysqld-ldflags   Extra linking arguments for mysqld],
@@ -1956,15 +1958,18 @@ MYSQL_TZNAME
 # Do the c++ compiler have a bool type
 MYSQL_CXX_BOOL
 # Check some common bugs with gcc 2.8.# on sparc
-if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then
-MYSQL_CHECK_LONGLONG_TO_FLOAT
-if test "$ac_cv_conv_longlong_to_float" != "yes"
-then
-  AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float!
-If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 or newer and try
-again])
-fi
-fi
+case $SYSTEM_TYPE in
+  *netware*) ;;
+  *)
+    MYSQL_CHECK_LONGLONG_TO_FLOAT
+    if test "$ac_cv_conv_longlong_to_float" != "yes"
+    then
+      AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float!
+ If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 or newer and try
+    again])
+    fi
+    ;;
+esac
 AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
 AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
 AC_CHECK_TYPES([u_int32_t])
@@ -2589,11 +2594,12 @@ readline_h_ln_cmd=""
 readline_link=""
 want_to_use_readline="no"
 
-if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null
-then
+case $SYSTEM_TYPE in
+  *netware*)
     # For NetWare, do not need readline
     echo "Skipping readline"
-else
+    ;;
+  *)
     if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] &&
[test "$with_readline" = "undefined"]
     then
 	readline_topdir="cmd-line-utils"
@@ -2646,7 +2652,8 @@ else
 	      be built with libreadline. Please use --with-libedit to use
 	      the bundled version of libedit instead.])
     fi
-fi
+    ;;
+esac
 
 AC_SUBST(readline_dir)
 AC_SUBST(readline_topdir)

=== modified file 'mysql-test/r/group_by.result'
--- a/mysql-test/r/group_by.result	2008-04-01 15:13:57 +0000
+++ b/mysql-test/r/group_by.result	2008-09-09 19:36:23 +0000
@@ -1624,7 +1624,7 @@ b
 NULL
 1
 2
-DROP TABLE t1;
+DROP TABLE t1, t2;
 CREATE TABLE t1 ( a INT, b INT );
 SELECT b c, (SELECT a FROM t1 WHERE b = c)
 FROM t1;
@@ -1661,3 +1661,33 @@ FROM t1;
 ERROR 21000: Subquery returns more than 1 row
 DROP TABLE t1;
 SET @@sql_mode = @old_sql_mode;
+
+BUG#38072: Wrong result: HAVING not observed in a query with aggregate
+
+CREATE TABLE t1 (
+pk int(11) NOT NULL AUTO_INCREMENT,
+int_nokey int(11) NOT NULL,
+int_key int(11) NOT NULL,
+varchar_key varchar(1) NOT NULL,
+varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY int_key (int_key),
+KEY varchar_key (varchar_key)
+);
+INSERT INTO t1 VALUES 
+(1,5,5, 'h','h'),
+(2,1,1, '{','{'),
+(3,1,1, 'z','z'),
+(4,8,8, 'x','x'),
+(5,7,7, 'o','o'),
+(6,3,3, 'p','p'),
+(7,9,9, 'c','c'),
+(8,0,0, 'k','k'),
+(9,6,6, 't','t'),
+(10,0,0,'c','c');
+explain SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible HAVING
+SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar';
+X
+drop table t1;

=== modified file 'mysql-test/r/innodb_mrr.result'
--- a/mysql-test/r/innodb_mrr.result	2008-01-24 00:46:18 +0000
+++ b/mysql-test/r/innodb_mrr.result	2008-09-05 14:36:37 +0000
@@ -314,3 +314,40 @@ f1	f2	f3	f4
 9	9	9	A
 10	10	10	A
 drop table t1;
+
+BUG#37977: Wrong result returned on GROUP BY + OR + Innodb
+
+CREATE TABLE t1 (
+`pk` int(11) NOT NULL AUTO_INCREMENT,
+`int_nokey` int(11) NOT NULL,
+`int_key` int(11) NOT NULL,
+`date_key` date NOT NULL,
+`date_nokey` date NOT NULL,
+`time_key` time NOT NULL,
+`time_nokey` time NOT NULL,
+`datetime_key` datetime NOT NULL,
+`datetime_nokey` datetime NOT NULL,
+`varchar_key` varchar(5) DEFAULT NULL,
+`varchar_nokey` varchar(5) DEFAULT NULL,
+PRIMARY KEY (`pk`),
+KEY `int_key` (`int_key`),
+KEY `date_key` (`date_key`),
+KEY `time_key` (`time_key`),
+KEY `datetime_key` (`datetime_key`),
+KEY `varchar_key` (`varchar_key`)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES 
+(1,5,5,'2009-10-16','2009-10-16','09:28:15','09:28:15','2007-09-14 05:34:08','2007-09-14
05:34:08','qk','qk'),
+(2,6,6,'0000-00-00','0000-00-00','23:06:39','23:06:39','0000-00-00 00:00:00','0000-00-00
00:00:00','j','j'),
+(3,10,10,'2000-12-18','2000-12-18','22:16:19','22:16:19','2006-11-04
15:42:50','2006-11-04 15:42:50','aew','aew'),
+(4,0,0,'2001-09-18','2001-09-18','00:00:00','00:00:00','2004-03-23 13:23:35','2004-03-23
13:23:35',NULL,NULL),
+(5,6,6,'2007-08-16','2007-08-16','22:13:38','22:13:38','2004-08-19 11:01:28','2004-08-19
11:01:28','qu','qu');
+select pk from t1 WHERE `varchar_key` > 'kr' group by pk;
+pk
+1
+5
+select pk from t1 WHERE `int_nokey` IS NULL OR  `varchar_key` > 'kr' group by pk;
+pk
+1
+5
+drop table t1;

=== modified file 'mysql-test/r/myisam_mrr.result'
--- a/mysql-test/r/myisam_mrr.result	2008-01-10 22:04:59 +0000
+++ b/mysql-test/r/myisam_mrr.result	2008-09-05 19:23:07 +0000
@@ -303,3 +303,32 @@ ID	col1	key1	key2	text1	text2	col2	col3	
 3	NULL	1130	NULL	red	NULL	100	bodyandsubject	0
 4	NULL	1130	NULL	yellow	NULL	100	bodyandsubject	0
 drop table t1;
+
+BUG#37851: Crash in test_if_skip_sort_order tab->select is zero
+
+CREATE TABLE t1 (
+pk int(11) NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (pk)
+);
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 (
+pk int(11) NOT NULL AUTO_INCREMENT,
+int_key int(11) DEFAULT NULL,
+PRIMARY KEY (pk),
+KEY int_key (int_key)
+);
+INSERT INTO t2 VALUES (1,1),(2,6),(3,0);
+EXPLAIN EXTENDED
+SELECT MIN(t1.pk)
+FROM t1 WHERE EXISTS (
+SELECT t2.pk
+FROM t2
+WHERE t2.int_key IS NULL
+GROUP BY t2.pk
+);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE
+2	SUBQUERY	t2	ALL	int_key	int_key	5		3	33.33	Using index condition; Using filesort
+Warnings:
+Note	1003	select min(`test`.`t1`.`pk`) AS `MIN(t1.pk)` from `test`.`t1` where 0
+DROP TABLE t1, t2;

=== modified file 'mysql-test/r/ps_ddl.result'
--- a/mysql-test/r/ps_ddl.result	2008-08-13 20:05:34 +0000
+++ b/mysql-test/r/ps_ddl.result	2008-09-13 14:16:20 +0000
@@ -1655,6 +1655,18 @@ SQL statement where it is needed.
 #
 # SQLCOM_SELECT
 #
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt from "select 1 as res from dual where (1) in (select * from t1)";
+drop table t1;
+create table t1 (x int);
+execute stmt;
+res
+drop table t1;
+deallocate prepare stmt;
+call p_verify_reprepare_count(1);
+SUCCESS
+
 #
 # SQLCOM_CREATE_TABLE
 #

=== modified file 'mysql-test/r/subselect3.result'
--- a/mysql-test/r/subselect3.result	2008-08-20 01:52:25 +0000
+++ b/mysql-test/r/subselect3.result	2008-09-13 14:16:20 +0000
@@ -1,4 +1,4 @@
-drop table if exists t0, t1, t2, t3, t4, t5;
+drop table if exists t0, t1, t2, t3, t4;
 create table t1 (oref int, grp int, ie int) ;
 insert into t1 (oref, grp, ie) values
 (1, 1, 1),
@@ -789,29 +789,10 @@ a	b
 1	0.123
 drop table t1;
 End of 5.0 tests
-create table t0 (a int);
-insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-create table t1 (
-a int(11) default null,
-b int(11) default null,
-key (a)
-);
-insert into t1 select A.a+10*(B.a+10*C.a),A.a+10*(B.a+10*C.a) from t0 A, t0 B, t0 C;
-create table t2 (a int(11) default null);
-insert into t2 values (0),(1);
-create table t3 (a int(11) default null);
-insert into t3 values (0),(1);
-create table t4 (a int(11) default null);
-insert into t4 values (0),(1);
-create table t5 (a int(11) default null);
-insert into t5 values (0),(1),(0),(1);
-select * from t2, t3 
-where
-t2.a < 10 and
-t3.a+1 = 2 and
-t3.a in (select t1.b from t1
-where t1.a+1=t1.a+1 and
-t1.a < (select t4.a+10                                  
-from t4, t5 limit 2));
-ERROR 21000: Subquery returns more than 1 row
-drop table t0, t1, t2, t3, t4, t5;
+#  
+# BUG#36896: Server crash on SELECT FROM DUAL
+# 
+create table t1 (a int);
+select 1 as res from dual where (1) in (select * from t1);
+res
+drop table t1;

=== modified file 'mysql-test/r/sum_distinct.result'
--- a/mysql-test/r/sum_distinct.result	2005-04-07 16:24:14 +0000
+++ b/mysql-test/r/sum_distinct.result	2008-09-05 19:01:46 +0000
@@ -95,3 +95,26 @@ SELECT SUM(DISTINCT id % 11) FROM t1;
 SUM(DISTINCT id % 11)
 55
 DROP TABLE t1;
+
+BUG#37891: Column cannot be null error with aggregate in a subquery
+
+CREATE TABLE t1 (
+pk int(11) NOT NULL AUTO_INCREMENT,
+int_key int(11) DEFAULT NULL,
+PRIMARY KEY (pk),
+KEY int_key (int_key)
+);
+INSERT INTO t1 VALUES (1,10);
+CREATE TABLE t2 (
+pk int(11) NOT NULL AUTO_INCREMENT,
+time_nokey time DEFAULT NULL,
+datetime_key time DEFAULT NULL,
+PRIMARY KEY (pk),
+KEY datetime_key (datetime_key)
+);
+INSERT INTO t2 VALUES (1,'18:19:29',NOW());
+SELECT * FROM t1 WHERE int_key IN ( SELECT SUM(DISTINCT pk) FROM t2 WHERE time_nokey =
datetime_key );
+pk	int_key
+SELECT * FROM t1 WHERE int_key IN ( SELECT AVG(DISTINCT pk) FROM t2 WHERE time_nokey =
datetime_key );
+pk	int_key
+drop table t1,t2;

=== added file 'mysql-test/suite/falcon/r/falcon_bug_38186.result'
--- a/mysql-test/suite/falcon/r/falcon_bug_38186.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/r/falcon_bug_38186.result	2008-10-31 00:29:13 +0000
@@ -0,0 +1,2 @@
+*** Bug #38186 ***
+SET @@storage_engine = 'Falcon';

=== added file 'mysql-test/suite/falcon/r/falcon_bug_39708.result'
--- a/mysql-test/suite/falcon/r/falcon_bug_39708.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/r/falcon_bug_39708.result	2008-10-29 11:41:14 +0000
@@ -0,0 +1,6 @@
+CREATE TABLE t1(a VARCHAR(140) CHARACTER SET utf8, KEY(a)) ENGINE=falcon;
+ERROR 42000: Specified key was too long; max key length is 540 bytes
+SHOW WARNINGS;
+Level	Code	Message
+Error	1071	Specified key was too long; max key length is 540 bytes
+Error	1005	Can't create table 'test.t1' (errno: 213)

=== added file 'mysql-test/suite/falcon/r/falcon_bug_40130.result'
--- a/mysql-test/suite/falcon/r/falcon_bug_40130.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/r/falcon_bug_40130.result	2008-11-05 15:04:45 +0000
@@ -0,0 +1,398 @@
+*** Bug #40130 ***
+SET @@storage_engine = 'Falcon';
+DROP TABLE IF EXISTS table10;
+CREATE TABLE table10 (`time_key` time, key (`time_key` ));
+INSERT INTO table10 VALUES ('23:43:55');
+INSERT INTO table10 VALUES ('03:18:59');
+INSERT INTO table10 VALUES ('05:05:23');
+INSERT INTO table10 VALUES ('09:20:40');
+INSERT INTO table10 VALUES ('22:32:50');
+INSERT INTO table10 VALUES ('07:41:31');
+INSERT INTO table10 VALUES ('10:52:13');
+INSERT INTO table10 VALUES ('12:40:54');
+INSERT INTO table10 VALUES ('10:33:25');
+INSERT INTO table10 VALUES ('22:11:46');
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '09:11:23' WHERE `time_key` < '16:23:56';
+INSERT INTO table10 VALUES ( '20:25:18' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '10:33:25' WHERE `time_key` > '22:11:46';
+INSERT INTO table10 VALUES ( '17:58:48' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '00:16:10' );
+UPDATE table10 SET `time_key` = '16:05:35' WHERE `time_key` > '16:57:24';
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '20:24:01' );
+INSERT INTO table10 VALUES ( '18:37:59' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '21:05:17' WHERE `time_key` < '06:07:07';
+INSERT INTO table10 VALUES ( '00:05:40' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '13:34:36' );
+INSERT INTO table10 VALUES ( '22:35:15' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '09:32:02' );
+INSERT INTO table10 VALUES ( '12:02:39' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '19:22:23' WHERE `time_key` < '03:39:55';
+UPDATE table10 SET `time_key` = '13:45:38' WHERE `time_key` < '03:52:41';
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '21:57:00' WHERE `time_key` < '11:37:04';
+INSERT INTO table10 VALUES ( '18:56:03' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '21:46:34' );
+INSERT INTO table10 VALUES ( '00:46:37' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '11:54:45' );
+INSERT INTO table10 VALUES ( '11:00:16' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '04:41:27' WHERE `time_key` > '05:45:30';
+INSERT INTO table10 VALUES ( '05:55:02' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '02:51:17' WHERE `time_key` < '05:33:58';
+INSERT INTO table10 VALUES ( '06:07:14' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '19:17:13' );
+UPDATE table10 SET `time_key` = '14:23:25' WHERE `time_key` < '18:44:25';
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '01:54:06' );
+INSERT INTO table10 VALUES ( '05:36:42' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '04:04:15' WHERE `time_key` < '17:09:11';
+INSERT INTO table10 VALUES ( '13:22:58' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '03:45:01' WHERE `time_key` < '01:02:29';
+INSERT INTO table10 VALUES ( '14:45:34' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '12:33:12' );
+INSERT INTO table10 VALUES ( '21:40:27' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '05:05:45' );
+INSERT INTO table10 VALUES ( '01:21:15' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '01:43:44' WHERE `time_key` > '18:44:54';
+UPDATE table10 SET `time_key` = '16:00:25' WHERE `time_key` > '17:37:45';
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '09:17:29' );
+UPDATE table10 SET `time_key` = '00:32:27' WHERE `time_key` < '19:55:22';
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '00:01:27' WHERE `time_key` < '23:49:20';
+INSERT INTO table10 VALUES ( '11:10:06' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '21:52:14' WHERE `time_key` > '00:54:57';
+INSERT INTO table10 VALUES ( '10:32:20' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '05:48:51' WHERE `time_key` < '05:53:48';
+UPDATE table10 SET `time_key` = '04:11:47' WHERE `time_key` > '14:02:03';
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '20:58:47' );
+INSERT INTO table10 VALUES ( '06:58:04' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '14:41:45' );
+UPDATE table10 SET `time_key` = '00:45:47' WHERE `time_key` < '21:51:00';
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '09:01:24' );
+INSERT INTO table10 VALUES ( '07:07:37' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '06:25:00' );
+INSERT INTO table10 VALUES ( '05:47:01' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '12:31:51' WHERE `time_key` > '04:34:05';
+INSERT INTO table10 VALUES ( '01:31:26' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '01:46:22' );
+INSERT INTO table10 VALUES ( '01:14:58' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '04:09:31' );
+UPDATE table10 SET `time_key` = '08:28:13' WHERE `time_key` > '14:50:18';
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '11:19:43' WHERE `time_key` < '04:30:14';
+INSERT INTO table10 VALUES ( '20:03:24' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '14:40:32' WHERE `time_key` < '15:30:08';
+UPDATE table10 SET `time_key` = '03:13:02' WHERE `time_key` < '21:47:42';
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '20:37:56' );
+UPDATE table10 SET `time_key` = '15:51:19' WHERE `time_key` < '01:39:43';
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '07:15:18' WHERE `time_key` > '05:37:40';
+INSERT INTO table10 VALUES ( '18:47:30' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '13:32:24' WHERE `time_key` > '23:38:12';
+INSERT INTO table10 VALUES ( '23:32:39' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '22:01:18' WHERE `time_key` < '17:51:48';
+INSERT INTO table10 VALUES ( '11:41:29' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '15:45:55' WHERE `time_key` > '04:03:52';
+UPDATE table10 SET `time_key` = '05:43:47' WHERE `time_key` < '07:29:01';
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '23:44:48' WHERE `time_key` < '00:33:42';
+UPDATE table10 SET `time_key` = '08:56:04' WHERE `time_key` > '12:16:41';
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '19:23:41' );
+INSERT INTO table10 VALUES ( '18:44:20' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '00:40:04' WHERE `time_key` > '11:34:06';
+UPDATE table10 SET `time_key` = '23:45:59' WHERE `time_key` < '09:44:50';
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '18:54:59' WHERE `time_key` < '15:46:02';
+INSERT INTO table10 VALUES ( '17:37:41' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '17:08:04' WHERE `time_key` < '14:11:50';
+UPDATE table10 SET `time_key` = '21:33:59' WHERE `time_key` > '17:44:43';
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '03:50:15' WHERE `time_key` > '19:35:18';
+UPDATE table10 SET `time_key` = '23:15:47' WHERE `time_key` < '12:18:46';
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '22:50:01' );
+INSERT INTO table10 VALUES ( '17:29:53' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '21:33:30' );
+INSERT INTO table10 VALUES ( '06:27:52' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '07:49:31' );
+INSERT INTO table10 VALUES ( '21:31:25' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '13:50:22' );
+INSERT INTO table10 VALUES ( '15:13:07' );
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '14:06:24' );
+INSERT INTO table10 VALUES ( '19:10:11' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '05:03:39' WHERE `time_key` > '11:46:31';
+INSERT INTO table10 VALUES ( '04:35:34' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '14:37:01' WHERE `time_key` < '02:11:03';
+INSERT INTO table10 VALUES ( '10:52:22' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '15:37:40' WHERE `time_key` > '11:19:00';
+INSERT INTO table10 VALUES ( '08:46:29' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '07:59:59' WHERE `time_key` < '05:27:20';
+UPDATE table10 SET `time_key` = '00:45:15' WHERE `time_key` < '20:07:08';
+COMMIT;
+START TRANSACTION;
+INSERT INTO table10 VALUES ( '00:51:31' );
+UPDATE table10 SET `time_key` = '10:00:58' WHERE `time_key` < '16:41:45';
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '13:49:37' WHERE `time_key` > '10:40:48';
+INSERT INTO table10 VALUES ( '05:16:25' );
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '14:46:15' WHERE `time_key` < '12:48:22';
+UPDATE table10 SET `time_key` = '05:50:46' WHERE `time_key` < '07:58:43';
+COMMIT;
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '00:11:06' WHERE `time_key` < '16:39:47';
+UPDATE table10 SET `time_key` = '04:13:41' WHERE `time_key` < '14:55:39';
+COMMIT;
+SELECT * FROM table10;
+time_key
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+04:13:41
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '00:28:04' WHERE `time_key` < '09:58:46';
+UPDATE table10 SET `time_key` = '04:56:25' WHERE `time_key` > '09:26:08';
+COMMIT;
+SELECT * FROM table10;
+time_key
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+00:28:04
+DROP TABLE table10;

=== added file 'mysql-test/suite/falcon/r/falcon_bug_40158.result'
--- a/mysql-test/suite/falcon/r/falcon_bug_40158.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/r/falcon_bug_40158.result	2008-11-05 14:51:37 +0000
@@ -0,0 +1,34 @@
+*** Bug #40158 ***
+SET @@storage_engine = 'Falcon';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (`"strangename"` int);
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+"strangename"
+1
+SELECT `"strangename"` FROM t1;
+"strangename"
+1
+DROP TABLE t1;
+SET LOCAL SQL_MODE=ANSI_QUOTES;
+CREATE TABLE t1 ("""strangename""" int);
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+"strangename"
+1
+SELECT """strangename""" FROM t1;
+"strangename"
+1
+DROP TABLE t1;
+CREATE TABLE t1 (`""strangename""` int);
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+""strangename""
+1
+SELECT `""strangename""` FROM t1;
+""strangename""
+1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1
+DROP TABLE t1;

=== added file 'mysql-test/suite/falcon/t/falcon_bug_38186.test'
--- a/mysql-test/suite/falcon/t/falcon_bug_38186.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/t/falcon_bug_38186.test	2008-10-31 00:29:13 +0000
@@ -0,0 +1,29 @@
+--source include/have_falcon.inc
+#
+# Bug #38186: 
+# CREATE TABLESPACE can fail when invoked immediately following a
+# DROP TABLESPACE statement that used the same tablespace name.
+#
+--echo *** Bug #38186 ***
+
+# ----------------------------------------------------- #
+# --- Initialisation                                --- #
+# ----------------------------------------------------- #
+let $engine = 'Falcon';
+eval SET @@storage_engine = $engine;
+# ----------------------------------------------------- #
+# --- Test                                          --- #
+# ----------------------------------------------------- #
+--disable_query_log
+let $i = 100;
+while($i)
+{
+  eval CREATE TABLESPACE ts ADD DATAFILE 'file.fts' ENGINE = $engine;
+  CREATE TABLE t(i int) TABLESPACE ts;
+  INSERT INTO t values(1);
+  DROP TABLE t;
+  eval DROP TABLESPACE ts ENGINE= $engine;
+  dec $i;
+}
+--enable_query_log
+

=== added file 'mysql-test/suite/falcon/t/falcon_bug_39708-master.opt'
--- a/mysql-test/suite/falcon/t/falcon_bug_39708-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/t/falcon_bug_39708-master.opt	2008-10-29 11:41:14 +0000
@@ -0,0 +1 @@
+--falcon-page-size=2k

=== added file 'mysql-test/suite/falcon/t/falcon_bug_39708.test'
--- a/mysql-test/suite/falcon/t/falcon_bug_39708.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/t/falcon_bug_39708.test	2008-10-29 11:41:14 +0000
@@ -0,0 +1,5 @@
+--source include/have_falcon.inc
+
+--error ER_TOO_LONG_KEY
+CREATE TABLE t1(a VARCHAR(140) CHARACTER SET utf8, KEY(a)) ENGINE=falcon;
+SHOW WARNINGS;

=== added file 'mysql-test/suite/falcon/t/falcon_bug_40130.test'
--- a/mysql-test/suite/falcon/t/falcon_bug_40130.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/t/falcon_bug_40130.test	2008-11-05 15:04:45 +0000
@@ -0,0 +1,333 @@
+--source include/have_falcon.inc
+
+#
+# Bug #40130: Falcon date / time indexes broken
+#
+--echo *** Bug #40130 ***
+
+# ----------------------------------------------------- #
+# --- Initialisation                                --- #
+# ----------------------------------------------------- #
+let $engine = 'Falcon';
+eval SET @@storage_engine = $engine;
+
+--disable_warnings
+DROP TABLE IF EXISTS table10;
+--enable_warnings
+
+# ----------------------------------------------------- #
+# --- Test                                          --- #
+# ----------------------------------------------------- #
+
+CREATE TABLE table10 (`time_key` time, key (`time_key` ));
+INSERT INTO table10 VALUES ('23:43:55');
+INSERT INTO table10 VALUES ('03:18:59');
+INSERT INTO table10 VALUES ('05:05:23');
+INSERT INTO table10 VALUES ('09:20:40');
+INSERT INTO table10 VALUES ('22:32:50');
+INSERT INTO table10 VALUES ('07:41:31');
+INSERT INTO table10 VALUES ('10:52:13');
+INSERT INTO table10 VALUES ('12:40:54');
+INSERT INTO table10 VALUES ('10:33:25');
+INSERT INTO table10 VALUES ('22:11:46');
+
+SET AUTOCOMMIT=OFF;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '09:11:23' WHERE `time_key` < '16:23:56'; 
+INSERT INTO table10 VALUES ( '20:25:18' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '10:33:25' WHERE `time_key` > '22:11:46'; 
+INSERT INTO table10 VALUES ( '17:58:48' ); 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '00:16:10' ); 
+UPDATE table10 SET `time_key` = '16:05:35' WHERE `time_key` > '16:57:24'; 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '20:24:01' ); 
+INSERT INTO table10 VALUES ( '18:37:59' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '21:05:17' WHERE `time_key` < '06:07:07'; 
+INSERT INTO table10 VALUES ( '00:05:40' ); 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '13:34:36' ); 
+INSERT INTO table10 VALUES ( '22:35:15' ); 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '09:32:02' ); 
+INSERT INTO table10 VALUES ( '12:02:39' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '19:22:23' WHERE `time_key` < '03:39:55'; 
+UPDATE table10 SET `time_key` = '13:45:38' WHERE `time_key` < '03:52:41'; 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '21:57:00' WHERE `time_key` < '11:37:04'; 
+INSERT INTO table10 VALUES ( '18:56:03' ); 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '21:46:34' ); 
+INSERT INTO table10 VALUES ( '00:46:37' ); 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '11:54:45' ); 
+INSERT INTO table10 VALUES ( '11:00:16' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '04:41:27' WHERE `time_key` > '05:45:30'; 
+INSERT INTO table10 VALUES ( '05:55:02' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '02:51:17' WHERE `time_key` < '05:33:58'; 
+INSERT INTO table10 VALUES ( '06:07:14' ); 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '19:17:13' ); 
+UPDATE table10 SET `time_key` = '14:23:25' WHERE `time_key` < '18:44:25'; 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '01:54:06' ); 
+INSERT INTO table10 VALUES ( '05:36:42' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '04:04:15' WHERE `time_key` < '17:09:11'; 
+INSERT INTO table10 VALUES ( '13:22:58' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '03:45:01' WHERE `time_key` < '01:02:29'; 
+INSERT INTO table10 VALUES ( '14:45:34' ); 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '12:33:12' ); 
+INSERT INTO table10 VALUES ( '21:40:27' ); 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '05:05:45' ); 
+INSERT INTO table10 VALUES ( '01:21:15' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '01:43:44' WHERE `time_key` > '18:44:54'; 
+UPDATE table10 SET `time_key` = '16:00:25' WHERE `time_key` > '17:37:45'; 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '09:17:29' ); 
+UPDATE table10 SET `time_key` = '00:32:27' WHERE `time_key` < '19:55:22'; 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '00:01:27' WHERE `time_key` < '23:49:20'; 
+INSERT INTO table10 VALUES ( '11:10:06' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '21:52:14' WHERE `time_key` > '00:54:57'; 
+INSERT INTO table10 VALUES ( '10:32:20' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '05:48:51' WHERE `time_key` < '05:53:48'; 
+UPDATE table10 SET `time_key` = '04:11:47' WHERE `time_key` > '14:02:03'; 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '20:58:47' ); 
+INSERT INTO table10 VALUES ( '06:58:04' ); 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '14:41:45' ); 
+UPDATE table10 SET `time_key` = '00:45:47' WHERE `time_key` < '21:51:00'; 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '09:01:24' ); 
+INSERT INTO table10 VALUES ( '07:07:37' ); 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '06:25:00' ); 
+INSERT INTO table10 VALUES ( '05:47:01' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '12:31:51' WHERE `time_key` > '04:34:05'; 
+INSERT INTO table10 VALUES ( '01:31:26' ); 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '01:46:22' ); 
+INSERT INTO table10 VALUES ( '01:14:58' ); 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '04:09:31' ); 
+UPDATE table10 SET `time_key` = '08:28:13' WHERE `time_key` > '14:50:18'; 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '11:19:43' WHERE `time_key` < '04:30:14'; 
+INSERT INTO table10 VALUES ( '20:03:24' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '14:40:32' WHERE `time_key` < '15:30:08'; 
+UPDATE table10 SET `time_key` = '03:13:02' WHERE `time_key` < '21:47:42'; 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '20:37:56' ); 
+UPDATE table10 SET `time_key` = '15:51:19' WHERE `time_key` < '01:39:43'; 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '07:15:18' WHERE `time_key` > '05:37:40'; 
+INSERT INTO table10 VALUES ( '18:47:30' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '13:32:24' WHERE `time_key` > '23:38:12'; 
+INSERT INTO table10 VALUES ( '23:32:39' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '22:01:18' WHERE `time_key` < '17:51:48'; 
+INSERT INTO table10 VALUES ( '11:41:29' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '15:45:55' WHERE `time_key` > '04:03:52'; 
+UPDATE table10 SET `time_key` = '05:43:47' WHERE `time_key` < '07:29:01'; 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '23:44:48' WHERE `time_key` < '00:33:42'; 
+UPDATE table10 SET `time_key` = '08:56:04' WHERE `time_key` > '12:16:41'; 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '19:23:41' ); 
+INSERT INTO table10 VALUES ( '18:44:20' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '00:40:04' WHERE `time_key` > '11:34:06'; 
+UPDATE table10 SET `time_key` = '23:45:59' WHERE `time_key` < '09:44:50'; 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '18:54:59' WHERE `time_key` < '15:46:02'; 
+INSERT INTO table10 VALUES ( '17:37:41' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '17:08:04' WHERE `time_key` < '14:11:50'; 
+UPDATE table10 SET `time_key` = '21:33:59' WHERE `time_key` > '17:44:43'; 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '03:50:15' WHERE `time_key` > '19:35:18'; 
+UPDATE table10 SET `time_key` = '23:15:47' WHERE `time_key` < '12:18:46'; 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '22:50:01' ); 
+INSERT INTO table10 VALUES ( '17:29:53' ); 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '21:33:30' ); 
+INSERT INTO table10 VALUES ( '06:27:52' ); 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '07:49:31' ); 
+INSERT INTO table10 VALUES ( '21:31:25' );
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '13:50:22' ); 
+INSERT INTO table10 VALUES ( '15:13:07' ); 
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '14:06:24' ); 
+INSERT INTO table10 VALUES ( '19:10:11' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '05:03:39' WHERE `time_key` > '11:46:31'; 
+INSERT INTO table10 VALUES ( '04:35:34' );
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '14:37:01' WHERE `time_key` < '02:11:03'; 
+INSERT INTO table10 VALUES ( '10:52:22' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '15:37:40' WHERE `time_key` > '11:19:00'; 
+INSERT INTO table10 VALUES ( '08:46:29' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '07:59:59' WHERE `time_key` < '05:27:20'; 
+UPDATE table10 SET `time_key` = '00:45:15' WHERE `time_key` < '20:07:08';
+COMMIT;
+
+START TRANSACTION; 
+INSERT INTO table10 VALUES ( '00:51:31' ); 
+UPDATE table10 SET `time_key` = '10:00:58' WHERE `time_key` < '16:41:45'; 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '13:49:37' WHERE `time_key` > '10:40:48'; 
+INSERT INTO table10 VALUES ( '05:16:25' ); 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '14:46:15' WHERE `time_key` < '12:48:22'; 
+UPDATE table10 SET `time_key` = '05:50:46' WHERE `time_key` < '07:58:43'; 
+COMMIT;
+
+START TRANSACTION; 
+UPDATE table10 SET `time_key` = '00:11:06' WHERE `time_key` < '16:39:47'; 
+UPDATE table10 SET `time_key` = '04:13:41' WHERE `time_key` < '14:55:39'; 
+COMMIT;
+
+SELECT * FROM table10;
+
+START TRANSACTION;
+UPDATE table10 SET `time_key` = '00:28:04' WHERE `time_key` < '09:58:46'; 
+UPDATE table10 SET `time_key` = '04:56:25' WHERE `time_key` > '09:26:08'; 
+COMMIT;
+
+SELECT * FROM table10;
+
+# ----------------------------------------------------- #
+# --- Final cleanup                                 --- #
+# ----------------------------------------------------- #
+DROP TABLE table10;

=== added file 'mysql-test/suite/falcon/t/falcon_bug_40158.test'
--- a/mysql-test/suite/falcon/t/falcon_bug_40158.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/t/falcon_bug_40158.test	2008-11-05 14:51:37 +0000
@@ -0,0 +1,50 @@
+--source include/have_falcon.inc
+
+#
+# Bug #40158: Falcon assertion in StorageInterface::encodeRecord() line 2635 on CREATE
TABLE
+#
+--echo *** Bug #40158 ***
+
+# ----------------------------------------------------- #
+# --- Initialisation                                --- #
+# ----------------------------------------------------- #
+let $engine = 'Falcon';
+eval SET @@storage_engine = $engine;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# ----------------------------------------------------- #
+# --- Test                                          --- #
+# ----------------------------------------------------- #
+
+CREATE TABLE t1 (`"strangename"` int);
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+SELECT `"strangename"` FROM t1;
+DROP TABLE t1;
+
+SET LOCAL SQL_MODE=ANSI_QUOTES;
+
+CREATE TABLE t1 ("""strangename""" int);
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+SELECT """strangename""" FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (`""strangename""` int);
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+SELECT `""strangename""` FROM t1;
+
+# ----------------------------------------------------- #
+# --- Check                                         --- #
+# ----------------------------------------------------- #
+
+SELECT COUNT(*) FROM t1;
+
+# ----------------------------------------------------- #
+# --- Final cleanup                                 --- #
+# ----------------------------------------------------- #
+DROP TABLE t1;

=== modified file 'mysql-test/t/group_by.test'
--- a/mysql-test/t/group_by.test	2008-04-01 15:13:57 +0000
+++ b/mysql-test/t/group_by.test	2008-09-09 19:36:23 +0000
@@ -1062,7 +1062,7 @@ SELECT a from t2 GROUP BY a;
 EXPLAIN SELECT b from t2 GROUP BY b;
 SELECT b from t2 GROUP BY b;
 
-DROP TABLE t1;
+DROP TABLE t1, t2;
 
 #
 # Bug #31797: error while parsing subqueries -- WHERE is parsed as HAVING
@@ -1109,5 +1109,32 @@ FROM t1;
 DROP TABLE t1;
 SET @@sql_mode = @old_sql_mode;
 
-
+--echo
+--echo BUG#38072: Wrong result: HAVING not observed in a query with aggregate
+--echo 
+CREATE TABLE t1 (
+  pk int(11) NOT NULL AUTO_INCREMENT,
+  int_nokey int(11) NOT NULL,
+  int_key int(11) NOT NULL,
+  varchar_key varchar(1) NOT NULL,
+  varchar_nokey varchar(1) NOT NULL,
+  PRIMARY KEY (pk),
+  KEY int_key (int_key),
+  KEY varchar_key (varchar_key)
+);
+INSERT INTO t1 VALUES 
+(1,5,5, 'h','h'),
+(2,1,1, '{','{'),
+(3,1,1, 'z','z'),
+(4,8,8, 'x','x'),
+(5,7,7, 'o','o'),
+(6,3,3, 'p','p'),
+(7,9,9, 'c','c'),
+(8,0,0, 'k','k'),
+(9,6,6, 't','t'),
+(10,0,0,'c','c');
+
+explain SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar';
+SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar';
+drop table t1;
 

=== modified file 'mysql-test/t/innodb_mrr.test'
--- a/mysql-test/t/innodb_mrr.test	2008-01-24 00:46:18 +0000
+++ b/mysql-test/t/innodb_mrr.test	2008-09-05 14:36:37 +0000
@@ -66,3 +66,36 @@ select * from t1 where (f3>=5 and f3<=10
 
 drop table t1;
 
+--echo
+--echo BUG#37977: Wrong result returned on GROUP BY + OR + Innodb
+--echo
+CREATE TABLE t1 (
+  `pk` int(11) NOT NULL AUTO_INCREMENT,
+  `int_nokey` int(11) NOT NULL,
+  `int_key` int(11) NOT NULL,
+  `date_key` date NOT NULL,
+  `date_nokey` date NOT NULL,
+  `time_key` time NOT NULL,
+  `time_nokey` time NOT NULL,
+  `datetime_key` datetime NOT NULL,
+  `datetime_nokey` datetime NOT NULL,
+  `varchar_key` varchar(5) DEFAULT NULL,
+  `varchar_nokey` varchar(5) DEFAULT NULL,
+  PRIMARY KEY (`pk`),
+  KEY `int_key` (`int_key`),
+  KEY `date_key` (`date_key`),
+  KEY `time_key` (`time_key`),
+  KEY `datetime_key` (`datetime_key`),
+  KEY `varchar_key` (`varchar_key`)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES 
+(1,5,5,'2009-10-16','2009-10-16','09:28:15','09:28:15','2007-09-14 05:34:08','2007-09-14
05:34:08','qk','qk'),
+(2,6,6,'0000-00-00','0000-00-00','23:06:39','23:06:39','0000-00-00 00:00:00','0000-00-00
00:00:00','j','j'),
+(3,10,10,'2000-12-18','2000-12-18','22:16:19','22:16:19','2006-11-04
15:42:50','2006-11-04 15:42:50','aew','aew'),
+(4,0,0,'2001-09-18','2001-09-18','00:00:00','00:00:00','2004-03-23 13:23:35','2004-03-23
13:23:35',NULL,NULL),
+(5,6,6,'2007-08-16','2007-08-16','22:13:38','22:13:38','2004-08-19 11:01:28','2004-08-19
11:01:28','qu','qu');
+select pk from t1 WHERE `varchar_key` > 'kr' group by pk;
+select pk from t1 WHERE `int_nokey` IS NULL OR  `varchar_key` > 'kr' group by pk;
+drop table t1;
+

=== modified file 'mysql-test/t/myisam_mrr.test'
--- a/mysql-test/t/myisam_mrr.test	2008-01-10 22:04:59 +0000
+++ b/mysql-test/t/myisam_mrr.test	2008-09-05 19:23:07 +0000
@@ -45,3 +45,32 @@ select * FROM t1 WHERE key1=1130 AND col
 
 drop table t1;
 
+
+--echo 
+--echo  BUG#37851: Crash in test_if_skip_sort_order tab->select is zero
+--echo 
+CREATE TABLE t1 (
+  pk int(11) NOT NULL AUTO_INCREMENT,
+  PRIMARY KEY (pk)
+);
+INSERT INTO t1 VALUES (1);
+
+CREATE TABLE t2 (
+  pk int(11) NOT NULL AUTO_INCREMENT,
+  int_key int(11) DEFAULT NULL,
+  PRIMARY KEY (pk),
+  KEY int_key (int_key)
+);
+INSERT INTO t2 VALUES (1,1),(2,6),(3,0);
+
+EXPLAIN EXTENDED
+SELECT MIN(t1.pk)
+FROM t1 WHERE EXISTS (
+ SELECT t2.pk
+ FROM t2
+ WHERE t2.int_key IS NULL
+ GROUP BY t2.pk
+);
+
+DROP TABLE t1, t2;
+

=== modified file 'mysql-test/t/ps_ddl.test'
--- a/mysql-test/t/ps_ddl.test	2008-08-13 20:05:34 +0000
+++ b/mysql-test/t/ps_ddl.test	2008-09-13 14:16:20 +0000
@@ -1407,17 +1407,17 @@ deallocate prepare stmt_sp;
 --echo # SQLCOM_SELECT
 --echo #
 
-#--disable_warnings
-#drop table if exists t1;
-#--enable_warnings
-#create table t1 (a int);
-#prepare stmt from "select 1 as res from dual where (1) in (select * from t1)";
-#drop table t1;
-#create table t1 (x int);
-#execute stmt;
-#drop table t1;
-#deallocate prepare stmt;
-#call p_verify_reprepare_count(1);
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt from "select 1 as res from dual where (1) in (select * from t1)";
+drop table t1;
+create table t1 (x int);
+execute stmt;
+drop table t1;
+deallocate prepare stmt;
+call p_verify_reprepare_count(1);
 
 --echo #
 --echo # SQLCOM_CREATE_TABLE

=== modified file 'mysql-test/t/subselect3.test'
--- a/mysql-test/t/subselect3.test	2008-10-09 10:58:51 +0000
+++ b/mysql-test/t/subselect3.test	2008-10-24 03:46:27 +0000
@@ -1,5 +1,5 @@
 --disable_warnings
-drop table if exists t0, t1, t2, t3, t4, t5;
+drop table if exists t0, t1, t2, t3, t4;
 --enable_warnings
 
 #
@@ -634,41 +634,10 @@ let $datadir=`select @@datadir`;
 
 --echo End of 5.0 tests
 
-#
-# BUG#36135 "void Diagnostics_area::set_eof_status(THD*): Assertion `!is_set()' failed."
-#
-create table t0 (a int);
-insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-
-create table t1 (
-  a int(11) default null,
-  b int(11) default null,
-  key (a)
-);
-# produce numbers 0..999
-insert into t1 select A.a+10*(B.a+10*C.a),A.a+10*(B.a+10*C.a) from t0 A, t0 B, t0 C;
-
-create table t2 (a int(11) default null);
-insert into t2 values (0),(1);
-
-create table t3 (a int(11) default null);
-insert into t3 values (0),(1);
-
-create table t4 (a int(11) default null);
-insert into t4 values (0),(1);
-
-create table t5 (a int(11) default null);
-insert into t5 values (0),(1),(0),(1);
-
-# this must not fail assertion
---error 1242
-select * from t2, t3 
-where
-    t2.a < 10 and
-    t3.a+1 = 2 and
-    t3.a in (select t1.b from t1
-                 where t1.a+1=t1.a+1 and
-                       t1.a < (select t4.a+10                                  
-                                  from t4, t5 limit 2));
+--echo #  
+--echo # BUG#36896: Server crash on SELECT FROM DUAL
+--echo # 
+create table t1 (a int);
+select 1 as res from dual where (1) in (select * from t1);
+drop table t1;
 
-drop table t0, t1, t2, t3, t4, t5;

=== modified file 'mysql-test/t/sum_distinct.test'
--- a/mysql-test/t/sum_distinct.test	2005-04-07 16:24:14 +0000
+++ b/mysql-test/t/sum_distinct.test	2008-09-05 19:01:46 +0000
@@ -93,3 +93,28 @@ SELECT SUM(DISTINCT id) FROM t1;
 SELECT SUM(DISTINCT id % 11) FROM t1;
 
 DROP TABLE t1;
+
+--echo 
+--echo BUG#37891: Column cannot be null error with aggregate in a subquery
+--echo
+CREATE TABLE t1 (
+  pk int(11) NOT NULL AUTO_INCREMENT,
+  int_key int(11) DEFAULT NULL,
+  PRIMARY KEY (pk),
+  KEY int_key (int_key)
+);
+INSERT INTO t1 VALUES (1,10);
+
+CREATE TABLE t2 (
+  pk int(11) NOT NULL AUTO_INCREMENT,
+  time_nokey time DEFAULT NULL,
+  datetime_key time DEFAULT NULL,
+  PRIMARY KEY (pk),
+  KEY datetime_key (datetime_key)
+);
+INSERT INTO t2 VALUES (1,'18:19:29',NOW());
+
+SELECT * FROM t1 WHERE int_key IN ( SELECT SUM(DISTINCT pk) FROM t2 WHERE time_nokey =
datetime_key );
+SELECT * FROM t1 WHERE int_key IN ( SELECT AVG(DISTINCT pk) FROM t2 WHERE time_nokey =
datetime_key );
+drop table t1,t2;
+

=== modified file 'sql/hostname.cc'
--- a/sql/hostname.cc	2008-09-01 10:11:50 +0000
+++ b/sql/hostname.cc	2008-10-24 03:46:27 +0000
@@ -49,7 +49,6 @@ public:
 };
 
 static hash_filo *hostname_cache;
-static pthread_mutex_t LOCK_hostname;
 
 void hostname_cache_refresh()
 {
@@ -66,7 +65,6 @@ bool hostname_cache_init()
 				     &my_charset_bin)))
     return 1;
   hostname_cache->clear();
-  (void) pthread_mutex_init(&LOCK_hostname,MY_MUTEX_INIT_SLOW);
 
   return 0;
 }
@@ -75,7 +73,6 @@ void hostname_cache_free()
 {
   if (hostname_cache)
   {
-    (void) pthread_mutex_destroy(&LOCK_hostname);
     delete hostname_cache;
     hostname_cache= 0;
   }

=== modified file 'sql/item_sum.cc'
--- a/sql/item_sum.cc	2008-06-26 16:17:05 +0000
+++ b/sql/item_sum.cc	2008-09-05 19:01:46 +0000
@@ -978,6 +978,17 @@ void Item_sum_distinct::fix_length_and_d
 }
 
 
+bool Item_sum_distinct::fix_fields(THD *thd, Item **ref)
+{
+  int res= Item_sum_num::fix_fields(thd, ref);
+  /*
+    SUM(DISTINCT x) and AVG(DISTINCT x) may have NULL value even when x is
+    not nullable:
+  */
+  maybe_null= TRUE;
+  return res;
+}
+
 /**
   @todo
   check that the case of CHAR(0) works OK

=== modified file 'sql/item_sum.h'
--- a/sql/item_sum.h	2008-06-12 19:04:52 +0000
+++ b/sql/item_sum.h	2008-09-05 19:01:46 +0000
@@ -488,6 +488,7 @@ public:
   void reset_field() {} // not used
   void update_field() {} // not used
   virtual void no_rows_in_result() {}
+  bool fix_fields(THD *thd, Item **ref);
   void fix_length_and_dec();
   enum Item_result result_type () const { return val.traits->type(); }
   virtual void calculate_val_and_count();

=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h	2008-10-22 11:51:28 +0000
+++ b/sql/mysql_priv.h	2008-10-29 20:39:29 +0000
@@ -2083,14 +2083,14 @@ extern FILE *bootstrap_file;
 extern int bootstrap_error;
 extern FILE *stderror_file;
 extern pthread_key(MEM_ROOT**,THR_MALLOC);
-extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open, LOCK_lock_db,
+extern pthread_mutex_t LOCK_mysql_create_db, LOCK_open, LOCK_lock_db,
        LOCK_thread_count,LOCK_mapped_file,LOCK_user_locks, LOCK_status,
        LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_short,
        LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
        LOCK_slave_list, LOCK_active_mi, LOCK_manager, LOCK_global_read_lock,
        LOCK_global_system_variables, LOCK_user_conn,
        LOCK_prepared_stmt_count,
-       LOCK_bytes_sent, LOCK_bytes_received, LOCK_connection_count;
+       LOCK_connection_count;
 #ifdef HAVE_OPENSSL
 extern pthread_mutex_t LOCK_des_key_file;
 #endif

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2008-10-24 11:01:06 +0000
+++ b/sql/mysqld.cc	2008-11-01 17:24:56 +0000
@@ -686,11 +686,11 @@ SHOW_COMP_OPTION have_community_features
 
 pthread_key(MEM_ROOT**,THR_MALLOC);
 pthread_key(THD*, THR_THD);
-pthread_mutex_t LOCK_mysql_create_db, LOCK_Acl, LOCK_open, LOCK_thread_count,
+pthread_mutex_t LOCK_mysql_create_db, LOCK_open, LOCK_thread_count,
 		LOCK_mapped_file, LOCK_status, LOCK_global_read_lock,
 		LOCK_error_log,
 		LOCK_delayed_insert, LOCK_delayed_status, LOCK_delayed_create,
-		LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
+		LOCK_crypt,
 	        LOCK_global_system_variables,
                 LOCK_user_conn, LOCK_slave_list, LOCK_active_mi,
                 LOCK_connection_count;
@@ -1460,7 +1460,6 @@ static void clean_up_mutexes()
 {
   (void) pthread_mutex_destroy(&LOCK_mysql_create_db);
   (void) pthread_mutex_destroy(&LOCK_lock_db);
-  (void) pthread_mutex_destroy(&LOCK_Acl);
   (void) rwlock_destroy(&LOCK_grant);
   (void) pthread_mutex_destroy(&LOCK_open);
   (void) pthread_mutex_destroy(&LOCK_thread_count);
@@ -1472,8 +1471,6 @@ static void clean_up_mutexes()
   (void) pthread_mutex_destroy(&LOCK_delayed_create);
   (void) pthread_mutex_destroy(&LOCK_manager);
   (void) pthread_mutex_destroy(&LOCK_crypt);
-  (void) pthread_mutex_destroy(&LOCK_bytes_sent);
-  (void) pthread_mutex_destroy(&LOCK_bytes_received);
   (void) pthread_mutex_destroy(&LOCK_user_conn);
   (void) pthread_mutex_destroy(&LOCK_connection_count);
   Events::destroy_mutexes();
@@ -3703,7 +3700,6 @@ static int init_thread_environment()
 {
   (void) pthread_mutex_init(&LOCK_mysql_create_db,MY_MUTEX_INIT_SLOW);
   (void) pthread_mutex_init(&LOCK_lock_db,MY_MUTEX_INIT_SLOW);
-  (void) pthread_mutex_init(&LOCK_Acl,MY_MUTEX_INIT_SLOW);
   (void) pthread_mutex_init(&LOCK_open, NULL);
   (void) pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST);
   (void) pthread_mutex_init(&LOCK_mapped_file,MY_MUTEX_INIT_SLOW);
@@ -3714,8 +3710,6 @@ static int init_thread_environment()
   (void) pthread_mutex_init(&LOCK_delayed_create,MY_MUTEX_INIT_SLOW);
   (void) pthread_mutex_init(&LOCK_manager,MY_MUTEX_INIT_FAST);
   (void) pthread_mutex_init(&LOCK_crypt,MY_MUTEX_INIT_FAST);
-  (void) pthread_mutex_init(&LOCK_bytes_sent,MY_MUTEX_INIT_FAST);
-  (void) pthread_mutex_init(&LOCK_bytes_received,MY_MUTEX_INIT_FAST);
   (void) pthread_mutex_init(&LOCK_user_conn, MY_MUTEX_INIT_FAST);
   (void) pthread_mutex_init(&LOCK_active_mi, MY_MUTEX_INIT_FAST);
   (void) pthread_mutex_init(&LOCK_global_system_variables, MY_MUTEX_INIT_FAST);

=== modified file 'sql/net_serv.cc'
--- a/sql/net_serv.cc	2008-10-02 12:08:09 +0000
+++ b/sql/net_serv.cc	2008-10-24 03:46:27 +0000
@@ -97,7 +97,6 @@ void sql_print_error(const char *format,
 */
 extern uint test_flags;
 extern ulong bytes_sent, bytes_received, net_big_packet_count;
-extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received;
 #ifndef MYSQL_INSTANCE_MANAGER
 #ifdef HAVE_QUERY_CACHE
 #define USE_QUERY_CACHE

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2008-10-20 19:13:22 +0000
+++ b/sql/sql_select.cc	2008-10-30 18:02:08 +0000
@@ -570,7 +570,7 @@ JOIN::prepare(Item ***rref_pointer_array
           4. Subquery does not use aggregate functions or HAVING
           5. Subquery predicate is at the AND-top-level of ON/WHERE clause
           6. No execution method was already chosen (by a prepared statement).
-
+          7. Parent SELECT is not a confluent "SELECT ... FROM DUAL" w/o tables
           (*). We are not in a subquery of a single table UPDATE/DELETE that 
                doesn't have a JOIN (TODO: We should handle this at some
                point by switching to multi-table UPDATE/DELETE)
@@ -586,7 +586,8 @@ JOIN::prepare(Item ***rref_pointer_array
           select_lex->outer_select()->join &&                           //
(*)
           select_lex->master_unit()->first_select()->leaf_tables &&    
// (**) 
           do_semijoin &&
-          in_subs->exec_method == Item_in_subselect::NOT_TRANSFORMED)   // 6
+          in_subs->exec_method == Item_in_subselect::NOT_TRANSFORMED && // 6
+          select_lex->outer_select()->leaf_tables)                     // 7
       {
         DBUG_PRINT("info", ("Subquery is semi-join conversion candidate"));
 
@@ -634,6 +635,11 @@ JOIN::prepare(Item ***rref_pointer_array
           2. Subquery is a single SELECT (not a UNION)
           3. Subquery is not a table-less query. In this case there is no
              point in materializing.
+          3A The upper query is not a confluent SELECT ... FROM DUAL. We
+             can't do materialization for SELECT .. FROM DUAL because it
+             does not call setup_subquery_materialization(). We could make 
+             SELECT ... FROM DUAL call that function but that doesn't seem
+             to be the case that is worth handling.
           4. Subquery predicate is a top-level predicate
              (this implies it is not negated)
              TODO: this is a limitation that should be lifeted once we
@@ -660,7 +666,8 @@ JOIN::prepare(Item ***rref_pointer_array
             in_subs  &&                                                   // 1
             !select_lex->master_unit()->first_select()->next_select() &&
 // 2
             select_lex->master_unit()->first_select()->leaf_tables &&   
 // 3
-            thd->lex->sql_command == SQLCOM_SELECT)                       // *
+            thd->lex->sql_command == SQLCOM_SELECT &&                    
// *
+            select_lex->outer_select()->leaf_tables)                      // 3A
         {
           if (in_subs->is_top_level_item() &&                             // 4
               !in_subs->is_correlated &&                                  // 5
@@ -2431,8 +2438,7 @@ JOIN::exec()
     if (!items1)
     {
       items1= items0 + all_fields.elements;
-      if (sort_and_group || curr_tmp_table->group ||
-          tmp_table_param.precomputed_group_by)
+      if (sort_and_group || curr_tmp_table->group)
       {
 	if (change_to_use_tmp_fields(thd, items1,
 				     tmp_fields_list1, tmp_all_fields1,
@@ -3628,10 +3634,10 @@ bool find_eq_ref_candidate(TABLE *table,
      - It is accessed 
 
     POSTCONDITIONS
-     * Pulled out tables have JOIN_TAB::emb_sj_nest == NULL (like the outer
-       tables)
-     * Tables that were not pulled out have JOIN_TAB::emb_sj_nest.
-     * Semi-join nests TABLE_LIST::sj_inner_tables
+     * Tables that were pulled out have JOIN_TAB::emb_sj_nest == NULL
+     * Tables that were not pulled out have JOIN_TAB::emb_sj_nest pointing 
+       to semi-join nest they are in.
+     * Semi-join nests' TABLE_LIST::sj_inner_tables is updated accordingly
 
     This operation is (and should be) performed at each PS execution since
     tables may become/cease to be constant across PS reexecutions.
@@ -11701,8 +11707,6 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
   ENGINE_COLUMNDEF *recinfo;
   uint total_uneven_bit_length= 0;
   bool force_copy_fields= param->force_copy_fields;
-  /* Treat sum functions as normal ones when loose index scan is used. */
-  save_sum_fields|= param->precomputed_group_by;
   DBUG_ENTER("create_tmp_table");
   DBUG_PRINT("enter",
              ("distinct: %d  save_sum_fields: %d  rows_limit: %lu  group: %d",
@@ -13004,8 +13008,7 @@ static bool create_internal_tmp_table(TA
 bool create_internal_tmp_table_from_heap(THD *thd, TABLE *table,
                                          ENGINE_COLUMNDEF *start_recinfo,
                                          ENGINE_COLUMNDEF **recinfo, 
-                                         int error,
-                                         bool ignore_last_dupp_key_error)
+                                         int error, bool ignore_last_dupp_key_error)
 {
   return create_internal_tmp_table_from_heap2(thd, table,
                                               start_recinfo, recinfo, error,
@@ -15916,7 +15919,11 @@ test_if_skip_sort_order(JOIN_TAB *tab,OR
       if (table->covering_keys.is_set(ref_key))
 	usable_keys.intersect(table->covering_keys);
       if (tab->pre_idx_push_select_cond)
-        tab->select_cond= tab->select->cond= tab->pre_idx_push_select_cond;
+      {
+        tab->select_cond= tab->pre_idx_push_select_cond;
+        if (tab->select)
+          tab->select->cond= tab->select_cond;
+      }
       if ((new_ref_key= test_if_subkey(order, table, ref_key, ref_key_parts,
 				       &usable_keys)) < MAX_KEY)
       {
@@ -16184,7 +16191,12 @@ test_if_skip_sort_order(JOIN_TAB *tab,OR
             table->key_read= 0;
             table->file->extra(HA_EXTRA_NO_KEYREAD);
           }
-
+          if (tab->pre_idx_push_select_cond)
+          {
+            if (tab->select)
+              tab->select->cond= tab->select_cond;
+            tab->select_cond= tab->pre_idx_push_select_cond;
+          }
           table->file->ha_index_or_rnd_end();
           if (join->select_options & SELECT_DESCRIBE)
           {

=== modified file 'sql/sql_select.h'
--- a/sql/sql_select.h	2008-09-04 18:30:34 +0000
+++ b/sql/sql_select.h	2008-10-24 03:46:27 +0000
@@ -683,7 +683,7 @@ public:
   bool send_row_on_empty_set()
   {
     return (do_send_rows && tmp_table_param.sum_func_count != 0 &&
-	    !group_list);
+	    !group_list && having_value != Item::COND_FALSE);
   }
   bool change_result(select_result *result);
   bool is_top_level_join() const

=== modified file 'storage/falcon/BlobReference.cpp'
--- a/storage/falcon/BlobReference.cpp	2008-06-19 15:09:45 +0000
+++ b/storage/falcon/BlobReference.cpp	2008-10-31 15:42:42 +0000
@@ -157,5 +157,5 @@ int BlobReference::getReference(int size
 	for (n = 0; n < 64; n += 8)
 		*q++ = (UCHAR) (blobId >> n);
 
-	return q - buffer;
+	return (int)(q - buffer);
 }

=== modified file 'storage/falcon/Cache.cpp'
--- a/storage/falcon/Cache.cpp	2008-10-30 00:22:54 +0000
+++ b/storage/falcon/Cache.cpp	2008-10-31 15:42:42 +0000
@@ -852,7 +852,7 @@ void Cache::ioThread(void)
 						
 					flushLock.unlock();
 					//Log::debug(" %d Writing %s %d pages: %d - %d\n", thread->threadId, (const
char*) dbb->fileName, count, pageNumber, pageNumber + count - 1);
-					int length = p - buffer;
+					int length = (int)(p - buffer);
 					priority.schedule(PRIORITY_LOW);
 					
 					try

=== modified file 'storage/falcon/CollationCaseless.cpp'
--- a/storage/falcon/CollationCaseless.cpp	2008-05-14 18:39:57 +0000
+++ b/storage/falcon/CollationCaseless.cpp	2008-10-31 15:42:42 +0000
@@ -98,7 +98,7 @@ int CollationCaseless::makeKey(Value *va
 	while (q > p && q [-1] == ' ')
 		--q;
 
-	l = q - p;
+	l = (int)(q - p);
 
 	for (int n = 0; n < l; ++n)
 		p [n] = caseTable [p [n]];

=== modified file 'storage/falcon/DateTime.cpp'
--- a/storage/falcon/DateTime.cpp	2008-06-19 15:09:45 +0000
+++ b/storage/falcon/DateTime.cpp	2008-10-31 15:42:42 +0000
@@ -626,7 +626,7 @@ int DateTime::lookup(const char *string,
 
 	for (const char **tbl = table; *tbl; ++tbl)
 		if (match (temp, *tbl))
-			return tbl - table;
+			return (int)(tbl - table);
 
 	return -1;
 }
@@ -660,7 +660,7 @@ int DateTime::getString(int length, char
 			  time.tm_mon + 1, 
 			  time.tm_mday);
 
-	return strlen (buffer);
+	return (int)strlen(buffer);
 }
 
 
@@ -1056,7 +1056,7 @@ int DateTime::compare(DateTime when)
 
 DateTime DateTime::convert(const char *string)
 {
-	return convert (string, strlen (string));
+	return convert (string, (int)strlen (string));
 }
 
 const char* DateTime::getTimeZone()
@@ -1143,7 +1143,7 @@ int Time::getString(int length, char *bu
 			  time.tm_min, 
 			  time.tm_sec);
 
-	return strlen (buffer);
+	return (int)strlen (buffer);
 }
 
 const TimeZone* DateTime::findTimeZone(const char *string)

=== modified file 'storage/falcon/DeferredIndexWalker.cpp'
--- a/storage/falcon/DeferredIndexWalker.cpp	2008-10-16 02:53:35 +0000
+++ b/storage/falcon/DeferredIndexWalker.cpp	2008-11-03 00:33:04 +0000
@@ -110,10 +110,16 @@ DINode* DeferredIndexWalker::next(void)
 		{
 		nodePending = false;
 
-		return currentNode = (slot >= leaf->count) ? NULL : leaf->nodes[slot];
+		if (slot < leaf->count)
+			return (currentNode = leaf->nodes[slot]);
+
+		if (!deferredIndex->levels)
+			return NULL;  // Only one bucket and it is empty
+		// else the first leaf is empty.  Back up a level.
 		}
+	else
+		++slot;
 
-	++slot;
 	DIBucket *bucket;
 		
 	for (;;)

=== modified file 'storage/falcon/EditString.cpp'
--- a/storage/falcon/EditString.cpp	2008-05-14 18:39:57 +0000
+++ b/storage/falcon/EditString.cpp	2008-10-31 15:42:42 +0000
@@ -367,8 +367,8 @@ char* EditString::formatString(Value * v
 {
 	char		*temp;
 	const char	*from = value->getString (&temp);
-	int			fromLength = strlen (from);
-	int			fpos = 0, tpos = 0;
+	size_t		fromLength = strlen (from);
+	size_t		fpos = 0, tpos = 0;
 	char		c;
 	reset();
 

=== modified file 'storage/falcon/EncodedDataStream.cpp'
--- a/storage/falcon/EncodedDataStream.cpp	2008-05-30 15:40:29 +0000
+++ b/storage/falcon/EncodedDataStream.cpp	2008-10-31 15:42:42 +0000
@@ -1358,7 +1358,7 @@ void EncodedDataStream::encodeOpaque(int
 void EncodedDataStream::encodeEncoding(const UCHAR *encodedValue)
 {
 	const UCHAR *p = skip(encodedValue);
-	stream->putSegment(p - encodedValue, (const char*) encodedValue, true);
+	stream->putSegment((int)(p - encodedValue), (const char*) encodedValue, true);
 }
 
 INT64 EncodedDataStream::getInt64(int requiredScale)

=== modified file 'storage/falcon/Filter.cpp'
--- a/storage/falcon/Filter.cpp	2008-05-14 18:39:57 +0000
+++ b/storage/falcon/Filter.cpp	2008-10-31 15:42:42 +0000
@@ -133,7 +133,7 @@ int Filter::getWord(int bufferLength, ch
 
 	*q = 0;
 
-	return q - buffer;
+	return (int)(q - buffer);
 }
 
 void Filter::start()

=== modified file 'storage/falcon/FilterSet.cpp'
--- a/storage/falcon/FilterSet.cpp	2008-05-14 18:39:57 +0000
+++ b/storage/falcon/FilterSet.cpp	2008-10-31 15:42:42 +0000
@@ -152,5 +152,5 @@ JString FilterSet::stripSQL(const char *
 	while (end > sql && end [-1] != ')')
 		--end;
 
-	return JString (sql, end - sql);
+	return JString (sql, (int)(end - sql));
 }

=== modified file 'storage/falcon/FsbSort.cpp'
--- a/storage/falcon/FsbSort.cpp	2008-05-14 18:39:57 +0000
+++ b/storage/falcon/FsbSort.cpp	2008-10-31 15:42:42 +0000
@@ -69,7 +69,7 @@ FsbSort::FsbSort(CompiledStatement *stat
 
 	int *ptr = contextIds;
 	getStreams(&ptr);
-	numberContexts = ptr - contextIds;
+	numberContexts = (int)(ptr - contextIds);
 }
 
 FsbSort::~FsbSort()

=== modified file 'storage/falcon/IO.cpp'
--- a/storage/falcon/IO.cpp	2008-09-11 10:56:00 +0000
+++ b/storage/falcon/IO.cpp	2008-10-31 00:29:13 +0000
@@ -117,6 +117,19 @@ static char baseDir[PATH_MAX+1]={0};
 bool deleteFilesOnExit = false;
 bool inCreateDatabase = false;
 
+#ifdef _WIN32
+static int winUnlink(const char *file);
+static int winOpen(const char *filename, int flags,...);
+#endif
+
+#ifdef _WIN32
+#define POSIX_OPEN_FILE winOpen
+#define POSIX_UNLINK_FILE winUnlink
+#else
+#define POSIX_OPEN_FILE   ::open
+#define POSIX_UNLINK_FILE ::unlink
+#endif
+
 #ifdef _DEBUG
 #undef THIS_FILE
 static const char THIS_FILE[]=__FILE__;
@@ -186,7 +199,7 @@ bool IO::openFile(const char * name, boo
 	ASSERT(!inCreateDatabase);
 
 	fileName = getPath(name);
-	fileId = ::open (fileName, (readOnly) ? (O_RDONLY | O_BINARY) : (O_RDWR | O_BINARY));
+	fileId = POSIX_OPEN_FILE(fileName, (readOnly) ? (O_RDONLY | O_BINARY) : (O_RDWR |
O_BINARY));
 
 	if (fileId < 0)
 		{
@@ -241,7 +254,7 @@ bool IO::createFile(const char *name)
 	Log::debug("IO::createFile: creating file \"%s\"\n", name);
 
 	fileName = getPath(name);
-	fileId = ::open (fileName.getString(),O_CREAT | O_RDWR | O_RANDOM | O_EXCL | O_BINARY,
+	fileId = POSIX_OPEN_FILE (fileName.getString(),O_CREAT | O_RDWR | O_RANDOM | O_EXCL |
O_BINARY,
 						S_IREAD | S_IWRITE | S_IRGRP | S_IWGRP);
 
 
@@ -557,6 +570,7 @@ void IO::writeHeader(Hdr *header)
 void IO::deleteFile()
 {
 	deleteFile(fileName);
+	fileName="";
 }
 
 int IO::pread(int64 offset, int length, UCHAR* buffer)
@@ -675,10 +689,132 @@ void IO::sync(void)
 		traceOperation(TRACE_SYNC_END);
 }
 
+#ifdef _WIN32
+#define FALCON_DELETED_FILE "fdf"
+
+/*
+	The only safe way to delete file on Windows without invalidating open file 
+	handles is that:
+	- rename file to be deleted to a unique temporary name.
+	- open file it with FILE_FLAG_DELETE_ON_CLOSE
+	- close the file handle
+	Temp file will disappear as soon as last handle on it is closed.
+	This works only if files are opened with FILE_SHARE_DELETE flag.
+*/
+
+static int winUnlink(const char *file)
+{
+	DWORD attributes = GetFileAttributes(file);
+
+	// Bail out, if file does not exist.
+	if (attributes == INVALID_FILE_ATTRIBUTES)
+		return -1;
+
+	// If file is a symbolic link, just delete the link, but not the link target
+	if (attributes & FILE_ATTRIBUTE_REPARSE_POINT)
+		{
+		if(DeleteFile(file))
+			return 0;
+		return -1;
+		}
+
+	// Rename the file to unique name, then open with FILE_FLAG_DELETE_ON_CLOSE
+	// and close.
+	char  tmpDir[MAX_PATH];
+	strncpy(tmpDir, file, sizeof(tmpDir)-1);
+	char *p = strrchr(tmpDir ,SEPARATOR);
+	if (p)
+		*p = 0;
+	else
+		strcpy(tmpDir,".");
+
+	char  tmpFile[MAX_PATH];
+	if (GetTempFileName(tmpDir, FALCON_DELETED_FILE, 0, tmpFile))
+		{
+		if (MoveFileEx(file, tmpFile, MOVEFILE_REPLACE_EXISTING))
+			{
+			HANDLE hFile = CreateFile(tmpFile, 0,
+				FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
+				NULL, OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, NULL);
+
+			if (hFile != INVALID_HANDLE_VALUE)
+				{
+				CloseHandle(hFile);
+				return 0;
+				}
+			}
+		else
+			DeleteFile(tmpFile);
+		}
+	
+	// Something went wrong. Try DeleteFile(), even if it can invalidate
+	// open file handles.
+	if(DeleteFile(file))
+		return 0;
+
+	return -1;
+}
+
+/* 
+	A wrapper for Posix open(). The reason it is there is the FILE_SHARE_DELETE 
+	flag used in CreateFile, which allows for  posixly-correct unlink
+	(that works with open files)
+*/
+static int winOpen(const char *filename, int flags,...)
+{
+	DWORD access;
+	if (flags & O_WRONLY)
+		access = GENERIC_WRITE;
+	else if (flags & O_RDWR)
+		access = GENERIC_READ|GENERIC_WRITE;
+	else
+		access = GENERIC_READ;
+
+	DWORD disposition;
+	if (flags & O_CREAT)
+		disposition = CREATE_NEW;
+	else
+		disposition = OPEN_EXISTING;
+
+	DWORD attributes;
+	if (flags & O_RANDOM)
+		attributes = FILE_FLAG_RANDOM_ACCESS;
+	else
+		attributes = FILE_ATTRIBUTE_NORMAL;
+
+	HANDLE hFile = CreateFile(filename, access, 
+		FILE_SHARE_DELETE, NULL, disposition, attributes, NULL);
+	
+	if (hFile == INVALID_HANDLE_VALUE)
+		{
+		switch(GetLastError())
+			{
+			case ERROR_ACCESS_DENIED:
+				errno = EACCES;
+				break;
+			case ERROR_FILE_NOT_FOUND:
+			case ERROR_PATH_NOT_FOUND:
+				errno = ENOENT;
+				break;
+			default:
+				errno = EINVAL;
+				break;
+			}
+		return -1;
+		}
+	return _open_osfhandle((intptr_t)hFile, 
+		flags & (_O_APPEND|_O_RDONLY|_O_TEXT));
+}
+
+#endif
+
 void IO::deleteFile(const char* fileName)
 {
-	JString path = getPath(fileName);
-	unlink(path.getString());
+	if(fileName && *fileName)
+		{
+		JString path = getPath(fileName);
+		POSIX_UNLINK_FILE(path.getString());
+		}
 }
 
 void IO::tracePage(Bdb* bdb)
@@ -810,3 +946,4 @@ uint16 IO::computeChecksum(Page *page, s
 	return (uint16) sum;
 
 }
+

=== modified file 'storage/falcon/IndexRootPage.cpp'
--- a/storage/falcon/IndexRootPage.cpp	2008-08-25 22:09:13 +0000
+++ b/storage/falcon/IndexRootPage.cpp	2008-10-31 15:42:42 +0000
@@ -1198,7 +1198,7 @@ void IndexRootPage::positionIndex(Dbb* d
 		offset = page->computePrefix (key, highKey);
 		}
 
-	walkIndex->setNodes(page->nextPage, page->length - ((UCHAR*) node.node -
(UCHAR*) page->nodes), node.node);
+	walkIndex->setNodes(page->nextPage, page->length - (int)((UCHAR*) node.node -
(UCHAR*) page->nodes), node.node);
 	bdb->release(REL_HISTORY);
 }
 

=== modified file 'storage/falcon/MemMgr.cpp'
--- a/storage/falcon/MemMgr.cpp	2008-08-20 16:28:44 +0000
+++ b/storage/falcon/MemMgr.cpp	2008-11-03 00:34:05 +0000
@@ -55,7 +55,7 @@
 #include "LogStream.h"
 #endif
 
-static const int guardBytes = sizeof(long); // * 2048;
+static const size_t guardBytes = sizeof(long); // * 2048;
 
 #ifndef ASSERT
 #define ASSERT
@@ -112,7 +112,7 @@ struct Client {
 	};
 
 #ifdef _DEBUG
-	void* MemMgrPoolAllocateDebug (MemMgr *pool, unsigned int s, const char *file, int line)
+	void* MemMgrPoolAllocateDebug (MemMgr *pool, size_t s, const char *file, int line)
 	{
 		void *object = pool->allocateDebug(s, file, line);
 
@@ -120,12 +120,12 @@ struct Client {
 			printf("MemMgrAllocateDebug at %p\n", stopAddress);
 
 		if (traceFile)
-			fprintf(traceFile, "a %d %p\n", s, object);
+			fprintf(traceFile, "a " I64FORMAT " %p\n", (int64)s, object);
 
 		return object;
 	}
 
-	void* MemMgrAllocateDebug (unsigned int s, const char *file, int line)
+	void* MemMgrAllocateDebug (size_t s, const char *file, int line)
 	{
 		if(!memoryManagerAlive)
 			return malloc(s);
@@ -136,7 +136,7 @@ struct Client {
 			printf("MemMgrAllocateDebug at %p\n", stopAddress);
 
 		if (traceFile)
-			fprintf(traceFile, "a %d %p\n", s, object);
+			fprintf(traceFile, "a " I64FORMAT " %p\n", (int64)s, object);
 
 		return object;
 	}
@@ -159,7 +159,7 @@ struct Client {
 		memoryManager.releaseDebug (object);
 	}
 
-	void* MemMgrRecordAllocate (int size, const char *file, int line)
+	void* MemMgrRecordAllocate (size_t size, const char *file, int line)
 	{
 		return recordManager.allocateDebug (size, file, line);
 	}
@@ -169,12 +169,12 @@ struct Client {
 		recordManager.releaseDebug (record);
 	}
 #else
-	void* MemMgrPoolAllocate (MemMgr *pool, unsigned int s)
+	void* MemMgrPoolAllocate (MemMgr *pool, size_t s)
 	{
 		return pool->allocate (s);
 	}
 
-	void* MemMgrAllocate (unsigned int s)
+	void* MemMgrAllocate (size_t s)
 	{
 		if(!memoryManagerAlive)
 			return malloc(s);
@@ -190,7 +190,7 @@ struct Client {
 			memoryManager.release (object);
 	}
 
-	void* MemMgrRecordAllocate (int size, const char *file, int line)
+	void* MemMgrRecordAllocate (size_t size, const char *file, int line)
 	{
 		return recordManager.allocate (size);
 	}
@@ -346,10 +346,12 @@ MemMgr::~MemMgr(void)
 		*isAlive = false;
 }
 
-MemBlock* MemMgr::alloc(int length)
+MemBlock* MemMgr::alloc(size_t s)
 {
-	if (length <= 0)
-		throw SQLError (RUNTIME_ERROR, "illegal memory allocate for %d bytes", length);
+	if (s > INT_MAX)
+		throw SQLError (RUNTIME_ERROR, "illegal memory allocate for " I64FORMAT " bytes",
(int64)s);
+
+	int length = (int) s;
 
 	Sync sync (&mutex, "MemMgr::alloc");
 	sync.lock(Exclusive);
@@ -522,9 +524,9 @@ MemBlock* MemMgr::alloc(int length)
 	return block;
 }
 
-void* MemMgr::allocate(int size)
+void* MemMgr::allocate(size_t size)
 {
-	int length = ROUNDUP(size, roundingSize) + OFFSET(MemBlock*, body) + guardBytes;
+	size_t length = ROUNDUP(size, roundingSize) + OFFSET(MemBlock*, body) + guardBytes;
 	MemBlock *memory;
 
 	ASSERT(signature == defaultSignature);
@@ -547,9 +549,9 @@ void* MemMgr::allocate(int size)
 	return &memory->body;
 }
 
-void* MemMgr::allocateDebug(int size, const char* fileName, int line)
+void* MemMgr::allocateDebug(size_t size, const char* fileName, int line)
 {
-	int length = ROUNDUP(size, roundingSize) + OFFSET(MemBlock*, body) + guardBytes;
+	size_t length = ROUNDUP(size, roundingSize) + OFFSET(MemBlock*, body) + guardBytes;
 	MemBlock *memory;
 
 	ASSERT(signature == defaultSignature);
@@ -563,7 +565,7 @@ void* MemMgr::allocateDebug(int size, co
 #endif
 
 	memset (&memory->body, INIT_BYTE, size);
-	int l = ABS(memory->length) - size - OFFSET(MemBlock*,body);
+	size_t l = ABS(memory->length) - size - OFFSET(MemBlock*,body);
 	ASSERT(l >= guardBytes && l < length - size + guardBytes + (int) sizeof
(MemFreeBlock));
 	memset (&memory->body + size, GUARD_BYTE, l);
 	++blocksAllocated;

=== modified file 'storage/falcon/MemMgr.h'
--- a/storage/falcon/MemMgr.h	2008-08-06 11:53:21 +0000
+++ b/storage/falcon/MemMgr.h	2008-10-31 15:42:42 +0000
@@ -19,6 +19,7 @@
 
 #include "Mutex.h"
 #include "SyncObject.h"
+#include <limits.h>
 
 
 #ifndef MEM_DEBUG
@@ -135,12 +136,12 @@ public:
 	friend void  MemMgrLogDump();
 
 protected:
-	MemBlock*	alloc(int size);
+	MemBlock*	alloc(size_t size);
 	static void	corrupt(const char* text);
 	
 public:
-	void*		allocate(int size);
-	void*		allocateDebug(int size, const char* fileName, int line);
+	void*		allocate(size_t size);
+	void*		allocateDebug(size_t size, const char* fileName, int line);
 	void		releaseBlock(MemBlock *block);
 	void		validateBlock(MemBlock *block);
 	void		analyze (int mask, Stream *stream, InfoTable *summaryTable, InfoTable
*detailTable);

=== modified file 'storage/falcon/MemoryManager.h'
--- a/storage/falcon/MemoryManager.h	2008-09-14 20:12:37 +0000
+++ b/storage/falcon/MemoryManager.h	2008-10-31 15:42:42 +0000
@@ -43,35 +43,35 @@ class MemMgr;
 struct MemObject;
 
 #ifdef _DEBUG
-	extern void* MemMgrAllocateDebug (unsigned int s, const char *file, int line);
-	extern void* MemMgrPoolAllocateDebug (MemMgr *pool, unsigned int s, const char *file,
int line);
+	extern void* MemMgrAllocateDebug (size_t s, const char *file, int line);
+	extern void* MemMgrPoolAllocateDebug (MemMgr *pool, size_t s, const char *file, int
line);
 	
 	WINSTATIC ALWAYS_INLINE void* operator new(size_t s) THROWS_BAD_ALLOC
-		{ return MemMgrAllocateDebug ((unsigned int) s, __FILE__, __LINE__); }
+		{ return MemMgrAllocateDebug (s, __FILE__, __LINE__); }
 		
 	WINSTATIC ALWAYS_INLINE void* operator new(size_t s, const int  &n) 
-		{ return MemMgrAllocateDebug ((unsigned int) s, __FILE__, __LINE__); }
+		{ return MemMgrAllocateDebug (s, __FILE__, __LINE__); }
 		
 	WINSTATIC ALWAYS_INLINE void* operator new(size_t s, const char *file, int line) 
-		{ return MemMgrAllocateDebug ((unsigned int) s, file, line); }
+		{ return MemMgrAllocateDebug (s, file, line); }
 		
 	WINSTATIC ALWAYS_INLINE void* operator new[](size_t s) THROWS_BAD_ALLOC
-		{ return MemMgrAllocateDebug ((unsigned int) s, __FILE__, __LINE__); }
+		{ return MemMgrAllocateDebug (s, __FILE__, __LINE__); }
 		
 	WINSTATIC ALWAYS_INLINE void* operator new[](size_t s, const char *file, int line)
THROWS_BAD_ALLOC
-		{ return MemMgrAllocateDebug ((unsigned int) s, file, line); }
+		{ return MemMgrAllocateDebug (s, file, line); }
 
 	WINSTATIC ALWAYS_INLINE void* operator new(size_t s, MemMgr *pool) THROWS_BAD_ALLOC
-		{ return MemMgrPoolAllocateDebug (pool, (unsigned int) s, __FILE__, __LINE__); }
+		{ return MemMgrPoolAllocateDebug (pool, s, __FILE__, __LINE__); }
 
 	WINSTATIC ALWAYS_INLINE void* operator new(size_t s, MemMgr *pool, const char *file, int
line) 
-		{ return MemMgrPoolAllocateDebug (pool, (unsigned int) s, file, line); }
+		{ return MemMgrPoolAllocateDebug (pool, s, file, line); }
 		
 	WINSTATIC ALWAYS_INLINE void* operator new[](size_t s, MemMgr *pool) THROWS_BAD_ALLOC
 		{ return MemMgrPoolAllocateDebug (pool, (unsigned int) s, __FILE__, __LINE__); }
 
 	WINSTATIC ALWAYS_INLINE void* operator new[](size_t s, MemMgr *pool, const char *file,
int line) 
-		{ return MemMgrPoolAllocateDebug (pool, (unsigned int) s, file, line); }
+		{ return MemMgrPoolAllocateDebug (pool,  s, file, line); }
 
 #define POOL_NEW(arg) new(arg, THIS_FILE, __LINE__)
 #define NEW	new (THIS_FILE, __LINE__)
@@ -81,8 +81,8 @@ struct MemObject;
 #endif
 
 #else
-	extern void* MemMgrAllocate (unsigned int s);
-	extern void* MemMgrPoolAllocate (MemMgr *pool, unsigned int s);
+	extern void* MemMgrAllocate (size_t s);
+	extern void* MemMgrPoolAllocate (MemMgr *pool, size_t s);
 	
 	WINSTATIC ALWAYS_INLINE void* operator new(size_t s) THROWS_BAD_ALLOC
 		{ return MemMgrAllocate (s); }
@@ -91,7 +91,7 @@ struct MemObject;
 		{ return ::MemMgrPoolAllocate (pool, s); }
 
 	WINSTATIC ALWAYS_INLINE void* operator new[](size_t s, MemMgr *pool) THROWS_BAD_ALLOC
-		{ return ::MemMgrPoolAllocate (pool, s); }
+		{ return ::MemMgrPoolAllocate (pool,s); }
 
 	WINSTATIC ALWAYS_INLINE void* operator new(size_t s, const int  &n) THROWS_BAD_ALLOC
 		{ return ::MemMgrAllocate (s); }
@@ -118,7 +118,7 @@ extern void		MemMgrAnalyze(MemMgrWhat wh
 extern void		MemMgrRelease (void *object);
 extern void		MemMgrValidate (void *object);
 extern void		MemMgrAnalyze(int mask, Stream *stream);
-extern void*	MemMgrRecordAllocate (int size, const char *file, int line);
+extern void*	MemMgrRecordAllocate (size_t size, const char *file, int line);
 extern void		MemMgrRecordDelete (char *record);
 extern void		MemMgrSetMaxRecordMember (long long size);
 extern MemMgr*	MemMgrGetFixedPool (int id);

=== modified file 'storage/falcon/SerialLogFile.cpp'
--- a/storage/falcon/SerialLogFile.cpp	2008-10-16 02:53:35 +0000
+++ b/storage/falcon/SerialLogFile.cpp	2008-11-03 00:34:05 +0000
@@ -367,10 +367,10 @@ void SerialLogFile::zap()
 	// The error is supposedly related to the file size being less than 
 	// page size, so initial size is made 8K just in case we'll ever run on IA64
 	size_t initialSize = MAX(sectorSize, 8192); 
-	UCHAR *junk = new UCHAR[initialSize +sectorSize];
+	UCHAR *junk = new UCHAR[initialSize + sectorSize];
 	UCHAR *buffer = ALIGN(junk, sectorSize);
-	memset(buffer, 0, sectorSize);
-	write(0, sectorSize, (SerialLogBlock*) buffer);
+	memset(buffer, 0, initialSize);
+	write(0, (uint32) initialSize, (SerialLogBlock*) buffer);
 	delete junk;
 }
 

=== modified file 'storage/falcon/Serialize.cpp'
--- a/storage/falcon/Serialize.cpp	2008-02-25 22:27:17 +0000
+++ b/storage/falcon/Serialize.cpp	2008-10-31 15:42:42 +0000
@@ -82,7 +82,7 @@ void Serialize::putInt(int value)
 		*p++ = (value >> (lengthShifts [count])) & 0x7f;
 
 	*p++ = value | LOW_BYTE_FLAG;
-	release(p - data);
+	release((uint)(p - data));
 }
 
 void Serialize::putInt64(int64 value)
@@ -95,7 +95,7 @@ void Serialize::putInt64(int64 value)
 		*p++ = (UCHAR) (value >> (lengthShifts [count])) & 0x7f;
 
 	*p++ = ((UCHAR) value) | LOW_BYTE_FLAG;
-	release(p - data);
+	release((uint)(p - data));
 }
 
 void Serialize::putData(uint length, const UCHAR* data)

=== modified file 'storage/falcon/StorageHandler.cpp'
--- a/storage/falcon/StorageHandler.cpp	2008-10-01 03:13:44 +0000
+++ b/storage/falcon/StorageHandler.cpp	2008-10-31 10:13:58 +0000
@@ -36,8 +36,6 @@
 #include "CmdGen.h"
 #include "Dbb.h"
 #include "Database.h"
-#include "TableSpaceManager.h"
-#include "IOx.h"
 
 #define DICTIONARY_ACCOUNT		"mysql"
 #define DICTIONARY_PW			"mysql"
@@ -505,12 +503,6 @@ int StorageHandler::createTablespace(con
 		return StorageErrorTableSpaceExist;
 		}
 
-	TableSpaceManager *tableSpaceManager =
-		dictionaryConnection->database->tableSpaceManager;
-
-	if (!tableSpaceManager->waitForPendingDrop(filename, 10))
-		// file still exists after waiting for 10 seconds
-		return  StorageErrorTableSpaceDataFileExist;
 
 	try
 		{

=== modified file 'storage/falcon/StorageTableShare.cpp'
--- a/storage/falcon/StorageTableShare.cpp	2008-10-22 20:44:09 +0000
+++ b/storage/falcon/StorageTableShare.cpp	2008-11-05 14:51:37 +0000
@@ -262,7 +262,7 @@ int StorageTableShare::truncateTable(Sto
 	return res;
 }
 
-const char* StorageTableShare::cleanupFieldName(const char* name, char* buffer, int
bufferLength)
+const char* StorageTableShare::cleanupFieldName(const char* name, char* buffer, int
bufferLength, bool doubleQuotes)
 {
 	char *q = buffer;
 	char *end = buffer + bufferLength - 1;
@@ -273,7 +273,11 @@ const char* StorageTableShare::cleanupFi
 		{
 		if (*p == '"')
 			{
-			*q++ = UPPER(*p);
+			if (doubleQuotes)
+				{
+				*q++ = UPPER(*p);
+				}
+
 			quotes = !quotes;
 			}
 	
@@ -321,7 +325,7 @@ char* StorageTableShare::createIndexName
 	else
 		{
 		char nameBuffer[indexNameSize];
-		cleanupFieldName(rawName, nameBuffer, sizeof(nameBuffer));
+		cleanupFieldName(rawName, nameBuffer, sizeof(nameBuffer), true);
 		sprintf(indexName, "%s$%s", name.getString(), nameBuffer);
 		}
 	

=== modified file 'storage/falcon/StorageTableShare.h'
--- a/storage/falcon/StorageTableShare.h	2008-10-22 20:44:09 +0000
+++ b/storage/falcon/StorageTableShare.h	2008-11-05 14:51:37 +0000
@@ -123,7 +123,7 @@ public:
 	virtual INT64		getSequenceValue(int delta);
 	virtual int			setSequenceValue(INT64 value);
 	virtual int			haveIndexes(int indexCount);
-	virtual const char*	cleanupFieldName(const char* name, char* buffer, int bufferLength);
+	virtual const char*	cleanupFieldName(const char* name, char* buffer, int bufferLength,
bool doubleQuotes);
 	virtual void		setTablePath(const char* path, bool tempTable);
 	virtual void		registerCollation(const char* collationName, void* arg);
 

=== modified file 'storage/falcon/StorageVersion.h'
--- a/storage/falcon/StorageVersion.h	2008-10-30 16:13:48 +0000
+++ b/storage/falcon/StorageVersion.h	2008-11-05 15:41:45 +0000
@@ -14,5 +14,5 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 
-#define FALCON_VERSION	"T1.3-2"
-#define FALCON_DATE		"30 October, 2008"
+#define FALCON_VERSION	"T1.3-3"
+#define FALCON_DATE		"05 November, 2008"

=== modified file 'storage/falcon/TableSpaceManager.cpp'
--- a/storage/falcon/TableSpaceManager.cpp	2008-09-22 09:24:39 +0000
+++ b/storage/falcon/TableSpaceManager.cpp	2008-10-31 00:29:13 +0000
@@ -58,7 +58,6 @@ TableSpaceManager::TableSpaceManager(Dat
 	memset(nameHash, 0, sizeof(nameHash));
 	memset(idHash, 0, sizeof(nameHash));
 	tableSpaces = NULL;
-	pendingDrops = 0;
 	syncObject.setName("TableSpaceManager::syncObject");
 }
 
@@ -298,13 +297,14 @@ void TableSpaceManager::dropTableSpace(T
 			break;
 			}
 			
-	pendingDrops++;
 	syncObj.unlock();
+	tableSpace->active = false;
+	JString filename = tableSpace->dbb->fileName;
 
 	database->serialLog->logControl->dropTableSpace.append(tableSpace,
transaction);
 	database->commitSystemTransaction();
+	IO::deleteFile(filename);
 
-	tableSpace->active = false;
 }
 
 void TableSpaceManager::reportStatistics(void)
@@ -370,12 +370,10 @@ void TableSpaceManager::expungeTableSpac
 			}
 
 	sync.unlock();
-	tableSpace->dropTableSpace();
+	//File already deleted, just close the file descriptor
+	tableSpace->close();
 	delete tableSpace;
 
-	sync.lock(Exclusive);
-	if(pendingDrops >0)
-		pendingDrops--;
 }
 
 void TableSpaceManager::reportWrites(void)
@@ -565,26 +563,3 @@ void TableSpaceManager::getTableSpaceFil
 		}
 }
 
-
-// Wait for specified amount of time for a  file to be deleted.
-// Don't wait if pendingDrops count is 0.
-//
-// The function returns true, if wait was successfull, i.e file does not exist
-//(anymore)
-bool TableSpaceManager::waitForPendingDrop(const char  *filename, int seconds)
-{
-	bool fileExists;
-
-	do
-		{
-		fileExists = IO::doesFileExist(filename);
-		if (fileExists && pendingDrops > 0 && seconds-- > 0)
-			Thread::getThread("TransactionManager::waitForPendingDrop")->sleep(1000);
-		else
-			break;
-		}
-	while(true);
-
-	return !fileExists;
-}
-

=== modified file 'storage/falcon/TableSpaceManager.h'
--- a/storage/falcon/TableSpaceManager.h	2008-09-22 09:24:39 +0000
+++ b/storage/falcon/TableSpaceManager.h	2008-10-31 00:29:13 +0000
@@ -63,7 +63,6 @@ public:
 	void			reportWrites(void);
 	void			redoCreateTableSpace(int id, int nameLength, const char* name, int
fileNameLength, const char* fileName, int type, TableSpaceInit* tsInit);
 	void			initialize(void);
-	bool			waitForPendingDrop(const char *filename, int seconds);
 
 	Database	*database;
 	TableSpace	*tableSpaces;
@@ -71,7 +70,6 @@ public:
 	TableSpace	*idHash[TS_HASH_SIZE];
 	SyncObject	syncObject;
 	void postRecovery(void);
-	int pendingDrops;
 };
 
 #endif //
!defined(AFX_TABLESPACEMANAGER_H__BD1D39F6_2201_4136_899C_7CB106E99B8C__INCLUDED_)

=== modified file 'storage/falcon/Transaction.cpp'
--- a/storage/falcon/Transaction.cpp	2008-10-24 05:06:52 +0000
+++ b/storage/falcon/Transaction.cpp	2008-11-03 00:33:04 +0000
@@ -250,7 +250,8 @@ void Transaction::commit()
 
 	TransactionManager *transactionManager = database->transactionManager;
 	addRef();
-	Log::log(LogXARecovery, "%d: Commit transaction %d\n", database->deltaTime,
transactionId);
+	Log::log(LogXARecovery, "%d: Commit %sTransaction %d\n", 
+		database->deltaTime, (systemTransaction ? "System " : ""),  transactionId);
 
 	if (state == Active)
 		{
@@ -340,6 +341,7 @@ void Transaction::commitNoUpdates(void)
 	TransactionManager *transactionManager = database->transactionManager;
 	addRef();
 	ASSERT(!deferredIndexes);
+	Log::log(LogXARecovery, "%d: CommitNoUpdates transaction %d\n", database->deltaTime,
transactionId);
 	++transactionManager->committed;
 	
 	if (deferredIndexes)
@@ -384,6 +386,8 @@ void Transaction::rollback()
 	if (!isActive())
 		throw SQLEXCEPTION (RUNTIME_ERROR, "transaction is not active");
 
+	Log::log(LogXARecovery, "%d: Rollback transaction %d\n", database->deltaTime,
transactionId);
+
 	if (deferredIndexes)
 		releaseDeferredIndexes();
 		
@@ -951,6 +955,9 @@ void Transaction::writeComplete(void)
 	if (dependencies == 0)
 		commitRecords();
 
+//	Log::log(LogXARecovery, "%d: WriteComplete %sTransaction %d\n", 
+// 	database->deltaTime, (systemTransaction ? "System " : ""),  transactionId);
+
 	writePending = false;
 }
 

=== modified file 'storage/falcon/ha_falcon.cpp'
--- a/storage/falcon/ha_falcon.cpp	2008-10-29 23:25:13 +0000
+++ b/storage/falcon/ha_falcon.cpp	2008-11-05 14:51:37 +0000
@@ -344,7 +344,7 @@ uint falcon_strnxfrmlen(void *cs, const 
 	uint chrLen = falcon_strnchrlen(cs, s, srcLen);
 	int maxChrLen = partialKey ? min(chrLen, partialKey / charset->mbmaxlen) : chrLen;
 
-	return min(charset->coll->strnxfrmlen(charset, maxChrLen * charset->mbmaxlen),
(uint) bufSize);
+	return (uint)min(charset->coll->strnxfrmlen(charset, maxChrLen *
charset->mbmaxlen), (uint) bufSize);
 }
 
 // Return the number of bytes used in s to hold a certain number of characters.
@@ -372,7 +372,7 @@ uint falcon_strntrunc(void *cs, int part
 		charLimit--;
 		}
 
-	return ch - (uchar *) s;
+	return (uint)(ch - (uchar *) s);
 }
 
 int falcon_strnncoll(void *cs, const char *s1, uint l1, const char *s2, uint l2, char
flag)
@@ -1805,6 +1805,10 @@ int StorageInterface::error(int storageE
 			                    "Falcon does not support READ UNCOMMITTED ISOLATION, using
REPEATABLE READ instead.");
 			break;
 
+		case StorageErrorIndexOverflow:
+			my_error(ER_TOO_LONG_KEY, MYF(0), max_key_length());
+			break;
+
 		default:
 			;
 		}
@@ -2482,7 +2486,7 @@ int StorageInterface::genTable(TABLE* ta
 		if (charset)
 			storageShare->registerCollation(charset->name, charset);
 
-		storageShare->cleanupFieldName(field->field_name, nameBuffer,
sizeof(nameBuffer));
+		storageShare->cleanupFieldName(field->field_name, nameBuffer, sizeof(nameBuffer),
true);
 		gen->gen("%s  \"%s\" ", sep, nameBuffer);
 		int ret = genType(field, gen);
 
@@ -2628,7 +2632,7 @@ void StorageInterface::genKeyFields(KEY*
 		{
 		KEY_PART_INFO *part = key->key_part + n;
 		Field *field = part->field;
-		storageShare->cleanupFieldName(field->field_name, nameBuffer,
sizeof(nameBuffer));
+		storageShare->cleanupFieldName(field->field_name, nameBuffer, sizeof(nameBuffer),
true);
 
 		if (part->key_part_flag & HA_PART_KEY_SEG)
 			gen->gen("%s\"%s\"(%d)", sep, nameBuffer, part->length);
@@ -3006,10 +3010,10 @@ bool StorageInterface::get_error_message
 	if (storageConnection)
 		{
 		const char *text = storageConnection->getLastErrorString();
-		buf->set(text, strlen(text), system_charset_info);
+		buf->set(text, (uint32)strlen(text), system_charset_info);
 		}
 	else if (errorText)
-		buf->set(errorText, strlen(errorText), system_charset_info);
+		buf->set(errorText, (uint32)strlen(errorText), system_charset_info);
 
 	return false;
 }
@@ -3553,7 +3557,7 @@ void StorageInterface::mapFields(TABLE *
 	for (uint n = 0; n < table->s->fields; ++n)
 		{
 		Field *field = table->field[n];
-		storageShare->cleanupFieldName(field->field_name, nameBuffer,
sizeof(nameBuffer));
+		storageShare->cleanupFieldName(field->field_name, nameBuffer, sizeof(nameBuffer),
false);
 		int id = storageShare->getFieldId(nameBuffer);
 		
 		if (id >= 0)

=== modified file 'storage/falcon/plug.in'
--- a/storage/falcon/plug.in	2008-09-23 09:08:59 +0000
+++ b/storage/falcon/plug.in	2008-11-03 08:56:28 +0000
@@ -4,6 +4,9 @@ MYSQL_PLUGIN_DIRECTORY(falcon, [storage/
 MYSQL_PLUGIN_STATIC(falcon,    [libfalcon.a])
 MYSQL_PLUGIN_DYNAMIC(falcon,   [ha_falcon.la])
 
+# Check if we have the atomic_* functions on Solaris
+AC_CHECK_FUNC(atomic_cas_32, AC_DEFINE([HAVE_SOLARIS_ATOMIC], [1], [Define to 1 if
Solaris support atomic functions.]))
+
 # Check for supported machine types.
 AC_CACHE_CHECK([if Falcon Storage Engine is supported on $MACHINE_TYPE],
   			   falcon_supported_by_machine,[

=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc	2008-10-20 09:16:47 +0000
+++ b/storage/myisam/ha_myisam.cc	2008-10-29 20:39:29 +0000
@@ -1482,7 +1482,6 @@ C_MODE_START
 my_bool index_cond_func_myisam(void *arg)
 {
   ha_myisam *h= (ha_myisam*)arg;
-  /*if (h->in_range_read)*/
   if (h->end_range)
   {
     if (h->compare_key2(h->end_range) > 0)
@@ -1497,7 +1496,6 @@ C_MODE_END
 int ha_myisam::index_init(uint idx, bool sorted)
 { 
   active_index=idx;
-  //in_range_read= FALSE;
   if (pushed_idx_cond_keyno == idx)
     mi_set_index_cond_func(file, index_cond_func_myisam, this);
   return 0; 
@@ -1605,13 +1603,7 @@ int ha_myisam::read_range_first(const ke
                                 bool sorted /* ignored */)
 {
   int res;
-  //if (!eq_range_arg)
-  //  in_range_read= TRUE;
-
   res= handler::read_range_first(start_key, end_key, eq_range_arg, sorted);
-
-  //if (res)
-  //  in_range_read= FALSE;
   return res;
 }
 
@@ -1619,8 +1611,6 @@ int ha_myisam::read_range_first(const ke
 int ha_myisam::read_range_next()
 {
   int res= handler::read_range_next();
-  //if (res)
-  //  in_range_read= FALSE;
   return res;
 }
 

=== modified file 'zlib/gzio.c'
--- a/zlib/gzio.c	2008-08-25 17:14:21 +0000
+++ b/zlib/gzio.c	2008-10-17 15:39:36 +0000
@@ -7,6 +7,11 @@
 
 /* @(#) $Id$ */
 
+/* Need to be included "early" to control other headers */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <stdio.h>
 
 #include "zutil.h"

Thread
bzr push into mysql-6.0-falcon branch (hky:2903 to 2904) Hakan Kuecuekyilmaz5 Nov