List:Commits« Previous MessageNext Message »
From:Satya B Date:December 10 2008 5:30am
Subject:bzr commit into mysql-6.0-bugteam branch (satya.bn:2937)
View as plain text  
#At file:///home/satya/WORK/mysql-6.0-bug-40677/

 2937 Satya B	2008-12-10 [merge]
      merging to latest 6.0-bugteam 
removed:
  mysql-test/suite/parts/r/partition_bit_ndb.result
  mysql-test/suite/parts/t/partition_bit_ndb.test
  mysql-test/suite/parts/t/partition_sessions.test
  mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test
  mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test
added:
  mysql-test/include/have_one-thread-per-connection.inc
  mysql-test/suite/binlog/r/binlog_innodb_row.result
  mysql-test/suite/binlog/t/binlog_innodb_row.test
  mysql-test/suite/sys_vars/r/tmp_table_size_basic.result
  mysql-test/suite/sys_vars/t/tmp_table_size_basic.test
modified:
  client/mysql_upgrade.c
  extra/yassl/include/openssl/ssl.h
  include/config-win.h
  include/my_global.h
  mysql-test/r/alter_table.result
  mysql-test/r/ctype_ldml.result
  mysql-test/r/fulltext.result
  mysql-test/r/func_str.result
  mysql-test/r/innodb_mysql.result
  mysql-test/r/myisampack.result
  mysql-test/r/partition.result
  mysql-test/r/partition_datatype.result
  mysql-test/r/partition_mgm_err.result
  mysql-test/r/type_bit.result
  mysql-test/r/type_float.result
  mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
  mysql-test/suite/funcs_2/t/disabled.def
  mysql-test/suite/ndb/t/disabled.def
  mysql-test/suite/parts/r/partition_bit_innodb.result
  mysql-test/suite/parts/r/partition_bit_myisam.result
  mysql-test/suite/parts/r/partition_mgm_lc0_archive.result
  mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result
  mysql-test/suite/parts/r/partition_mgm_lc0_memory.result
  mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result
  mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result
  mysql-test/suite/parts/r/partition_mgm_lc1_archive.result
  mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result
  mysql-test/suite/parts/r/partition_mgm_lc1_memory.result
  mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result
  mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result
  mysql-test/suite/parts/r/partition_mgm_lc2_archive.result
  mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result
  mysql-test/suite/parts/r/partition_mgm_lc2_memory.result
  mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result
  mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result
  mysql-test/suite/parts/t/disabled.def
  mysql-test/suite/parts/t/partition_value_innodb.test
  mysql-test/suite/parts/t/partition_value_myisam.test
  mysql-test/suite/parts/t/partition_value_ndb.test
  mysql-test/suite/rpl/r/rpl_packet.result
  mysql-test/suite/rpl/r/rpl_row_create_table.result
  mysql-test/suite/rpl/r/rpl_slave_skip.result
  mysql-test/suite/rpl/r/rpl_trigger.result
  mysql-test/suite/rpl/t/rpl_packet.test
  mysql-test/suite/rpl/t/rpl_row_create_table.test
  mysql-test/suite/rpl/t/rpl_slave_skip.test
  mysql-test/suite/rpl/t/rpl_trigger.test
  mysql-test/suite/sys_vars/t/disabled.def
  mysql-test/t/alter_table.test
  mysql-test/t/ctype_ldml.test
  mysql-test/t/disabled.def
  mysql-test/t/fulltext.test
  mysql-test/t/func_str.test
  mysql-test/t/innodb_mysql.test
  mysql-test/t/myisampack.test
  mysql-test/t/partition.test
  mysql-test/t/thread_cache_size_func.test
  mysql-test/t/type_bit.test
  mysql-test/t/type_float.test
  mysys/charset.c
  sql/field.cc
  sql/ha_partition.cc
  sql/ha_partition.h
  sql/item.cc
  sql/item_strfunc.cc
  sql/log.cc
  sql/mysql_priv.h
  sql/mysqld.cc
  sql/share/errmsg.txt
  sql/sql_partition.cc
  sql/sql_select.cc
  sql/sql_show.cc
  sql/sql_table.cc
  sql/table.cc
  storage/myisam/ft_boolean_search.c

=== modified file 'client/mysql_upgrade.c'
--- a/client/mysql_upgrade.c	2008-08-11 22:44:13 +0000
+++ b/client/mysql_upgrade.c	2008-12-09 08:30:49 +0000
@@ -620,6 +620,20 @@ static int run_mysqlcheck_upgrade(void)
 }
 
 
+static int run_mysqlcheck_fixnames(void)
+{
+  verbose("Running 'mysqlcheck'...");
+  return run_tool(mysqlcheck_path,
+                  NULL, /* Send output from mysqlcheck directly to screen */
+                  "--no-defaults",
+                  ds_args.str,
+                  "--all-databases",
+                  "--fix-db-names",
+                  "--fix-table-names",
+                  NULL);
+}
+
+
 static const char *expected_errors[]=
 {
   "ERROR 1060", /* Duplicate column name */
@@ -782,7 +796,8 @@ int main(int argc, char **argv)
   /*
     Run "mysqlcheck" and "mysql_fix_privilege_tables.sql"
   */
-  if (run_mysqlcheck_upgrade() ||
+  if (run_mysqlcheck_fixnames() ||
+      run_mysqlcheck_upgrade() ||
       run_sql_fix_privilege_tables())
   {
     /*

=== modified file 'extra/yassl/include/openssl/ssl.h'
--- a/extra/yassl/include/openssl/ssl.h	2008-11-18 16:45:44 +0000
+++ b/extra/yassl/include/openssl/ssl.h	2008-12-08 17:45:48 +0000
@@ -203,8 +203,8 @@ SSL_CTX* SSL_CTX_new(SSL_METHOD*);
 SSL* SSL_new(SSL_CTX*);
 int  SSL_set_fd (SSL*, YASSL_SOCKET_T);
 YASSL_SOCKET_T SSL_get_fd(const SSL*);
-int  SSL_connect(SSL*);                    // if you get an error from connect
-                                           // see note at top of REAMDE
+int  SSL_connect(SSL*);                    /* if you get an error from connect
+                                              see note at top of REAMDE */
 int  SSL_write(SSL*, const void*, int);
 int  SSL_read(SSL*, void*, int);
 int  SSL_accept(SSL*);

=== modified file 'include/config-win.h'
--- a/include/config-win.h	2008-07-23 08:52:08 +0000
+++ b/include/config-win.h	2008-12-07 17:41:29 +0000
@@ -273,6 +273,15 @@ inline double ulonglong2double(ulonglong
 #define my_off_t2double(A) ulonglong2double(A)
 #endif /* _WIN64 */
 
+inline ulonglong double2ulonglong(double d)
+{
+  double t= d - (double) 0x8000000000000000ULL;
+
+  if (t >= 0)
+    return  ((ulonglong) t) + 0x8000000000000000ULL;
+  return (ulonglong) d;
+}
+
 #if SIZEOF_OFF_T > 4
 #define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C))
 #define tell(A) _telli64(A)

=== modified file 'include/my_global.h'
--- a/include/my_global.h	2008-12-05 01:05:05 +0000
+++ b/include/my_global.h	2008-12-08 12:23:01 +0000
@@ -855,6 +855,9 @@ typedef SOCKET_SIZE_TYPE size_socket;
 #define ulonglong2double(A) ((double) (ulonglong) (A))
 #define my_off_t2double(A)  ((double) (my_off_t) (A))
 #endif
+#ifndef double2ulonglong
+#define double2ulonglong(A) ((ulonglong) (double) (A))
+#endif
 #endif
 
 #ifndef offsetof

=== added file 'mysql-test/include/have_one-thread-per-connection.inc'
--- a/mysql-test/include/have_one-thread-per-connection.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/have_one-thread-per-connection.inc	2008-12-09 12:05:13 +0000
@@ -0,0 +1,11 @@
+# Created 2008-12-04 HHunger
+# Check the System variable "thread_handling".
+--disable_query_log
+# Check if thread_handling= one-thread-per-connection
+let $no_needed_threads= `SELECT @@GLOBAL.thread_handling != 'one-thread-per-connection'`;
+if ($no_needed_threads)
+{
+  skip Test needs thread_handling=one-thread-per-connection;
+}
+--enable_query_log
+

=== modified file 'mysql-test/r/alter_table.result'
--- a/mysql-test/r/alter_table.result	2008-11-06 18:39:27 +0000
+++ b/mysql-test/r/alter_table.result	2008-12-09 14:05:03 +0000
@@ -996,6 +996,22 @@ SELECT * FROM t1;
 v	b
 abc	5
 DROP TABLE t1;
+create table t1 (a tinytext character set latin1);
+alter table t1 convert to character set utf8;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` text
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+drop table t1;
+create table t1 (a mediumtext character set latin1);
+alter table t1 convert to character set utf8;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` longtext
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+drop table t1;
 End of 5.0 tests
 drop table if exists t1, t2, t3;
 create table t1 (i int);

=== modified file 'mysql-test/r/ctype_ldml.result'
--- a/mysql-test/r/ctype_ldml.result	2008-10-31 12:25:42 +0000
+++ b/mysql-test/r/ctype_ldml.result	2008-12-09 08:41:43 +0000
@@ -373,3 +373,10 @@ def	test	t1	t1	c1	c1	254	2	2	Y	0	0	359
 c1
 
 drop table t1;
+CREATE TABLE t1 (s1 char(10) character set utf8 collate utf8_maxuserid_ci);
+INSERT INTO t1 VALUES ('a'),('b');
+SELECT * FROM t1 WHERE s1='a' ORDER BY BINARY s1;
+s1
+a
+b
+DROP TABLE t1;

=== modified file 'mysql-test/r/fulltext.result'
--- a/mysql-test/r/fulltext.result	2008-11-18 13:20:58 +0000
+++ b/mysql-test/r/fulltext.result	2008-12-09 10:16:06 +0000
@@ -522,3 +522,12 @@ WHERE MATCH(a) AGAINST('test' IN BOOLEAN
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ref	b	b	5	const	4	Using where
 DROP TABLE t1;
+CREATE TABLE t1(a CHAR(10));
+INSERT INTO t1 VALUES('aaa15');
+SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE) FROM t1;
+MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE)
+1
+SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1;
+MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE)
+2
+DROP TABLE t1;

=== modified file 'mysql-test/r/func_str.result'
--- a/mysql-test/r/func_str.result	2008-07-14 12:49:19 +0000
+++ b/mysql-test/r/func_str.result	2008-12-09 12:08:02 +0000
@@ -717,8 +717,6 @@ insert(_latin2'abcd',2,3,_latin2'ef'),
 replace(_latin2'abcd',_latin2'b',_latin2'B'),
 encode('abcd','ab')
 ;
-Warnings:
-Warning	1265	Data truncated for column 'format(130,10)' at row 1
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
@@ -727,7 +725,7 @@ t1	CREATE TABLE `t1` (
   `conv(130,16,10)` varchar(64) DEFAULT NULL,
   `hex(130)` varchar(6) NOT NULL DEFAULT '',
   `char(130)` varbinary(4) NOT NULL DEFAULT '',
-  `format(130,10)` varchar(4) NOT NULL DEFAULT '',
+  `format(130,10)` varchar(37) NOT NULL DEFAULT '',
   `left(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
   `right(_latin2'a',1)` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
   `lcase(_latin2'a')` varchar(1) CHARACTER SET latin2 NOT NULL DEFAULT '',
@@ -2513,4 +2511,12 @@ SELECT HEX(c1) from v1;
 HEX(c1)
 414243
 DROP VIEW v1;
+create table t1(a float);
+insert into t1 values (1.33);
+select format(a, 2) from t1;
+Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
+def					format(a, 2)	253	49	4	Y	0	31	8
+format(a, 2)
+1.33
+drop table t1;
 End of 5.0 tests

=== modified file 'mysql-test/r/innodb_mysql.result'
--- a/mysql-test/r/innodb_mysql.result	2008-11-27 15:14:29 +0000
+++ b/mysql-test/r/innodb_mysql.result	2008-12-08 13:44:20 +0000
@@ -1684,3 +1684,88 @@ CREATE INDEX i1 on t1 (a(3));
 SELECT * FROM t1 WHERE a = 'abcde';
 a
 DROP TABLE t1;
+CREATE TABLE foo (a int, b int, c char(10),
+PRIMARY KEY (c(3)),
+KEY b (b)
+) engine=innodb;
+CREATE TABLE foo2 (a int, b int, c char(10),
+PRIMARY KEY (c),
+KEY b (b)
+) engine=innodb;
+CREATE TABLE bar (a int, b int, c char(10),
+PRIMARY KEY (c(3)),
+KEY b (b)
+) engine=myisam;
+INSERT INTO foo VALUES
+(1,2,'abcdefghij'), (2,3,''), (3,4,'klmnopqrst'),
+(4,5,'uvwxyz'), (5,6,'meotnsyglt'), (4,5,'asfdewe');
+INSERT INTO bar SELECT * FROM foo;
+INSERT INTO foo2 SELECT * FROM foo;
+EXPLAIN SELECT c FROM bar WHERE b>2;;
+id	1
+select_type	SIMPLE
+table	bar
+type	ALL
+possible_keys	b
+key	NULL
+key_len	NULL
+ref	NULL
+rows	6
+Extra	Using where
+EXPLAIN SELECT c FROM foo WHERE b>2;;
+id	1
+select_type	SIMPLE
+table	foo
+type	ALL
+possible_keys	b
+key	NULL
+key_len	NULL
+ref	NULL
+rows	6
+Extra	Using where
+EXPLAIN SELECT c FROM foo2 WHERE b>2;;
+id	1
+select_type	SIMPLE
+table	foo2
+type	range
+possible_keys	b
+key	b
+key_len	5
+ref	NULL
+rows	3
+Extra	Using where; Using index
+EXPLAIN SELECT c FROM bar WHERE c>2;;
+id	1
+select_type	SIMPLE
+table	bar
+type	ALL
+possible_keys	PRIMARY
+key	NULL
+key_len	NULL
+ref	NULL
+rows	6
+Extra	Using where
+EXPLAIN SELECT c FROM foo WHERE c>2;;
+id	1
+select_type	SIMPLE
+table	foo
+type	ALL
+possible_keys	PRIMARY
+key	NULL
+key_len	NULL
+ref	NULL
+rows	6
+Extra	Using where
+EXPLAIN SELECT c FROM foo2 WHERE c>2;;
+id	1
+select_type	SIMPLE
+table	foo2
+type	index
+possible_keys	PRIMARY
+key	b
+key_len	5
+ref	NULL
+rows	6
+Extra	Using where; Using index
+DROP TABLE foo, bar, foo2;
+End of 5.1 tests

=== modified file 'mysql-test/r/myisampack.result'
--- a/mysql-test/r/myisampack.result	2007-11-07 08:55:28 +0000
+++ b/mysql-test/r/myisampack.result	2008-12-09 09:04:28 +0000
@@ -27,3 +27,25 @@ CHECK TABLE t1 EXTENDED;
 Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 DROP TABLE t1;
+drop table if exists t1;
+create table t1(f1 int, f2 varchar(255));
+insert into t1 values(1, 'foo'), (2, 'bar');
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+flush tables;
+optimize table t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	error	Table 'test.t1' is read only
+Warnings:
+Error	1036	Table 't1' is read only
+drop table t1;

=== modified file 'mysql-test/r/partition.result'
--- a/mysql-test/r/partition.result	2008-11-24 22:54:28 +0000
+++ b/mysql-test/r/partition.result	2008-12-01 16:11:34 +0000
@@ -1,4 +1,8 @@
 drop table if exists t1, t2;
+CREATE TABLE t1 (a INT, FOREIGN KEY (a) REFERENCES t0 (a))
+ENGINE=MyISAM
+PARTITION BY HASH (a);
+ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning
 CREATE TABLE t1 (
 pk INT NOT NULL AUTO_INCREMENT,
 PRIMARY KEY (pk)

=== modified file 'mysql-test/r/partition_datatype.result'
--- a/mysql-test/r/partition_datatype.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/r/partition_datatype.result	2008-12-09 11:16:39 +0000
@@ -324,7 +324,7 @@ partition by hash (a)
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
-  `a` bit(27) NOT NULL DEFAULT '\0\0\0\0',
+  `a` bit(27) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY HASH (a)

=== modified file 'mysql-test/r/partition_mgm_err.result'
--- a/mysql-test/r/partition_mgm_err.result	2008-11-04 08:36:56 +0000
+++ b/mysql-test/r/partition_mgm_err.result	2008-12-01 16:11:34 +0000
@@ -25,13 +25,13 @@ ALTER TABLE t1 DROP PARTITION x10, x1, x
 ERROR HY000: Error in list of partitions to DROP
 ALTER TABLE t1 REORGANIZE PARTITION x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10 INTO
 (PARTITION x11 VALUES LESS THAN (22));
-ERROR HY000: More partitions to reorganise than there are partitions
+ERROR HY000: More partitions to reorganize than there are partitions
 ALTER TABLE t1 REORGANIZE PARTITION x0,x1,x2 INTO
 (PARTITION x3 VALUES LESS THAN (6));
 ERROR HY000: Duplicate partition name x3
 ALTER TABLE t1 REORGANIZE PARTITION x0, x2 INTO
 (PARTITION x11 VALUES LESS THAN (2));
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE t1 REORGANIZE PARTITION x0, x1, x1 INTO
 (PARTITION x11 VALUES LESS THAN (4));
 ERROR HY000: Error in list of partitions to REORGANIZE

=== modified file 'mysql-test/r/type_bit.result'
--- a/mysql-test/r/type_bit.result	2008-08-28 11:17:29 +0000
+++ b/mysql-test/r/type_bit.result	2008-12-09 14:05:03 +0000
@@ -708,6 +708,47 @@ HEX(b1)	HEX(b2)	i2
 1	0	100
 1	0	200
 DROP TABLE t1, t2;
+CREATE TABLE IF NOT EXISTS t1 (
+f1 bit(2) NOT NULL default b'10',
+f2 bit(14) NOT NULL default b'11110000111100'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `f1` bit(2) NOT NULL DEFAULT b'10',
+  `f2` bit(14) NOT NULL DEFAULT b'11110000111100'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
+DROP TABLE t1;
+CREATE TABLE IF NOT EXISTS t1 (
+f1 bit(2) NOT NULL default b''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+ERROR 42000: Invalid default value for 'f1'
+create table t1bit7 (a1 bit(7) not null) engine=MyISAM;
+create table t2bit7 (b1 bit(7)) engine=MyISAM;
+insert into t1bit7 values (b'1100000');
+insert into t1bit7 values (b'1100001');
+insert into t1bit7 values (b'1100010');
+insert into t2bit7 values (b'1100001');
+insert into t2bit7 values (b'1100010');
+insert into t2bit7 values (b'1100110');
+select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
+bin(a1)
+1100001
+1100010
+drop table t1bit7, t2bit7;
+create table t1bit7 (a1 bit(15) not null) engine=MyISAM;
+create table t2bit7 (b1 bit(15)) engine=MyISAM;
+insert into t1bit7 values (b'110000011111111');
+insert into t1bit7 values (b'110000111111111');
+insert into t1bit7 values (b'110001011111111');
+insert into t2bit7 values (b'110000111111111');
+insert into t2bit7 values (b'110001011111111');
+insert into t2bit7 values (b'110011011111111');
+select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1;
+bin(a1)
+110000111111111
+110001011111111
+drop table t1bit7, t2bit7;
 End of 5.0 tests
 create table t1(a bit(7));
 insert into t1 values(0x40);

=== modified file 'mysql-test/r/type_float.result'
--- a/mysql-test/r/type_float.result	2007-12-08 17:19:16 +0000
+++ b/mysql-test/r/type_float.result	2008-12-09 09:27:28 +0000
@@ -416,4 +416,17 @@ select a+0 from t1;
 a+0
 0.00001225
 drop table t1;
+create table t1(d double, u bigint unsigned);
+insert into t1(d) values (9.223372036854775808e+18),
+(9.223372036854779e18),
+(9.22337203685479e18),
+(1.84e19);
+update t1 set u = d;
+select u from t1;
+u
+9223372036854775808
+9223372036854779904
+9223372036854790144
+18400000000000000000
+drop table t1;
 End of 5.0 tests

=== added file 'mysql-test/suite/binlog/r/binlog_innodb_row.result'
--- a/mysql-test/suite/binlog/r/binlog_innodb_row.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/binlog/r/binlog_innodb_row.result	2008-12-08 15:07:08 +0000
@@ -0,0 +1,31 @@
+CREATE TABLE t1 (i int unique) ENGINE=innodb;
+reset master;
+begin;
+insert into t1 values (1),(2);
+*** the following UPDATE query wont generate any updates for the binlog ***
+update t1 set i = 3 where i < 3;
+ERROR 23000: Duplicate entry '3' for key 'i'
+commit;
+*** Results of the test: the binlog must have only Write_rows events not any Update_rows ***
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	use `test`; BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+delete from t1;
+reset master;
+begin;
+insert into t1 values (1),(2);
+*** the following UPDATE query wont generate any updates for the binlog ***
+insert into t1 values (3),(4),(1),(2);
+ERROR 23000: Duplicate entry '1' for key 'i'
+commit;
+*** Results of the test: the binlog must have only one Write_rows event not two ***
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	#	#	use `test`; BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+drop table t1;

=== modified file 'mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result'
--- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result	2008-08-20 10:29:58 +0000
+++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result	2008-12-08 19:47:15 +0000
@@ -133,10 +133,6 @@ master-bin.000001	#	Query	#	#	use `test`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	use `test`; BEGIN
-master-bin.000001	#	Table_map	#	#	table_id: # (test.t2)
-master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	use `test`; COMMIT
 insert into t1 values(11);
 commit;
 show binlog events from <binlog_start>;
@@ -148,8 +144,6 @@ master-bin.000001	#	Xid	#	#	COMMIT /* XI
 master-bin.000001	#	Query	#	#	use `test`; BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t2)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	use `test`; COMMIT
-master-bin.000001	#	Query	#	#	use `test`; BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
@@ -278,10 +272,6 @@ master-bin.000001	#	Query	#	#	use `test`
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	use `test`; BEGIN
-master-bin.000001	#	Table_map	#	#	table_id: # (test.t2)
-master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	use `test`; COMMIT
 master-bin.000001	#	Query	#	#	use `test`; drop table t1,t2
 master-bin.000001	#	Query	#	#	use `test`; create table t0 (n int)
 master-bin.000001	#	Query	#	#	use `test`; BEGIN
@@ -382,7 +372,7 @@ master-bin.000001	#	Query	#	#	use `test`
 master-bin.000001	#	Query	#	#	use `test`; BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	use `test`; COMMIT
+master-bin.000001	#	Query	#	#	use `test`; ROLLBACK
 master-bin.000001	#	Query	#	#	use `test`; DROP TABLE IF EXISTS t2
 master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb
 master-bin.000001	#	Query	#	#	use `test`; BEGIN
@@ -400,11 +390,9 @@ master-bin.000001	#	Query	#	#	use `test`
 master-bin.000001	#	Query	#	#	use `test`; BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	use `test`; COMMIT
-master-bin.000001	#	Query	#	#	use `test`; BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	use `test`; COMMIT
+master-bin.000001	#	Query	#	#	use `test`; ROLLBACK
 master-bin.000001	#	Query	#	#	use `test`; BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
@@ -412,7 +400,7 @@ master-bin.000001	#	Query	#	#	use `test`
 master-bin.000001	#	Query	#	#	use `test`; BEGIN
 master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Query	#	#	use `test`; COMMIT
+master-bin.000001	#	Query	#	#	use `test`; ROLLBACK
 master-bin.000001	#	Query	#	#	use `test`; BEGIN
 master-bin.000001	#	Query	#	#	use `test`; TRUNCATE table t2
 master-bin.000001	#	Query	#	#	use `test`; COMMIT

=== added file 'mysql-test/suite/binlog/t/binlog_innodb_row.test'
--- a/mysql-test/suite/binlog/t/binlog_innodb_row.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/binlog/t/binlog_innodb_row.test	2008-12-08 15:07:08 +0000
@@ -0,0 +1,42 @@
+#
+# Tests of innodb/binlog with the row binlog format
+# 
+source include/have_innodb.inc;
+source include/have_log_bin.inc;
+source include/have_binlog_format_row.inc;
+
+#
+# Bug #40221 Replication failure on RBR + UPDATE the primary key
+#
+
+CREATE TABLE t1 (i int unique) ENGINE=innodb;
+reset master;
+
+# part 1: update can cause the dup key
+
+begin;
+insert into t1 values (1),(2);
+--echo *** the following UPDATE query wont generate any updates for the binlog ***
+--error ER_DUP_ENTRY
+update t1 set i = 3 where i < 3;
+commit;
+
+--echo *** Results of the test: the binlog must have only Write_rows events not any Update_rows ***
+source include/show_binlog_events.inc;
+
+# part 2: insert can cause the dup key
+
+delete from t1;
+reset master;
+
+begin;
+insert into t1 values (1),(2);
+--echo *** the following UPDATE query wont generate any updates for the binlog ***
+--error ER_DUP_ENTRY
+insert into t1 values (3),(4),(1),(2);
+commit;
+
+--echo *** Results of the test: the binlog must have only one Write_rows event not two ***
+source include/show_binlog_events.inc;
+
+drop table t1;

=== modified file 'mysql-test/suite/funcs_2/t/disabled.def'
--- a/mysql-test/suite/funcs_2/t/disabled.def	2008-03-03 14:58:56 +0000
+++ b/mysql-test/suite/funcs_2/t/disabled.def	2008-12-08 14:36:42 +0000
@@ -1,6 +1,6 @@
 # Disabled by hhunger (2008-03-03) due to WL4204
-innodb_charset : Due to bug#20447
-myisam_charset : Due to bug#20477
-memory_charset : Due to bug#20447
-ndb_charset    : Due to bug#20447
+innodb_charset : Bug#20447 Problem with prefix keys with contractions and expansions
+myisam_charset : Bug#20447 Problem with prefix keys with contractions and expansions
+memory_charset : Bug#20447 Problem with prefix keys with contractions and expansions
+ndb_charset    : Bug#20447 Problem with prefix keys with contractions and expansions
 

=== modified file 'mysql-test/suite/ndb/t/disabled.def'
--- a/mysql-test/suite/ndb/t/disabled.def	2008-10-03 10:15:47 +0000
+++ b/mysql-test/suite/ndb/t/disabled.def	2008-12-09 12:55:03 +0000
@@ -10,7 +10,7 @@
 #
 ##############################################################################
 
-ndb_partition_error2	 : HF is not sure if the test can work as internded on all the platforms
+ndb_partition_error2 : Bug#40989 ndb_partition_error2 needs maintenance
 
 # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
 #ndb_binlog_ddl_multi     : BUG#18976 2006-04-10 kent    CRBR: multiple binlog, second binlog may miss schema log events

=== modified file 'mysql-test/suite/parts/r/partition_bit_innodb.result'
--- a/mysql-test/suite/parts/r/partition_bit_innodb.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_bit_innodb.result	2008-12-09 15:31:22 +0000
@@ -6,7 +6,7 @@ create table t1 (a bit(0), primary key (
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
-  `a` bit(1) NOT NULL DEFAULT '\0',
+  `a` bit(1) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (a) */
@@ -18,7 +18,7 @@ partition pa2);
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
-  `a` bit(1) NOT NULL DEFAULT '\0',
+  `a` bit(1) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (a)
@@ -30,7 +30,7 @@ partition by key (a) partitions 2;
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
-  `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
+  `a` bit(64) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (a)
@@ -58,7 +58,7 @@ partition pa4 max_rows=40 min_rows=2);
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
-  `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
+  `a` bit(64) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (a)
@@ -88,7 +88,7 @@ partition by key (a) partitions 4;
 show create table t2;
 Table	Create Table
 t2	CREATE TABLE `t2` (
-  `a` bit(1) NOT NULL DEFAULT '\0',
+  `a` bit(1) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (a)
@@ -102,7 +102,7 @@ alter table t2 drop primary key;
 show create table t2;
 Table	Create Table
 t2	CREATE TABLE `t2` (
-  `a` bit(1) NOT NULL DEFAULT '\0'
+  `a` bit(1) NOT NULL DEFAULT b'0'
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (a)
 PARTITIONS 4 */
@@ -114,7 +114,7 @@ alter table t2 add primary key (a);
 show create table t2;
 Table	Create Table
 t2	CREATE TABLE `t2` (
-  `a` bit(1) NOT NULL DEFAULT '\0',
+  `a` bit(1) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (a)
@@ -133,7 +133,7 @@ partition pa4 values less than (256));
 show create table t3;
 Table	Create Table
 t3	CREATE TABLE `t3` (
-  `a` bit(8) NOT NULL DEFAULT '\0',
+  `a` bit(8) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY RANGE (a)
@@ -416,7 +416,7 @@ partition pa3 values in (17,18,19,20,21,
 show create table t4;
 Table	Create Table
 t4	CREATE TABLE `t4` (
-  `a` bit(8) NOT NULL DEFAULT '\0',
+  `a` bit(8) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY LIST (a)

=== modified file 'mysql-test/suite/parts/r/partition_bit_myisam.result'
--- a/mysql-test/suite/parts/r/partition_bit_myisam.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_bit_myisam.result	2008-12-09 15:31:22 +0000
@@ -6,7 +6,7 @@ create table t1 (a bit(0), primary key (
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
-  `a` bit(1) NOT NULL DEFAULT '\0',
+  `a` bit(1) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (a) */
@@ -18,7 +18,7 @@ partition pa2);
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
-  `a` bit(1) NOT NULL DEFAULT '\0',
+  `a` bit(1) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (a)
@@ -30,7 +30,7 @@ partition by key (a) partitions 2;
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
-  `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
+  `a` bit(64) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (a)
@@ -58,7 +58,7 @@ partition pa4 max_rows=40 min_rows=2);
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
-  `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
+  `a` bit(64) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (a)
@@ -88,7 +88,7 @@ partition by key (a) partitions 4;
 show create table t2;
 Table	Create Table
 t2	CREATE TABLE `t2` (
-  `a` bit(1) NOT NULL DEFAULT '\0',
+  `a` bit(1) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (a)
@@ -102,7 +102,7 @@ alter table t2 drop primary key;
 show create table t2;
 Table	Create Table
 t2	CREATE TABLE `t2` (
-  `a` bit(1) NOT NULL DEFAULT '\0'
+  `a` bit(1) NOT NULL DEFAULT b'0'
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (a)
 PARTITIONS 4 */
@@ -114,7 +114,7 @@ alter table t2 add primary key (a);
 show create table t2;
 Table	Create Table
 t2	CREATE TABLE `t2` (
-  `a` bit(1) NOT NULL DEFAULT '\0',
+  `a` bit(1) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY KEY (a)
@@ -133,7 +133,7 @@ partition pa4 values less than (256));
 show create table t3;
 Table	Create Table
 t3	CREATE TABLE `t3` (
-  `a` bit(8) NOT NULL DEFAULT '\0',
+  `a` bit(8) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY RANGE (a)
@@ -416,7 +416,7 @@ partition pa3 values in (17,18,19,20,21,
 show create table t4;
 Table	Create Table
 t4	CREATE TABLE `t4` (
-  `a` bit(8) NOT NULL DEFAULT '\0',
+  `a` bit(8) NOT NULL DEFAULT b'0',
   PRIMARY KEY (`a`)
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 /*!50100 PARTITION BY LIST (a)

=== removed file 'mysql-test/suite/parts/r/partition_bit_ndb.result'
--- a/mysql-test/suite/parts/r/partition_bit_ndb.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_bit_ndb.result	1970-01-01 00:00:00 +0000
@@ -1,126 +0,0 @@
-SET @max_row = 20;
-create table t1 (a bit(65), primary key (a)) partition by key (a);
-ERROR 42000: Display width out of range for column 'a' (max = 64)
-create table t1 (a bit(0), primary key (a)) partition by key (a);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` bit(1) NOT NULL DEFAULT '\0',
-  PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)  */
-drop table t1;
-create table t1 (a bit(0), primary key (a)) partition by key (a) (
-partition pa1 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp',
-partition pa2 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp');
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` bit(1) NOT NULL DEFAULT '\0',
-  PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/'
-/*!50100 PARTITION BY KEY (a)
-(PARTITION pa1 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
- PARTITION pa2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */
-drop table t1;
-create table t1 (a bit(64), primary key (a)) partition by key (a);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
-  PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)  */
-insert into t1 values 
-(b'1111111111111111111111111111111111111111111111111111111111111111'),
-(b'1000000000000000000000000000000000000000000000000000000000000000'),
-(b'0000000000000000000000000000000000000000000000000000000000000001'),
-(b'1010101010101010101010101010101010101010101010101010101010101010'),
-(b'0101010101010101010101010101010101010101010101010101010101010101');
-select hex(a) from t1;
-hex(a)
-1
-5555555555555555
-8000000000000000
-AAAAAAAAAAAAAAAA
-FFFFFFFFFFFFFFFF
-drop table t1;
-create table t1 (a bit(64), primary key (a)) partition by key (a)(
-partition pa1 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp' max_rows=20 min_rows=2,
-partition pa2 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp' max_rows=30 min_rows=3,
-partition pa3 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp' max_rows=30 min_rows=4,
-partition pa4 DATA DIRECTORY =
-'/tmp' INDEX DIRECTORY =
-'/tmp' max_rows=40 min_rows=2);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0',
-  PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/'
-/*!50100 PARTITION BY KEY (a)
-(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
- PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
- PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM,
- PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */
-insert into t1 values 
-(b'1111111111111111111111111111111111111111111111111111111111111111'),
-(b'1000000000000000000000000000000000000000000000000000000000000000'),
-(b'0000000000000000000000000000000000000000000000000000000000000001'),
-(b'1010101010101010101010101010101010101010101010101010101010101010'),
-(b'0101010101010101010101010101010101010101010101010101010101010101');
-select hex(a) from t1;
-hex(a)
-1
-5555555555555555
-8000000000000000
-AAAAAAAAAAAAAAAA
-FFFFFFFFFFFFFFFF
-drop table t1;
-create table t1 (a bit, primary key (a)) partition by key (a);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` bit(1) NOT NULL DEFAULT '\0',
-  PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)  */
-insert into t1 values (b'0'), (b'1');
-select hex(a) from t1;
-hex(a)
-0
-1
-alter table t1 drop primary key;
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` bit(1) NOT NULL DEFAULT '\0'
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)  */
-select hex(a) from t1;
-hex(a)
-0
-1
-alter table t1 add primary key (a);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` bit(1) NOT NULL DEFAULT '\0',
-  PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)  */
-select hex(a) from t1;
-hex(a)
-0
-1
-drop table t1;

=== modified file 'mysql-test/suite/parts/r/partition_mgm_lc0_archive.result'
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result	2008-11-05 21:26:39 +0000
+++ b/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result	2008-12-01 18:50:54 +0000
@@ -93,11 +93,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -329,11 +329,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -559,7 +559,7 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB VALUES LESS THAN (3) ,
 PARTITION parta VALUES LESS THAN (11) );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO
 (PARTITION partD VALUES LESS THAN (8) 
 COMMENT="Previously partB and partly Partc",
@@ -793,7 +793,7 @@ PARTITION partF VALUES IN (3,9) 
 COMMENT = "Mix 2 of old parta and Partc",
 PARTITION parta VALUES IN (4,8) 
 COMMENT = "Mix 3 of old parta and Partc");
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION Partc VALUES IN (1,7) 
 COMMENT = "Mix 1 of old parta and Partc",

=== modified file 'mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result'
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result	2008-12-01 18:50:54 +0000
@@ -93,11 +93,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -329,11 +329,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -559,7 +559,7 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB VALUES LESS THAN (3) ,
 PARTITION parta VALUES LESS THAN (11) );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO
 (PARTITION partD VALUES LESS THAN (8) 
 COMMENT="Previously partB and partly Partc",
@@ -793,7 +793,7 @@ PARTITION partF VALUES IN (3,9) 
 COMMENT = "Mix 2 of old parta and Partc",
 PARTITION parta VALUES IN (4,8) 
 COMMENT = "Mix 3 of old parta and Partc");
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION Partc VALUES IN (1,7) 
 COMMENT = "Mix 1 of old parta and Partc",

=== modified file 'mysql-test/suite/parts/r/partition_mgm_lc0_memory.result'
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result	2008-12-01 18:50:54 +0000
@@ -93,11 +93,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -329,11 +329,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -559,7 +559,7 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB VALUES LESS THAN (3) ,
 PARTITION parta VALUES LESS THAN (11) );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO
 (PARTITION partD VALUES LESS THAN (8) 
 COMMENT="Previously partB and partly Partc",
@@ -793,7 +793,7 @@ PARTITION partF VALUES IN (3,9) 
 COMMENT = "Mix 2 of old parta and Partc",
 PARTITION parta VALUES IN (4,8) 
 COMMENT = "Mix 3 of old parta and Partc");
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION Partc VALUES IN (1,7) 
 COMMENT = "Mix 1 of old parta and Partc",

=== modified file 'mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result'
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result	2008-12-01 18:50:54 +0000
@@ -93,11 +93,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -329,11 +329,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -559,7 +559,7 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB VALUES LESS THAN (3) ,
 PARTITION parta VALUES LESS THAN (11) );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO
 (PARTITION partD VALUES LESS THAN (8) 
 COMMENT="Previously partB and partly Partc",
@@ -793,7 +793,7 @@ PARTITION partF VALUES IN (3,9) 
 COMMENT = "Mix 2 of old parta and Partc",
 PARTITION parta VALUES IN (4,8) 
 COMMENT = "Mix 3 of old parta and Partc");
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION Partc VALUES IN (1,7) 
 COMMENT = "Mix 1 of old parta and Partc",

=== modified file 'mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result'
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result	2008-12-01 18:50:54 +0000
@@ -93,11 +93,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");

=== modified file 'mysql-test/suite/parts/r/partition_mgm_lc1_archive.result'
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result	2008-12-01 18:50:54 +0000
@@ -93,11 +93,11 @@ TableA	CREATE TABLE `tablea` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -320,11 +320,11 @@ TableA	CREATE TABLE `tablea` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -541,7 +541,7 @@ TableA	CREATE TABLE `tablea` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB VALUES LESS THAN (3) ,
 PARTITION parta VALUES LESS THAN (11) );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO
 (PARTITION partD VALUES LESS THAN (8) 
 COMMENT="Previously partB and partly Partc",
@@ -767,7 +767,7 @@ PARTITION partF VALUES IN (3,9) 
 COMMENT = "Mix 2 of old parta and Partc",
 PARTITION parta VALUES IN (4,8) 
 COMMENT = "Mix 3 of old parta and Partc");
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION Partc VALUES IN (1,7) 
 COMMENT = "Mix 1 of old parta and Partc",

=== modified file 'mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result'
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result	2008-12-01 18:50:54 +0000
@@ -93,11 +93,11 @@ TableA	CREATE TABLE `tablea` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -320,11 +320,11 @@ TableA	CREATE TABLE `tablea` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -541,7 +541,7 @@ TableA	CREATE TABLE `tablea` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB VALUES LESS THAN (3) ,
 PARTITION parta VALUES LESS THAN (11) );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO
 (PARTITION partD VALUES LESS THAN (8) 
 COMMENT="Previously partB and partly Partc",
@@ -767,7 +767,7 @@ PARTITION partF VALUES IN (3,9) 
 COMMENT = "Mix 2 of old parta and Partc",
 PARTITION parta VALUES IN (4,8) 
 COMMENT = "Mix 3 of old parta and Partc");
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION Partc VALUES IN (1,7) 
 COMMENT = "Mix 1 of old parta and Partc",

=== modified file 'mysql-test/suite/parts/r/partition_mgm_lc1_memory.result'
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result	2008-12-01 18:50:54 +0000
@@ -93,11 +93,11 @@ TableA	CREATE TABLE `tablea` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -320,11 +320,11 @@ TableA	CREATE TABLE `tablea` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -541,7 +541,7 @@ TableA	CREATE TABLE `tablea` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB VALUES LESS THAN (3) ,
 PARTITION parta VALUES LESS THAN (11) );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO
 (PARTITION partD VALUES LESS THAN (8) 
 COMMENT="Previously partB and partly Partc",
@@ -767,7 +767,7 @@ PARTITION partF VALUES IN (3,9) 
 COMMENT = "Mix 2 of old parta and Partc",
 PARTITION parta VALUES IN (4,8) 
 COMMENT = "Mix 3 of old parta and Partc");
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION Partc VALUES IN (1,7) 
 COMMENT = "Mix 1 of old parta and Partc",

=== modified file 'mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result'
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result	2008-12-01 18:50:54 +0000
@@ -93,11 +93,11 @@ TableA	CREATE TABLE `tablea` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -320,11 +320,11 @@ TableA	CREATE TABLE `tablea` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -541,7 +541,7 @@ TableA	CREATE TABLE `tablea` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB VALUES LESS THAN (3) ,
 PARTITION parta VALUES LESS THAN (11) );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO
 (PARTITION partD VALUES LESS THAN (8) 
 COMMENT="Previously partB and partly Partc",
@@ -767,7 +767,7 @@ PARTITION partF VALUES IN (3,9) 
 COMMENT = "Mix 2 of old parta and Partc",
 PARTITION parta VALUES IN (4,8) 
 COMMENT = "Mix 3 of old parta and Partc");
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION Partc VALUES IN (1,7) 
 COMMENT = "Mix 1 of old parta and Partc",

=== modified file 'mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result'
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result	2008-12-01 18:50:54 +0000
@@ -93,11 +93,11 @@ TableA	CREATE TABLE `tablea` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");

=== modified file 'mysql-test/suite/parts/r/partition_mgm_lc2_archive.result'
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result	2008-12-01 18:50:54 +0000
@@ -93,11 +93,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -320,11 +320,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -541,7 +541,7 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB VALUES LESS THAN (3) ,
 PARTITION parta VALUES LESS THAN (11) );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO
 (PARTITION partD VALUES LESS THAN (8) 
 COMMENT="Previously partB and partly Partc",
@@ -767,7 +767,7 @@ PARTITION partF VALUES IN (3,9) 
 COMMENT = "Mix 2 of old parta and Partc",
 PARTITION parta VALUES IN (4,8) 
 COMMENT = "Mix 3 of old parta and Partc");
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION Partc VALUES IN (1,7) 
 COMMENT = "Mix 1 of old parta and Partc",

=== modified file 'mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result'
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result	2008-12-01 18:50:54 +0000
@@ -93,11 +93,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -320,11 +320,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -541,7 +541,7 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB VALUES LESS THAN (3) ,
 PARTITION parta VALUES LESS THAN (11) );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO
 (PARTITION partD VALUES LESS THAN (8) 
 COMMENT="Previously partB and partly Partc",
@@ -767,7 +767,7 @@ PARTITION partF VALUES IN (3,9) 
 COMMENT = "Mix 2 of old parta and Partc",
 PARTITION parta VALUES IN (4,8) 
 COMMENT = "Mix 3 of old parta and Partc");
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION Partc VALUES IN (1,7) 
 COMMENT = "Mix 1 of old parta and Partc",

=== modified file 'mysql-test/suite/parts/r/partition_mgm_lc2_memory.result'
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result	2008-12-01 18:50:54 +0000
@@ -93,11 +93,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -320,11 +320,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -541,7 +541,7 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB VALUES LESS THAN (3) ,
 PARTITION parta VALUES LESS THAN (11) );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO
 (PARTITION partD VALUES LESS THAN (8) 
 COMMENT="Previously partB and partly Partc",
@@ -767,7 +767,7 @@ PARTITION partF VALUES IN (3,9) 
 COMMENT = "Mix 2 of old parta and Partc",
 PARTITION parta VALUES IN (4,8) 
 COMMENT = "Mix 3 of old parta and Partc");
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION Partc VALUES IN (1,7) 
 COMMENT = "Mix 1 of old parta and Partc",

=== modified file 'mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result'
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result	2008-12-01 18:50:54 +0000
@@ -93,11 +93,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -320,11 +320,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");
@@ -541,7 +541,7 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB VALUES LESS THAN (3) ,
 PARTITION parta VALUES LESS THAN (11) );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO
 (PARTITION partD VALUES LESS THAN (8) 
 COMMENT="Previously partB and partly Partc",
@@ -767,7 +767,7 @@ PARTITION partF VALUES IN (3,9) 
 COMMENT = "Mix 2 of old parta and Partc",
 PARTITION parta VALUES IN (4,8) 
 COMMENT = "Mix 3 of old parta and Partc");
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION Partc VALUES IN (1,7) 
 COMMENT = "Mix 1 of old parta and Partc",

=== modified file 'mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result'
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result	2008-12-01 18:50:54 +0000
@@ -93,11 +93,11 @@ TableA	CREATE TABLE `TableA` (
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 (PARTITION PARTA ,
 PARTITION partc );
-ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers
+ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 (PARTITION partB ,
 PARTITION parta );
-ERROR HY000: When reorganising a set of partitions they must be in consecutive order
+ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 (PARTITION partB  COMMENT="Previusly named parta",
 PARTITION parta  COMMENT="Previusly named partB");

=== modified file 'mysql-test/suite/parts/t/disabled.def'
--- a/mysql-test/suite/parts/t/disabled.def	2008-10-29 14:20:12 +0000
+++ b/mysql-test/suite/parts/t/disabled.def	2008-12-09 12:55:03 +0000
@@ -1,11 +1,6 @@
 partition_basic_ndb            : Bug#19899 Crashing the server
 # http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-limitations-syntax.html
-partition_bit_ndb              : NDB does not support bit column in index
-partition_sessions             : needs system_3_init.inc
 partition_syntax_ndb           : Bug#36735 Not supported
-partition_value_innodb         : Bug#30581 partition_value tests use disallowed CAST() function
-partition_value_myisam         : Bug#30581 partition_value tests use disallowed CAST() function
-partition_value_ndb            : Bug#30581 partition_value tests use disallowed CAST() function
 ndb_dd_backuprestore           : Bug#32659 2008-07-14 alik  Disabled to make 6.0 greaner (the test fails too often)
 partition_mgm_lc0_archive      : Bug#37719 - Problems with same name and different case
 partition_mgm_lc0_ndb          : Bug#38778 - master1 crashes

=== removed file 'mysql-test/suite/parts/t/partition_bit_ndb.test'
--- a/mysql-test/suite/parts/t/partition_bit_ndb.test	2008-07-01 18:38:15 +0000
+++ b/mysql-test/suite/parts/t/partition_bit_ndb.test	1970-01-01 00:00:00 +0000
@@ -1,60 +0,0 @@
-################################################################################
-# t/partition_bit_ndb.test                                                     #
-#                                                                              #
-# Purpose:                                                                     #
-#  Tests around bit type                                                       #
-#        NDB branch                                                            #
-#                                                                              #
-#------------------------------------------------------------------------------#
-# Original Author: HH                                                          #
-# Original Date: 2006-08-01                                                    #
-# Change Author:                                                               #
-# Change Date:                                                                 #
-# Change:                                                                      #
-################################################################################
-
-#
-# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE !
-#       TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-#       THE SOURCED FILES ONLY.
-#
-# Please read the README at the end of inc/partition.pre before changing
-# any of the variables.
-#
-
-#------------------------------------------------------------------------------#
-# General not engine specific settings and requirements
-
-##### Options, for debugging support #####
-let $debug= 0;
-let $with_partitioning= 1;
-
-##### Option, for displaying files #####
-let $ls= 1;
-
-##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
-#     on partioned tables
-SET @max_row = 20;
-
-# The server must support partitioning.
---source include/have_partition.inc
-
-#------------------------------------------------------------------------------#

-# Engine specific settings and requirements
-
-##### Storage engine to be tested
---source include/have_ndb.inc
-let $engine= 'NDB';
-connection default;
-
-# range, list and hash partitioning in ndb requires new_mode
---disable_query_log
-set new=on;
---enable_query_log
-##### Assign a big number smaller than the maximum value for partitions  #####
-#     and smaller than the maximum value of SIGNED INTEGER
-let $MAX_VALUE= (2147483646);
-
-#------------------------------------------------------------------------------#
-# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_bit.inc

=== removed file 'mysql-test/suite/parts/t/partition_sessions.test'
--- a/mysql-test/suite/parts/t/partition_sessions.test	2008-02-06 14:13:56 +0000
+++ b/mysql-test/suite/parts/t/partition_sessions.test	1970-01-01 00:00:00 +0000
@@ -1,391 +0,0 @@
-
-#--------------------------------------------------
-# Initialize system_3 test variables 
-#--------------------------------------------------
-

---source suite/system_3/include/system_3_init.inc
-
-let $NUM_VAL=`SELECT @NUM_VAL`;
-let $LOAD_LINES=`SELECT @LOAD_LINES`;
-let $LOG_UPPER=`SELECT @LOG_UPPER`;
-let $LOG_LOWER=`SELECT @LOG_LOWER`;
-#let $ENG1=`SELECT @ENG1`;
-let $ENG2=`SELECT @ENG2`;
-let $ENG_LOG=`SELECT @ENG_LOG`;
-let $CLIENT_HOST=`SELECT @CLIENT_HOST`;
-let $ENG=innodb;
-let $ENG1=innodb;
-#---------------------------------------------------------
-# Column list with definition for all tables to be checked
-#---------------------------------------------------------
-
-let $column_list= f1 int,
-f2 char (15),
-f3 decimal (5,3),
-f4 datetime;
-
-let $col_access_list = f1,f2,f3,f4 ;
-let $col_new_list    = new.f1,new.f2,new.f3 new.f4 ;
-
-#---------------------------------------------------
-# Setting the parameters to use during testing
-#---------------------------------------------------
-# Set number of variations of the f1 variable (used to segment the rows
-# being updated/deleted by a user at a time. The higher the number, the
-# more smaller segments used with each query.
---replace_result $NUM_VAL NUM_VAL
-eval set @f1_nums=$NUM_VAL;
-
-# The following sets the number controls the size of the log table.
-# Once a size of '@threshold' is reached, the first rows are removed
-# sunch that the table is down to '@shrink_to' lines
---replace_result $LOG_LOWER LOG_LOWER
-eval set @shrink_to=$LOG_LOWER;
---replace_result $LOG_UPPER LOG_UPPER
-eval set @threshold=$LOG_UPPER;
-
-#---------------------------------------------------
-# Creating the database tables and loading the data
-#---------------------------------------------------
-

---disable_warnings
-drop database if exists systest1;
---enable_warnings
-
-create database systest1;
-
---disable_abort_on_error
---replace_result $CLIENT_HOST CLIENT_HOST
-eval create user systuser@'$CLIENT_HOST';
---enable_abort_on_error
---replace_result $CLIENT_HOST CLIENT_HOST
-eval set password for systuser@'$CLIENT_HOST' = password('systpass');
---replace_result $CLIENT_HOST CLIENT_HOST
-eval grant ALL on systest1.* to systuser@'$CLIENT_HOST';
-use systest1;
---replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
-connect (systuser,localhost,systuser,systpass,systest1,$MASTER_MYPORT,$MASTER_MYSOCK);
-
-create table tb1_master (
-   f1 int,
-   f2 char(15),
-   f3 decimal (5,3),
-   f4 datetime
-);
-
-#--replace_result $ENG_LOG ENG_LOG
-eval create table tb1_logs (
-   i1 int NOT NULL auto_increment, primary key (i1),
-   dt1 datetime NOT NULL,
-   entry_dsc char(100),
-   f4 int
-) engine=$ENG_LOG
-;
-#PARTITION BY HASH (i1) PARTITIONS 8;
-
-if ($debug)
-{
-SHOW CREATE TABLE tb1_logs;
-}
-
-#--replace_result $ENG_LOG ENG_LOG
-eval create table ddl_logs (
-   i1 int NOT NULL auto_increment, primary key (i1),
-   dt1 datetime NOT NULL,
-   entry_dsc char(100),
-   errno int
-) engine=$ENG_LOG;
-#PARTITION BY HASH (i1) PARTITIONS 8;
-
-if ($debug)
-{
-SHOW CREATE TABLE tb1_logs;
-}
-create table test_stat (
-   dt1 datetime,
-   table_name char(20),
-   row_count int,
-   start_row int,
-   end_row int
-);
-
-#----------------------------------------------------------------------
-# tb3_eng1: key partitioning
-#----------------------------------------------------------------------
-
-#--replace_result $ENG1 ENG1
-eval create table tb3_eng1 (
-   i1 int NOT NULL auto_increment, primary key (i1),
-   $column_list
-) engine=$ENG1
-PARTITION BY KEY (i1) PARTITIONS 4
-(PARTITION part1,
-PARTITION part2,
-PARTITION part3,
-PARTITION part4);
-
-#--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval load data local infile '$MYSQL_TEST_DIR/suite/system_3/data/tb1.txt'
-     into table tb3_eng1 ($col_access_list);
-
-if ($WITH_TRIGGERS)
-{
-delimiter //;
-
-Create trigger tb3_eng1_ins after insert on tb3_eng1 for each row
-BEGIN
-   insert into tb1_logs (dt1, entry_dsc, f4)
-   values (now(), concat('Insert row ', new.f1,' ',
-           new.f2, ' ', new.f3, ' (tb3_eng1)'), new.f1);
-END//
-
-Create trigger tb3_eng1_upd after update on tb3_eng1 for each row
-BEGIN
-   insert into tb1_logs (dt1, entry_dsc, f4)
-   values (now(), concat('Update row ', old.f1,' ', old.f2, '->',
-           new.f2, ' ', old.f3, '->', new.f3, ' (tb3_eng1)'), new.f1);
-END//
-
-Create trigger tb3_eng1_del after delete on tb3_eng1 for each row
-BEGIN
-   insert into tb1_logs (dt1, entry_dsc, f4)
-   values (now(), concat('Delete row ', old.f1,' ', old.f2, ' ',
-           old.f3, ' (tb3_eng1)'), old.f1);
-END//
-
-delimiter ;//
-}
-delimiter //;
-
-# This functions returns a random integer number 
-# between zero and 'num'
-#-----------------------------------------------
-create function int_rand(num int) returns int
-BEGIN
-   return round(num*rand()+0.5); 
-END//
-
-# This function returns a string in the length 'len' of 
-# random letters (ascii range of 65-122)
-#------------------------------------------------------
-create function str_rand (len int) returns char(12)
-BEGIN
-  declare tmp_letter char(1);
-  declare tmp_word char(12);
-  declare word_str char(12) default '';
-  wl_loop: WHILE len DO
-     set tmp_letter=char(round(57*rand()+65)); 
-     set tmp_word=concat(word_str,tmp_letter);
-     set word_str=tmp_word;
-     set len=len-1;
-  END WHILE wl_loop;
-  return word_str;
-END//
-
-
-# This procedure scans 'tb1_master' table for rows where f1='num_pr'
-# and for each row inserts a row in 'tb3_eng1'
-#------------------------------------------------------------------
-eval create procedure ins_tb3_eng1 (num_pr int, str_pr char(15))
-BEGIN
-  declare done int default 0;
-  declare v3 decimal(5,3);
-  declare cur1 cursor for 
-     select f3 from tb1_master where f1=num_pr;
-  declare continue handler for sqlstate '01000' set done = 1;
-  declare continue handler for sqlstate '02000' set done = 1;
-  open cur1;
-  fetch cur1 into v3;
-  wl_loop: WHILE NOT done DO
-     insert into tb3_eng1 ($col_access_list) values
-        (int_rand(@f1_nums), concat('I:',str_pr,'-',num_pr), v3, now());
-     fetch cur1 into v3;
-  END WHILE wl_loop;
-  close cur1;
-END//
-
-
-# This procedure does selects from the 'tb1_logs' and inserts the 
-# count into the table
-#------------------------------------------------------------------
-create procedure slct_tb1_logs ()
-BEGIN
-  declare done int default 0;
-  declare v4 int;
-  declare v_count int default 0;
-  declare str_val char(15) default ELT(int_rand(3), 
-     'Insert', 'Update', 'Delete');
-  declare cur1 cursor for 
-     select f4 from tb1_logs where entry_dsc like concat('%',str_val,'%'); 
-  declare continue handler for sqlstate '01000' set done = 1;
-  declare continue handler for sqlstate '02000' set done = 1;
-  open cur1;
-  fetch cur1 into v4;
-  wl_loop: WHILE NOT done DO
-     set v_count=v_count+1;
-     fetch cur1 into v4;
-  END WHILE wl_loop;
-  close cur1;
-  insert into tb1_logs (dt1, entry_dsc, f4)
-     values (now(), concat('Number of \'', str_val, '\' rows is: ', 
-             v_count, ' (tb1_log)'),0);
-END//
-
-delimiter ;//
-
---disable_abort_on_error
-insert into systest1.tb3_eng1 values (NULL,50,'init_val',12.345,'2005-01-01 00:00:00');
-insert into systest1.tb3_eng1 values (NULL,70,'init_val',12.345,'2005-01-01 00:00:00');
---enable_abort_on_error
-
-connection default;0.
---disable_abort_on_error
---replace_result $CLIENT_HOST CLIENT_HOST
-eval create user syst1user@'$CLIENT_HOST';
---enable_abort_on_error
---replace_result $CLIENT_HOST CLIENT_HOST
-eval set password for syst1user@'$CLIENT_HOST' = password('systpass');
---replace_result $CLIENT_HOST CLIENT_HOST
-eval grant ALL on systest1.* to syst1user@'$CLIENT_HOST';
-use systest1;
---replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
-connect (syst1user,localhost,syst1user,systpass,systest1,$MASTER_MYPORT,$MASTER_MYSOCK);
-
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval SET @f1_nums=$NUM_VAL;
-SET @tmp_num=int_rand(@f1_nums);
-SET @tmp_word=str_rand(4);
-
-# DEBUG select @tmp_num, @tmp_word;
-
-# Insert rows replacing the deleted rows using a strored procedure
-# that reads the rows from a master table
-CALL ins_tb3_eng1 (@tmp_num, @tmp_word);
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval SET @f1_nums=$NUM_VAL;
-SET @tmp_num=int_rand(@f1_nums);
-SET @tmp_word=str_rand(4);
-
-# DEBUG select @tmp_num, @tmp_word;
-
-# Insert rows replacing the deleted rows using a strored procedure
-# that reads the rows from a master table
-CALL ins_tb3_eng1 (@tmp_num, @tmp_word);
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-call slct_tb1_logs();
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-set @tmp_word=str_rand(4);
-
-select @tmp_num, @tmp_word;
-
-# Update all rows in the table where f1 is one less the random number
-update tb3_eng1  
-   set f2=concat('U:',@tmp_word,'-',@tmp_num), f3=f3+1 
-   where f1=@tmp_num-1;
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-set @tmp_word=str_rand(4);
-
-select @tmp_num, @tmp_word;
-
-# Update all rows in the table where f1 is one less the random number
-update tb3_eng1  
-   set f2=concat('U:',@tmp_word,'-',@tmp_num), f3=f3+1 
-   where f1=@tmp_num-1;
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-call slct_tb1_logs();
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-set @tmp_word=str_rand(4);
-
-select @tmp_num, @tmp_word;
-
-# Update all rows in the table where f1 is one less the random number
-update tb3_eng1  
-   set f2=concat('U:',@tmp_word,'-',@tmp_num), f3=f3+1 
-   where f1=@tmp_num-1;
-
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-#--replace_result $NUM_VAL <NUM_VAL>
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-select @tmp_num;
-
-# DEBUG select @tmp_num, @tmp_word;
-
-# Delete all rows from the table where f1 is equal to the above number
-delete from tb3_eng1 where f1=@tmp_num;
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-select * from tb3_eng1 where f1>40;
-
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-select @tmp_num;
-
-# DEBUG select @tmp_num, @tmp_word;
-
-# Delete all rows from the table where f1 is equal to the above number
-delete from tb3_eng1 where f1=@tmp_num;
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-select * from tb3_eng1 where f1>40;
-
-connection syst1user;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-let $NUM_VAL=`SELECT @NUM_VAL`;
-eval set @f1_nums=$NUM_VAL;
-set @tmp_num=int_rand(@f1_nums);
-select @tmp_num;
-
-select @tmp_num, @tmp_word;
-
-# Delete all rows from the table where f1 is equal to the above number
-delete from tb3_eng1 where f1=@tmp_num;
-
-connection systuser;
---source suite/system_3/include/system_3_init.inc
-use systest1;
-select * from tb3_eng1 where f1>40;

=== modified file 'mysql-test/suite/parts/t/partition_value_innodb.test'
--- a/mysql-test/suite/parts/t/partition_value_innodb.test	2007-11-20 15:04:07 +0000
+++ b/mysql-test/suite/parts/t/partition_value_innodb.test	2008-12-08 14:36:42 +0000
@@ -8,9 +8,9 @@
 #------------------------------------------------------------------------------#
 # Original Author: mleich                                                      #
 # Original Date: 2006-04-11                                                    #
-# Change Author:                                                               #
-# Change Date:                                                                 #
-# Change:                                                                      #
+# Change Author: mleich                                                        #
+# Change Date: 2008-12-08                                                      #
+# Change: Remove test from disabled.def + change test that it gets skipped     #
 ################################################################################
 
 #
@@ -22,6 +22,12 @@
 # any of the variables.
 #
 
+#
+# CAST() within the partitioning function si no more supported, but we get
+# this functionality probably soon again. Therefor we do not delete this test.
+--skip # CAST() in partitioning function is currently not supported.
+
+
 #------------------------------------------------------------------------------#
 # General not engine specific settings and requirements
 

=== modified file 'mysql-test/suite/parts/t/partition_value_myisam.test'
--- a/mysql-test/suite/parts/t/partition_value_myisam.test	2007-11-20 15:04:07 +0000
+++ b/mysql-test/suite/parts/t/partition_value_myisam.test	2008-12-08 14:36:42 +0000
@@ -8,9 +8,9 @@
 #------------------------------------------------------------------------------#
 # Original Author: mleich                                                      #
 # Original Date: 2006-04-11                                                    #
-# Change Author:                                                               #
-# Change Date:                                                                 #
-# Change:                                                                      #
+# Change Author: mleich                                                        #
+# Change Date: 2008-12-08                                                      #
+# Change: Remove test from disabled.def + change test that it gets skipped     #
 ################################################################################
 
 #
@@ -22,6 +22,12 @@
 # any of the variables.
 #
 
+#
+# CAST() within the partitioning function si no more supported, but we get
+# this functionality probably soon again. Therefor we do not delete this test.
+--skip # CAST() in partitioning function is currently not supported.
+
+
 #------------------------------------------------------------------------------#
 # General not engine specific settings and requirements
 

=== modified file 'mysql-test/suite/parts/t/partition_value_ndb.test'
--- a/mysql-test/suite/parts/t/partition_value_ndb.test	2008-07-01 18:38:15 +0000
+++ b/mysql-test/suite/parts/t/partition_value_ndb.test	2008-12-08 14:36:42 +0000
@@ -8,9 +8,9 @@
 #------------------------------------------------------------------------------#
 # Original Author: mleich                                                      #
 # Original Date: 2006-04-11                                                    #
-# Change Author:                                                               #
-# Change Date:                                                                 #
-# Change:                                                                      #
+# Change Author: mleich                                                        #
+# Change Date: 2008-12-08                                                      #
+# Change: Remove test from disabled.def + change test that it gets skipped     #
 ################################################################################
 
 #
@@ -22,6 +22,12 @@
 # any of the variables.
 #
 
+#
+# CAST() within the partitioning function si no more supported, but we get
+# this functionality probably soon again. Therefor we do not delete this test.
+--skip # CAST() in partitioning function is currently not supported.
+
+
 #------------------------------------------------------------------------------#
 # General not engine specific settings and requirements
 

=== modified file 'mysql-test/suite/rpl/r/rpl_packet.result'
--- a/mysql-test/suite/rpl/r/rpl_packet.result	2008-05-01 09:34:54 +0000
+++ b/mysql-test/suite/rpl/r/rpl_packet.result	2008-12-08 14:50:13 +0000
@@ -29,44 +29,9 @@ SET @@global.max_allowed_packet=4096;
 SET @@global.net_buffer_length=4096;
 STOP SLAVE;
 START SLAVE;
-CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
 INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
-show slave status;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_MYPORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	No
-Slave_SQL_Running	#
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
+Slave_IO_Running = No (expect No)
+==== clean up ====
+DROP TABLE t1;
+DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl/r/rpl_row_create_table.result'
--- a/mysql-test/suite/rpl/r/rpl_row_create_table.result	2008-10-08 11:46:49 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result	2008-12-08 13:31:24 +0000
@@ -4,34 +4,39 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+**** Resetting master and slave ****
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
 CREATE TABLE t1 (a INT, b INT);
 CREATE TABLE t2 (a INT, b INT) ENGINE=Merge;
 CREATE TABLE t3 (a INT, b INT) CHARSET=utf8;
 CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8;
-SHOW BINLOG EVENTS FROM 217;
+SHOW BINLOG EVENTS FROM 107;
 Log_name	#
-Pos	217
+Pos	107
 Event_type	Query
 Server_id	#
-End_log_pos	310
+End_log_pos	200
 Info	use `test`; CREATE TABLE t1 (a INT, b INT)
 Log_name	#
-Pos	310
+Pos	200
 Event_type	Query
 Server_id	#
-End_log_pos	416
+End_log_pos	306
 Info	use `test`; CREATE TABLE t2 (a INT, b INT) ENGINE=Merge
 Log_name	#
-Pos	416
+Pos	306
 Event_type	Query
 Server_id	#
-End_log_pos	522
+End_log_pos	412
 Info	use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8
 Log_name	#
-Pos	522
+Pos	412
 Event_type	Query
 Server_id	#
-End_log_pos	641
+End_log_pos	531
 Info	use `test`; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8
 **** On Master ****
 SHOW CREATE TABLE t1;
@@ -125,9 +130,14 @@ NULL	3	6
 NULL	4	2
 NULL	5	10
 NULL	6	12
+**** Resetting master and slave ****
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
 CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
 ERROR 23000: Duplicate entry '2' for key 'b'
-SHOW BINLOG EVENTS FROM 1375;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 CREATE TABLE t7 (a INT, b INT UNIQUE);
 INSERT INTO t7 SELECT a,b FROM tt3;
@@ -137,18 +147,23 @@ a	b
 1	2
 2	4
 3	6
-SHOW BINLOG EVENTS FROM 1375;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-#	1375	Query	#	1475	use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
-#	1475	Query	#	1543	use `test`; BEGIN
-#	1543	Table_map	#	1585	table_id: # (test.t7)
-#	1585	Write_rows	#	1641	table_id: # flags: STMT_END_F
-#	1641	Query	#	1712	use `test`; ROLLBACK
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
+master-bin.000001	#	Query	#	#	use `test`; BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t7)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	use `test`; ROLLBACK
 SELECT * FROM t7 ORDER BY a,b;
 a	b
 1	2
 2	4
 3	6
+**** Resetting master and slave ****
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
 CREATE TEMPORARY TABLE tt4 (a INT, b INT);
 INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
 BEGIN;
@@ -156,12 +171,12 @@ INSERT INTO t7 SELECT a,b FROM tt4;
 ROLLBACK;
 Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
-SHOW BINLOG EVENTS FROM 1712;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-#	1712	Query	#	1780	use `test`; BEGIN
-#	1780	Table_map	#	1822	table_id: # (test.t7)
-#	1822	Write_rows	#	1878	table_id: # flags: STMT_END_F
-#	1878	Query	#	1947	use `test`; COMMIT
+master-bin.000001	#	Query	#	#	use `test`; BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t7)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	use `test`; ROLLBACK
 SELECT * FROM t7 ORDER BY a,b;
 a	b
 1	2
@@ -178,6 +193,11 @@ a	b
 4	8
 5	10
 6	12
+**** Resetting master and slave ****
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
 CREATE TABLE t8 LIKE t4;
 CREATE TABLE t9 LIKE tt4;
 CREATE TEMPORARY TABLE tt5 LIKE t4;
@@ -196,10 +216,10 @@ Create Table	CREATE TABLE `t9` (
   `a` int(11) DEFAULT NULL,
   `b` int(11) DEFAULT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW BINLOG EVENTS FROM 1947;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-#	1947	Query	#	2033	use `test`; CREATE TABLE t8 LIKE t4
-#	2033	Query	#	2172	use `test`; CREATE TABLE `t9` (
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t8 LIKE t4
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE `t9` (
   `a` int(11) DEFAULT NULL,
   `b` int(11) DEFAULT NULL
 )
@@ -276,39 +296,38 @@ a
 1
 2
 3
-SHOW BINLOG EVENTS;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-#	4	Format_desc	#	107	Server ver: #, Binlog ver: #
-#	107	Query	#	193	use `test`; CREATE TABLE t1 (a INT)
-#	193	Query	#	261	use `test`; BEGIN
-#	261	Table_map	#	302	table_id: # (test.t1)
-#	302	Write_rows	#	346	table_id: # flags: STMT_END_F
-#	346	Query	#	415	use `test`; COMMIT
-#	415	Query	#	483	use `test`; BEGIN
-#	483	Query	#	608	use `test`; CREATE TABLE `t2` (
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t1 (a INT)
+master-bin.000001	#	Query	#	#	use `test`; BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	use `test`; COMMIT
+master-bin.000001	#	Query	#	#	use `test`; BEGIN
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE `t2` (
   `a` int(11) DEFAULT NULL
 ) ENGINE=InnoDB
-#	608	Table_map	#	649	table_id: # (test.t2)
-#	649	Write_rows	#	693	table_id: # flags: STMT_END_F
-#	693	Xid	#	720	COMMIT /* XID */
-#	720	Query	#	788	use `test`; BEGIN
-#	788	Query	#	913	use `test`; CREATE TABLE `t3` (
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t2)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	use `test`; BEGIN
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE `t3` (
   `a` int(11) DEFAULT NULL
 ) ENGINE=InnoDB
-#	913	Table_map	#	954	table_id: # (test.t3)
-#	954	Write_rows	#	998	table_id: # flags: STMT_END_F
-#	998	Xid	#	1025	COMMIT /* XID */
-#	1025	Query	#	1093	use `test`; BEGIN
-#	1093	Query	#	1218	use `test`; CREATE TABLE `t4` (
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t3)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	use `test`; BEGIN
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE `t4` (
   `a` int(11) DEFAULT NULL
 ) ENGINE=InnoDB
-#	1218	Table_map	#	1259	table_id: # (test.t4)
-#	1259	Write_rows	#	1303	table_id: # flags: STMT_END_F
-#	1303	Xid	#	1330	COMMIT /* XID */
-#	1330	Query	#	1398	use `test`; BEGIN
-#	1398	Table_map	#	1439	table_id: # (test.t1)
-#	1439	Write_rows	#	1483	table_id: # flags: STMT_END_F
-#	1483	Query	#	1552	use `test`; COMMIT
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t4)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	use `test`; BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	use `test`; ROLLBACK
 SHOW TABLES;
 Tables_in_test
 t1
@@ -371,21 +390,20 @@ a
 4
 6
 9
-SHOW BINLOG EVENTS;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-#	4	Format_desc	#	107	Server ver: #, Binlog ver: #
-#	107	Query	#	193	use `test`; CREATE TABLE t1 (a INT)
-#	193	Query	#	261	use `test`; BEGIN
-#	261	Table_map	#	302	table_id: # (test.t1)
-#	302	Write_rows	#	346	table_id: # flags: STMT_END_F
-#	346	Query	#	415	use `test`; COMMIT
-#	415	Query	#	515	use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB
-#	515	Query	#	583	use `test`; BEGIN
-#	583	Table_map	#	624	table_id: # (test.t2)
-#	624	Write_rows	#	668	table_id: # flags: STMT_END_F
-#	668	Table_map	#	709	table_id: # (test.t2)
-#	709	Write_rows	#	748	table_id: # flags: STMT_END_F
-#	748	Xid	#	775	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t1 (a INT)
+master-bin.000001	#	Query	#	#	use `test`; BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	use `test`; COMMIT
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB
+master-bin.000001	#	Query	#	#	use `test`; BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t2)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t2)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 SELECT * FROM t2 ORDER BY a;
 a
 1
@@ -394,6 +412,11 @@ a
 6
 9
 TRUNCATE TABLE t2;
+**** Resetting master and slave ****
+STOP SLAVE;
+RESET SLAVE;
+RESET MASTER;
+START SLAVE;
 BEGIN;
 INSERT INTO t2 SELECT a*a FROM t1;
 CREATE TEMPORARY TABLE tt2
@@ -406,14 +429,14 @@ Warnings:
 Warning	1196	Some non-transactional changed tables couldn't be rolled back
 SELECT * FROM t2 ORDER BY a;
 a
-SHOW BINLOG EVENTS FROM 950;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-#	950	Query	#	1018	use `test`; BEGIN
-#	1018	Table_map	#	1059	table_id: # (test.t2)
-#	1059	Write_rows	#	1103	table_id: # flags: STMT_END_F
-#	1103	Table_map	#	1144	table_id: # (test.t2)
-#	1144	Write_rows	#	1183	table_id: # flags: STMT_END_F
-#	1183	Query	#	1254	use `test`; ROLLBACK
+master-bin.000001	#	Query	#	#	use `test`; BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t2)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t2)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	use `test`; ROLLBACK
 SELECT * FROM t2 ORDER BY a;
 a
 DROP TABLE t1,t2;

=== modified file 'mysql-test/suite/rpl/r/rpl_slave_skip.result'
--- a/mysql-test/suite/rpl/r/rpl_slave_skip.result	2008-04-02 13:14:23 +0000
+++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result	2008-12-08 13:31:24 +0000
@@ -174,6 +174,7 @@ DROP TRIGGER tr2;
 INSERT INTO t1 VALUES (3,'master/slave');
 INSERT INTO t2 VALUES (3,'master/slave');
 INSERT INTO t3 VALUES (3,'master/slave');
+COMMIT;
 SELECT * FROM t1 ORDER BY a;
 a	b
 2	master only

=== modified file 'mysql-test/suite/rpl/r/rpl_trigger.result'
--- a/mysql-test/suite/rpl/r/rpl_trigger.result	2008-06-11 11:49:58 +0000
+++ b/mysql-test/suite/rpl/r/rpl_trigger.result	2008-12-08 13:31:24 +0000
@@ -973,3 +973,22 @@ a	b
 2	b
 3	c
 drop table t1;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+create table t1 ( f int ) engine = innodb;
+create table log ( r int ) engine = myisam;
+create trigger tr
+after insert on t1
+for each row insert into log values ( new.f );
+set autocommit = 0;
+insert into t1 values ( 1 );
+rollback;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+Comparing tables master:test.t1 and slave:test.t1
+Comparing tables master:test.log and slave:test.log
+drop table t1, log;

=== modified file 'mysql-test/suite/rpl/t/rpl_packet.test'
--- a/mysql-test/suite/rpl/t/rpl_packet.test	2008-05-01 09:34:54 +0000
+++ b/mysql-test/suite/rpl/t/rpl_packet.test	2008-12-08 14:50:13 +0000
@@ -75,16 +75,25 @@ disconnect master;
 connect (master, localhost, root);
 connection master;
 
-CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+
+sync_slave_with_master;
+
+connection master;
 
 INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
 
 # The slave I/O thread must stop after trying to read the above event
 connection slave;
---source include/wait_for_slave_io_to_stop.inc 
---replace_result $MASTER_MYPORT MASTER_MYPORT
-# important is only the 11th column Slave_IO_Running
---replace_column 1 # 7 # 8 # 9 # 12 # 22 # 23 # 33 # 35 # 36 #
-query_vertical show slave status;
+--source include/wait_for_slave_io_to_stop.inc
+let $slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
+--echo Slave_IO_Running = $slave_io_running (expect No)
+
+--echo ==== clean up ====
+connection master;
+DROP TABLE t1;
+# slave is stopped
+connection slave;
+DROP TABLE t1;
 
 # End of tests

=== modified file 'mysql-test/suite/rpl/t/rpl_row_create_table.test'
--- a/mysql-test/suite/rpl/t/rpl_row_create_table.test	2008-10-08 11:46:49 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test	2008-12-08 13:31:24 +0000
@@ -29,6 +29,8 @@ SET GLOBAL storage_engine=memory;
 START SLAVE;
 --enable_query_log
 
+--source include/reset_master_and_slave.inc
+
 connection master;
 CREATE TABLE t1 (a INT, b INT);
 CREATE TABLE t2 (a INT, b INT) ENGINE=Merge;
@@ -36,7 +38,7 @@ CREATE TABLE t3 (a INT, b INT) CHARSET=u
 CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8;
 --replace_column 1 # 4 #
 --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
---query_vertical SHOW BINLOG EVENTS FROM 217
+--query_vertical SHOW BINLOG EVENTS FROM 107
 --echo **** On Master ****
 --query_vertical SHOW CREATE TABLE t1
 --query_vertical SHOW CREATE TABLE t2
@@ -65,14 +67,14 @@ SELECT * FROM t5 ORDER BY a,b,c;
 --query_vertical SHOW CREATE TABLE t6
 SELECT * FROM t6 ORDER BY a,b,c;
 
+--source include/reset_master_and_slave.inc
+
 connection master;
 # Test for erroneous constructions
 --error ER_DUP_ENTRY
 CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
 # Shouldn't be written to the binary log
---replace_column 1 # 4 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1375;
+source include/show_binlog_events.inc;
 
 # Test that INSERT-SELECT works the same way as for SBR.
 CREATE TABLE t7 (a INT, b INT UNIQUE);
@@ -80,25 +82,25 @@ CREATE TABLE t7 (a INT, b INT UNIQUE);
 INSERT INTO t7 SELECT a,b FROM tt3;
 SELECT * FROM t7 ORDER BY a,b;
 # Should be written to the binary log
---replace_column 1 # 4 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1375;
+source include/show_binlog_events.inc;
 sync_slave_with_master;
 SELECT * FROM t7 ORDER BY a,b;
 
+--source include/reset_master_and_slave.inc
+
 connection master;
 CREATE TEMPORARY TABLE tt4 (a INT, b INT);
 INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
 BEGIN;
 INSERT INTO t7 SELECT a,b FROM tt4;
 ROLLBACK;
---replace_column 1 # 4 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1712;
+source include/show_binlog_events.inc;
 SELECT * FROM t7 ORDER BY a,b;
 sync_slave_with_master;
 SELECT * FROM t7 ORDER BY a,b;
 
+--source include/reset_master_and_slave.inc
+
 connection master;
 CREATE TABLE t8 LIKE t4;
 CREATE TABLE t9 LIKE tt4;
@@ -108,9 +110,7 @@ CREATE TEMPORARY TABLE tt7 SELECT 1;
 --echo **** On Master ****
 --query_vertical SHOW CREATE TABLE t8
 --query_vertical SHOW CREATE TABLE t9
---replace_column 1 # 4 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 1947;
+source include/show_binlog_events.inc;
 sync_slave_with_master;
 --echo **** On Slave ****
 --query_vertical SHOW CREATE TABLE t8
@@ -160,9 +160,7 @@ SELECT * FROM t1 ORDER BY a;
 SELECT * FROM t2 ORDER BY a;
 SELECT * FROM t3 ORDER BY a;
 SELECT * FROM t4 ORDER BY a;
---replace_column 1 # 4 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS;
+source include/show_binlog_events.inc;
 sync_slave_with_master;
 SHOW TABLES;
 SELECT   TABLE_NAME,ENGINE
@@ -206,15 +204,17 @@ INSERT INTO t2 SELECT a+2 FROM tt1;
 COMMIT;
 
 SELECT * FROM t2 ORDER BY a;
---replace_column 1 # 4 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS;
+source include/show_binlog_events.inc;
 sync_slave_with_master;
 SELECT * FROM t2 ORDER BY a;
 
 connection master;
 TRUNCATE TABLE t2;
+sync_slave_with_master;
+
+--source include/reset_master_and_slave.inc
 
+connection master;
 BEGIN;
 INSERT INTO t2 SELECT a*a FROM t1;
 CREATE TEMPORARY TABLE tt2
@@ -225,9 +225,7 @@ INSERT INTO t2 SELECT a+2 FROM tt2;
 ROLLBACK;
 
 SELECT * FROM t2 ORDER BY a;
---replace_column 1 # 4 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS FROM 950;
+source include/show_binlog_events.inc;
 sync_slave_with_master;
 SELECT * FROM t2 ORDER BY a;
 

=== modified file 'mysql-test/suite/rpl/t/rpl_slave_skip.test'
--- a/mysql-test/suite/rpl/t/rpl_slave_skip.test	2008-03-28 12:16:41 +0000
+++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test	2008-12-03 19:55:49 +0000
@@ -121,6 +121,7 @@ DROP TRIGGER tr2;
 INSERT INTO t1 VALUES (3,'master/slave');
 INSERT INTO t2 VALUES (3,'master/slave');
 INSERT INTO t3 VALUES (3,'master/slave');
+COMMIT;
 
 SELECT * FROM t1 ORDER BY a;
 SELECT * FROM t2 ORDER BY a;

=== modified file 'mysql-test/suite/rpl/t/rpl_trigger.test'
--- a/mysql-test/suite/rpl/t/rpl_trigger.test	2007-12-18 09:07:08 +0000
+++ b/mysql-test/suite/rpl/t/rpl_trigger.test	2008-12-05 09:23:27 +0000
@@ -467,20 +467,48 @@ drop trigger if exists t1_bi;
 insert into t1 values (3, "c");
 
 select * from t1;
-
-save_master_pos;
-connection slave;
-sync_with_master;
-
+sync_slave_with_master;
 select * from t1;
 
 connection master;
 
 drop table t1;
+sync_slave_with_master;
 
 #
-# End of tests
+# Bug#40116: Uncommited changes are replicated and stay on slave after
+# rollback on master
 #
-save_master_pos;
+
+connection master;
+source include/master-slave-reset.inc;
+source include/have_innodb.inc;
 connection slave;
-sync_with_master;
+source include/have_innodb.inc;
+
+connection master;
+create table t1 ( f int ) engine = innodb;
+create table log ( r int ) engine = myisam; 
+create trigger tr
+  after insert on t1
+  for each row insert into log values ( new.f );
+
+set autocommit = 0;
+insert into t1 values ( 1 );
+rollback;
+
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+--source include/diff_tables.inc
+
+let $diff_table_1=master:test.log;
+let $diff_table_2=slave:test.log;
+--source include/diff_tables.inc
+
+connection master;
+drop table t1, log;
+sync_slave_with_master;
+
+#
+# End of tests
+#

=== added file 'mysql-test/suite/sys_vars/r/tmp_table_size_basic.result'
--- a/mysql-test/suite/sys_vars/r/tmp_table_size_basic.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/r/tmp_table_size_basic.result	2008-12-09 16:14:50 +0000
@@ -0,0 +1,146 @@
+SET @start_global_value = @@global.tmp_table_size;
+SET @start_session_value = @@session.tmp_table_size;
+'#--------------------FN_DYNVARS_005_01-------------------------#'
+SET @@global.tmp_table_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '100'
+SET @@global.tmp_table_size = DEFAULT;
+SET @@session.tmp_table_size = 200;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '200'
+SET @@session.tmp_table_size = DEFAULT;
+'#--------------------FN_DYNVARS_005_02-------------------------#'
+SELECT @@global.tmp_table_size >= 16777216;
+@@global.tmp_table_size >= 16777216
+1
+SELECT @@session.tmp_table_size >= 16777216;
+@@session.tmp_table_size >= 16777216
+1
+'#--------------------FN_DYNVARS_005_03-------------------------#'
+SET @@global.tmp_table_size = 1024;
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+SET @@global.tmp_table_size = 60020;
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+60020
+SET @@global.tmp_table_size = 4294967295;
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+4294967295
+'#--------------------FN_DYNVARS_005_04-------------------------#'
+SET @@session.tmp_table_size = 1024;
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+1024
+SET @@session.tmp_table_size = 4294967295;
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+4294967295
+SET @@session.tmp_table_size = 65535;
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+65535
+'#------------------FN_DYNVARS_005_05-----------------------#'
+SET @@global.tmp_table_size = 0;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '0'
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+SET @@global.tmp_table_size = -1024;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '0'
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+SET @@global.tmp_table_size = 1000;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '1000'
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+SET @@global.tmp_table_size = ON;
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@global.tmp_table_size = OFF;
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@global.tmp_table_size = True;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '1'
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+SET @@global.tmp_table_size = False;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '0'
+SELECT @@global.tmp_table_size;
+@@global.tmp_table_size
+1024
+SET @@global.tmp_table_size = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@global.tmp_table_size ="Test";
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@session.tmp_table_size = ON;
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@session.tmp_table_size = OFF;
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@session.tmp_table_size = True;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '1'
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+1024
+SET @@session.tmp_table_size = False;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '0'
+SELECT @@session.tmp_table_size;
+@@session.tmp_table_size
+1024
+SET @@session.tmp_table_size = "Test";
+ERROR 42000: Incorrect argument type to variable 'tmp_table_size'
+SET @@session.tmp_table_size = 12345678901;
+SELECT @@session.tmp_table_size IN (12345678901,4294967295);
+@@session.tmp_table_size IN (12345678901,4294967295)
+1
+'#------------------FN_DYNVARS_005_06-----------------------#'
+SELECT @@global.tmp_table_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='tmp_table_size';
+@@global.tmp_table_size = VARIABLE_VALUE
+1
+'#------------------FN_DYNVARS_005_07-----------------------#'
+SELECT @@session.tmp_table_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='tmp_table_size';
+@@session.tmp_table_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_001_09----------------------#'
+SET @@global.tmp_table_size = 1024;
+SET @@tmp_table_size = 4294967295;
+SELECT @@tmp_table_size = @@global.tmp_table_size;
+@@tmp_table_size = @@global.tmp_table_size
+0
+'#---------------------FN_DYNVARS_001_10----------------------#'
+SET @@tmp_table_size = 100;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '100'
+SELECT @@tmp_table_size = @@local.tmp_table_size;
+@@tmp_table_size = @@local.tmp_table_size
+1
+SELECT @@local.tmp_table_size = @@session.tmp_table_size;
+@@local.tmp_table_size = @@session.tmp_table_size
+1
+'#---------------------FN_DYNVARS_001_11----------------------#'
+SET tmp_table_size = 1027;
+SELECT @@tmp_table_size;
+@@tmp_table_size
+1027
+SELECT local.tmp_table_size;
+ERROR 42S02: Unknown table 'local' in field list
+SELECT global.tmp_table_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT tmp_table_size = @@session.tmp_table_size;
+ERROR 42S22: Unknown column 'tmp_table_size' in 'field list'
+SET @@global.tmp_table_size = @start_global_value;
+SET @@session.tmp_table_size = @start_session_value;

=== modified file 'mysql-test/suite/sys_vars/t/disabled.def'
--- a/mysql-test/suite/sys_vars/t/disabled.def	2008-11-26 15:16:58 +0000
+++ b/mysql-test/suite/sys_vars/t/disabled.def	2008-12-09 16:14:50 +0000
@@ -18,4 +18,3 @@ query_alloc_block_size_basic_64:  Bug #3
 sort_buffer_size_basic_32   : Bug#36875 main.sort_buffer_size_basic_32 fails on some systems
 key_buffer_size_basic_32    : Bug#36876 main.key_buffer_size_basic_32 fails on some systems
 max_heap_table_size_basic_32 : Bug#36877 main.max_heap_table_size_basic_32 fails on some systems
-tmp_table_size_basic_32     : Bug#36878 main.tmp_table_size_basic_32 fails on some systems

=== added file 'mysql-test/suite/sys_vars/t/tmp_table_size_basic.test'
--- a/mysql-test/suite/sys_vars/t/tmp_table_size_basic.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/tmp_table_size_basic.test	2008-12-09 16:14:50 +0000
@@ -0,0 +1,206 @@
+########################### tmp_table_size_basic.test ##########################
+#                                                                              #
+# Variable Name: tmp_table_size                                                #
+# Scope: GLOBAL | SESSION                                                      #
+# Access Type: Dynamic                                                         #
+# Data Type: numeric                                                           #
+# Default Value: system dependend                                              #
+# Range: 1024-system dependend                                                 #
+#                                                                              #
+#                                                                              #
+# Creation Date: 2008-02-13                                                    #
+# Author:  Salman                                                              #
+#                                                                              #
+# Description: Test Cases of Dynamic System Variable tmp_table_size            #
+#              that checks the behavior of this variable in the following ways #
+#              * Default Value                                                 #
+#              * Valid & Invalid values                                        #
+#              * Scope & Access method                                         #
+#              * Data Integrity                                                #
+# Modified: 2008-12-04 HHunger                                                 #
+#              removed the differences between 64 and 32 bit platforms         #
+#                                                                              #
+# Reference:                                                                   #
+#    http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html       #
+#                                                                              #
+################################################################################
+
+--source include/load_sysvars.inc
+
+##############################################################
+#           START OF tmp_table_size TESTS                    #
+##############################################################
+
+#############################################################
+#                 Save initial value                        #
+#############################################################
+
+SET @start_global_value = @@global.tmp_table_size;
+SET @start_session_value = @@session.tmp_table_size;
+
+--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
+##############################################################
+#     Display the DEFAULT value of tmp_table_size            #
+##############################################################
+
+SET @@global.tmp_table_size = 100;
+SET @@global.tmp_table_size = DEFAULT;
+
+SET @@session.tmp_table_size = 200;
+SET @@session.tmp_table_size = DEFAULT;
+
+--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
+########################################################################
+#     Check the DEFAULT value of tmp_table_size                        #
+########################################################################
+# The DEFAULT value is system dependend.
+# Therefore we have only a plausibility check here
+SELECT @@global.tmp_table_size >= 16777216;
+
+SELECT @@session.tmp_table_size >= 16777216;
+
+--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
+########################################################################
+# Change the value of tmp_table_size to a valid value for GLOBAL Scope #
+########################################################################
+
+SET @@global.tmp_table_size = 1024;
+SELECT @@global.tmp_table_size;
+SET @@global.tmp_table_size = 60020;
+SELECT @@global.tmp_table_size;
+SET @@global.tmp_table_size = 4294967295;
+SELECT @@global.tmp_table_size;
+
+
+--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
+#########################################################################
+# Change the value of tmp_table_size to a valid value for SESSION Scope #
+#########################################################################
+
+SET @@session.tmp_table_size = 1024;
+SELECT @@session.tmp_table_size;
+
+SET @@session.tmp_table_size = 4294967295;
+SELECT @@session.tmp_table_size;
+SET @@session.tmp_table_size = 65535;
+SELECT @@session.tmp_table_size;
+
+
+--echo '#------------------FN_DYNVARS_005_05-----------------------#'
+##########################################################
+# Change the value of tmp_table_size to an invalid value #
+##########################################################
+
+SET @@global.tmp_table_size = 0;
+SELECT @@global.tmp_table_size;
+
+SET @@global.tmp_table_size = -1024;
+SELECT @@global.tmp_table_size;
+
+SET @@global.tmp_table_size = 1000;
+SELECT @@global.tmp_table_size;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.tmp_table_size = ON;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.tmp_table_size = OFF;
+
+SET @@global.tmp_table_size = True;
+SELECT @@global.tmp_table_size;
+
+SET @@global.tmp_table_size = False;
+SELECT @@global.tmp_table_size;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.tmp_table_size = 65530.34;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.tmp_table_size ="Test";
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.tmp_table_size = ON;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.tmp_table_size = OFF;
+
+SET @@session.tmp_table_size = True;
+SELECT @@session.tmp_table_size;
+
+SET @@session.tmp_table_size = False;
+SELECT @@session.tmp_table_size;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@session.tmp_table_size = "Test";
+
+SET @@session.tmp_table_size = 12345678901;
+
+# With a 64 bit mysqld:12345678901,with a 32 bit mysqld: 4294967295
+SELECT @@session.tmp_table_size IN (12345678901,4294967295);
+
+--echo '#------------------FN_DYNVARS_005_06-----------------------#'
+####################################################################
+#   Check if the value in GLOBAL Table matches value in variable   #
+####################################################################
+
+SELECT @@global.tmp_table_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='tmp_table_size';
+
+--echo '#------------------FN_DYNVARS_005_07-----------------------#'
+####################################################################
+#  Check if the value in SESSION Table matches value in variable   #
+####################################################################
+
+SELECT @@session.tmp_table_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='tmp_table_size';
+
+--echo '#---------------------FN_DYNVARS_001_09----------------------#'
+########################################################################
+#  Check if global and session variables are independent of each other #
+########################################################################
+
+SET @@global.tmp_table_size = 1024;
+SET @@tmp_table_size = 4294967295;
+SELECT @@tmp_table_size = @@global.tmp_table_size;
+
+--echo '#---------------------FN_DYNVARS_001_10----------------------#'
+##################################################################
+#    Check if accessing variable with SESSION,LOCAL and without  #
+#    SCOPE points to same session variable                       #
+##################################################################
+
+SET @@tmp_table_size = 100;
+SELECT @@tmp_table_size = @@local.tmp_table_size;
+SELECT @@local.tmp_table_size = @@session.tmp_table_size;
+
+
+--echo '#---------------------FN_DYNVARS_001_11----------------------#'
+#########################################################################
+#   Check if tmp_table_size can be accessed with and without @@ sign    #
+#########################################################################
+
+SET tmp_table_size = 1027;
+SELECT @@tmp_table_size;
+
+--Error ER_UNKNOWN_TABLE
+SELECT local.tmp_table_size;
+
+--Error ER_UNKNOWN_TABLE
+SELECT global.tmp_table_size;
+
+--Error ER_BAD_FIELD_ERROR
+SELECT tmp_table_size = @@session.tmp_table_size;
+
+####################################
+#     Restore initial value        #
+####################################
+
+SET @@global.tmp_table_size = @start_global_value;
+SET @@session.tmp_table_size = @start_session_value;
+
+###################################################
+#                 END OF tmp_table_size TESTS     #
+###################################################
+

=== removed file 'mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test'
--- a/mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test	2008-07-25 15:10:14 +0000
+++ b/mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test	1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 32 bit machines                                                  #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/tmp_table_size_basic.inc
-

=== removed file 'mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test'
--- a/mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test	2008-07-25 15:10:14 +0000
+++ b/mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test	1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger      2008-05-07                                      #
-#                                                                              #
-# Wrapper for 64 bit machines                                                  #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/tmp_table_size_basic.inc
-

=== modified file 'mysql-test/t/alter_table.test'
--- a/mysql-test/t/alter_table.test	2008-11-06 18:39:27 +0000
+++ b/mysql-test/t/alter_table.test	2008-12-09 14:05:03 +0000
@@ -751,6 +751,19 @@ ALTER TABLE t1 MODIFY COLUMN v VARCHAR(4
 SELECT * FROM t1;
 DROP TABLE t1;
 
+
+#
+# Bug#31291 ALTER TABLE CONVERT TO CHARACTER SET does not change some data types
+#
+create table t1 (a tinytext character set latin1);
+alter table t1 convert to character set utf8;
+show create table t1;
+drop table t1;
+create table t1 (a mediumtext character set latin1);
+alter table t1 convert to character set utf8;
+show create table t1;
+drop table t1;
+
 --echo End of 5.0 tests
 
 #

=== modified file 'mysql-test/t/ctype_ldml.test'
--- a/mysql-test/t/ctype_ldml.test	2008-10-31 12:25:42 +0000
+++ b/mysql-test/t/ctype_ldml.test	2008-12-09 08:41:43 +0000
@@ -111,3 +111,11 @@ set @@character_set_results=NULL;
 select * from t1;
 --disable_metadata
 drop table t1;
+
+#
+# Check maximum collation ID (2047 as of MySQL-6.0.9)
+#
+CREATE TABLE t1 (s1 char(10) character set utf8 collate utf8_maxuserid_ci);
+INSERT INTO t1 VALUES ('a'),('b');
+SELECT * FROM t1 WHERE s1='a' ORDER BY BINARY s1;
+DROP TABLE t1;

=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def	2008-12-05 11:27:19 +0000
+++ b/mysql-test/t/disabled.def	2008-12-09 14:35:21 +0000
@@ -19,7 +19,6 @@ csv_alter_table      : Bug#33696 2008-01
 cast                 : Bug#35594 2008-03-27 main.cast fails on Windows2003-64
 backup_triggers_and_events  : Bug#37762 2008-07-01 rafal Test fails on remove_file for unknown reasons
 backup_no_be                : Bug#38023 2008-07-16 rafal Test triggers valgrind warnings described in the bug
-thread_cache_size_func      : Bug#40575 2008-11-07 joro main.thread_cache_size_func fails in pushbuild when run with pool of threads
 log_output_basic     : Bug #40988  	log_output_basic.test succeeded though syntactically false.
 wait_timeout_func    : Bug #41225 joro wait_timeout_func fails
 

=== modified file 'mysql-test/t/fulltext.test'
--- a/mysql-test/t/fulltext.test	2008-11-18 11:38:28 +0000
+++ b/mysql-test/t/fulltext.test	2008-12-09 09:27:46 +0000
@@ -445,3 +445,12 @@ EXPLAIN SELECT * FROM t1 FORCE INDEX(b)
 WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
 
 DROP TABLE t1;
+
+#
+# BUG#37245 - Full text search problem
+#
+CREATE TABLE t1(a CHAR(10));
+INSERT INTO t1 VALUES('aaa15');
+SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE) FROM t1;
+SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1;
+DROP TABLE t1;

=== modified file 'mysql-test/t/func_str.test'
--- a/mysql-test/t/func_str.test	2008-02-24 00:31:54 +0000
+++ b/mysql-test/t/func_str.test	2008-12-09 11:16:39 +0000
@@ -1263,4 +1263,14 @@ CREATE VIEW v1 AS SELECT CHAR(0x414243) 
 SELECT HEX(c1) from v1;
 DROP VIEW v1;
 
+#
+# Bug #35558 Wrong server metadata blows up the client
+#
+create table t1(a float);
+insert into t1 values (1.33);
+--enable_metadata
+select format(a, 2) from t1;
+--disable_metadata
+drop table t1;
+
 --echo End of 5.0 tests

=== modified file 'mysql-test/t/innodb_mysql.test'
--- a/mysql-test/t/innodb_mysql.test	2008-11-27 15:03:13 +0000
+++ b/mysql-test/t/innodb_mysql.test	2008-12-08 10:23:33 +0000
@@ -53,3 +53,42 @@ CREATE TABLE t1 (a char(50)) ENGINE=Inno
 CREATE INDEX i1 on t1 (a(3));
 SELECT * FROM t1 WHERE a = 'abcde';
 DROP TABLE t1;
+
+#
+# Bug #37742: HA_EXTRA_KEYREAD flag is set when key contains only prefix of
+# requested column
+#
+
+CREATE TABLE foo (a int, b int, c char(10),
+                  PRIMARY KEY (c(3)),
+                  KEY b (b)
+) engine=innodb;
+
+CREATE TABLE foo2 (a int, b int, c char(10),
+                  PRIMARY KEY (c),
+                  KEY b (b)
+) engine=innodb;
+
+CREATE TABLE bar (a int, b int, c char(10),
+                  PRIMARY KEY (c(3)),
+                  KEY b (b)
+) engine=myisam;
+
+INSERT INTO foo VALUES
+   (1,2,'abcdefghij'), (2,3,''), (3,4,'klmnopqrst'),
+   (4,5,'uvwxyz'), (5,6,'meotnsyglt'), (4,5,'asfdewe');
+
+INSERT INTO bar SELECT * FROM foo;
+INSERT INTO foo2 SELECT * FROM foo;
+
+--query_vertical EXPLAIN SELECT c FROM bar WHERE b>2;
+--query_vertical EXPLAIN SELECT c FROM foo WHERE b>2;
+--query_vertical EXPLAIN SELECT c FROM foo2 WHERE b>2;
+
+--query_vertical EXPLAIN SELECT c FROM bar WHERE c>2;
+--query_vertical EXPLAIN SELECT c FROM foo WHERE c>2;
+--query_vertical EXPLAIN SELECT c FROM foo2 WHERE c>2;
+
+DROP TABLE foo, bar, foo2;
+
+--echo End of 5.1 tests

=== modified file 'mysql-test/t/myisampack.test'
--- a/mysql-test/t/myisampack.test	2007-11-07 08:55:28 +0000
+++ b/mysql-test/t/myisampack.test	2008-12-09 09:04:28 +0000
@@ -31,3 +31,28 @@ FLUSH TABLES;
 --exec $MYISAMCHK -s --unpack $MYSQLTEST_VARDIR/master-data/test/t1
 CHECK TABLE t1 EXTENDED;
 DROP TABLE t1;
+
+#
+# Bug#40949 Debug version of MySQL server crashes when run OPTIMIZE on compressed table.
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1(f1 int, f2 varchar(255));
+insert into t1 values(1, 'foo'), (2, 'bar');
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+insert into t1 select * from t1;
+flush tables;
+--exec $MYISAMPACK $MYSQLTEST_VARDIR/master-data/test/t1
+optimize table t1;
+drop table t1;

=== modified file 'mysql-test/t/partition.test'
--- a/mysql-test/t/partition.test	2008-11-24 22:54:28 +0000
+++ b/mysql-test/t/partition.test	2008-12-01 16:11:34 +0000
@@ -15,6 +15,15 @@ drop table if exists t1, t2;
 --enable_warnings
 
 #
+# Bug#36001: Partitions: spelling and using some error messages
+#
+
+--error ER_FOREIGN_KEY_ON_PARTITIONED
+CREATE TABLE t1 (a INT, FOREIGN KEY (a) REFERENCES t0 (a))
+ENGINE=MyISAM
+PARTITION BY HASH (a);
+
+#
 # Bug#40954: Crash if range search and order by.
 #
 CREATE TABLE t1 (

=== modified file 'mysql-test/t/thread_cache_size_func.test'
--- a/mysql-test/t/thread_cache_size_func.test	2008-10-15 18:58:53 +0000
+++ b/mysql-test/t/thread_cache_size_func.test	2008-12-09 12:05:13 +0000
@@ -29,6 +29,8 @@
 
 --source include/not_embedded.inc
 
+--source include/have_one-thread-per-connection.inc
+
 SET @global_thread_cache_size = @@GLOBAL.thread_cache_size;
 
 FLUSH STATUS;

=== modified file 'mysql-test/t/type_bit.test'
--- a/mysql-test/t/type_bit.test	2008-08-28 09:54:50 +0000
+++ b/mysql-test/t/type_bit.test	2008-12-09 13:31:22 +0000
@@ -352,6 +352,51 @@ SELECT HEX(b1), HEX(b2), i2 FROM t2
 
 DROP TABLE t1, t2;
 
+#
+# Bug #35796 SHOW CREATE TABLE and default value for BIT field
+#
+CREATE TABLE IF NOT EXISTS t1 (
+f1 bit(2) NOT NULL default b'10',
+f2 bit(14) NOT NULL default b'11110000111100'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--error ER_INVALID_DEFAULT
+CREATE TABLE IF NOT EXISTS t1 (
+f1 bit(2) NOT NULL default b''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+
+#
+# Bug#31399 Wrong query result when doing join buffering over BIT fields 
+#
+create table t1bit7 (a1 bit(7) not null) engine=MyISAM; 
+create table t2bit7 (b1 bit(7)) engine=MyISAM; 
+
+insert into t1bit7 values (b'1100000'); 
+insert into t1bit7 values (b'1100001'); 
+insert into t1bit7 values (b'1100010'); 
+insert into t2bit7 values (b'1100001'); 
+insert into t2bit7 values (b'1100010'); 
+insert into t2bit7 values (b'1100110'); 
+
+select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1; 
+drop table t1bit7, t2bit7; 
+
+create table t1bit7 (a1 bit(15) not null) engine=MyISAM; 
+create table t2bit7 (b1 bit(15)) engine=MyISAM; 
+
+insert into t1bit7 values (b'110000011111111'); 
+insert into t1bit7 values (b'110000111111111'); 
+insert into t1bit7 values (b'110001011111111'); 
+insert into t2bit7 values (b'110000111111111'); 
+insert into t2bit7 values (b'110001011111111'); 
+insert into t2bit7 values (b'110011011111111'); 
+
+select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1; 
+drop table t1bit7, t2bit7; 
+
 --echo End of 5.0 tests
 
 #

=== modified file 'mysql-test/t/type_float.test'
--- a/mysql-test/t/type_float.test	2007-12-08 17:19:16 +0000
+++ b/mysql-test/t/type_float.test	2008-12-09 09:27:28 +0000
@@ -283,4 +283,20 @@ insert into t1 values (1.225e-05);
 select a+0 from t1;
 drop table t1;
 
+# 
+# Bug #27483: Casting 'scientific notation type' to 'unsigned bigint' fails on 
+#             windows.
+#
+
+create table t1(d double, u bigint unsigned);
+
+insert into t1(d) values (9.223372036854775808e+18),
+                         (9.223372036854779e18),
+                         (9.22337203685479e18),
+                         (1.84e19);
+
+update t1 set u = d;
+select u from t1;
+drop table t1;
+
 --echo End of 5.0 tests

=== modified file 'mysys/charset.c'
--- a/mysys/charset.c	2008-07-24 11:33:35 +0000
+++ b/mysys/charset.c	2008-12-09 08:41:43 +0000
@@ -42,7 +42,7 @@ get_collation_number_internal(const char
 {
   CHARSET_INFO **cs;
   for (cs= all_charsets;
-       cs < all_charsets+array_elements(all_charsets)-1 ;
+       cs < all_charsets + array_elements(all_charsets);
        cs++)
   {
     if ( cs[0] && cs[0]->name && 
@@ -452,7 +452,7 @@ static my_bool init_available_charsets(m
       
       /* Copy compiled charsets */
       for (cs=all_charsets;
-           cs < all_charsets+array_elements(all_charsets)-1 ;
+           cs < all_charsets + array_elements(all_charsets);
            cs++)
       {
         if (*cs)
@@ -492,7 +492,7 @@ uint get_charset_number(const char *char
   init_available_charsets(MYF(0));
   
   for (cs= all_charsets;
-       cs < all_charsets+array_elements(all_charsets)-1 ;
+       cs < all_charsets + array_elements(all_charsets);
        cs++)
   {
     if ( cs[0] && cs[0]->csname && (cs[0]->state & cs_flags) &&
@@ -555,7 +555,7 @@ CHARSET_INFO *get_charset(uint cs_number
 
   (void) init_available_charsets(MYF(0));	/* If it isn't initialized */
   
-  if (!cs_number || cs_number >= array_elements(all_charsets)-1)
+  if (!cs_number || cs_number > array_elements(all_charsets))
     return NULL;
   
   cs=get_internal_charset(cs_number, flags);

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2008-11-27 13:36:48 +0000
+++ b/sql/field.cc	2008-12-09 12:25:17 +0000
@@ -3821,7 +3821,7 @@ int Field_longlong::store(double nr)
       error= 1;
     }
     else
-      res=(longlong) (ulonglong) nr;
+      res=(longlong) double2ulonglong(nr);
   }
   else
   {

=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc	2008-11-24 22:54:28 +0000
+++ b/sql/ha_partition.cc	2008-12-01 15:11:54 +0000
@@ -239,6 +239,7 @@ void ha_partition::init_handler_variable
   m_curr_key_info[0]= NULL;
   m_curr_key_info[1]= NULL;
   is_clone= FALSE,
+  m_part_func_monotonicity_info= NON_MONOTONIC;
   auto_increment_lock= FALSE;
   auto_increment_safe_stmt_log_lock= FALSE;
   /*
@@ -2450,11 +2451,17 @@ int ha_partition::open(const char *name,
     }
   }
 
+  /* Initialize the bitmap we use to minimize ha_start_bulk_insert calls */
+  if (bitmap_init(&m_bulk_insert_started, NULL, m_tot_parts + 1, FALSE))
+    DBUG_RETURN(1);
   /* Initialize the bitmap we use to determine what partitions are used */
   if (!is_clone)
   {
     if (bitmap_init(&(m_part_info->used_partitions), NULL, m_tot_parts, TRUE))
+    {
+      bitmap_free(&m_bulk_insert_started);
       DBUG_RETURN(1);
+    }
     bitmap_set_all(&(m_part_info->used_partitions));
   }
 
@@ -2538,12 +2545,18 @@ int ha_partition::open(const char *name,
     calling open on all individual handlers.
   */
   m_handler_status= handler_opened;
+  if (m_part_info->part_expr)
+    m_part_func_monotonicity_info=
+                            m_part_info->part_expr->get_monotonicity_info();
+  else if (m_part_info->list_of_part_fields)
+    m_part_func_monotonicity_info= MONOTONIC_STRICT_INCREASING;
   info(HA_STATUS_VARIABLE | HA_STATUS_CONST);
   DBUG_RETURN(0);
 
 err_handler:
   while (file-- != m_file)
     (*file)->close();
+  bitmap_free(&m_bulk_insert_started);
   if (!is_clone)
     bitmap_free(&(m_part_info->used_partitions));
 
@@ -2591,6 +2604,7 @@ int ha_partition::close(void)
 
   DBUG_ASSERT(table->s == table_share);
   delete_queue(&m_queue);
+  bitmap_free(&m_bulk_insert_started);
   if (!is_clone)
     bitmap_free(&(m_part_info->used_partitions));
   file= m_file;
@@ -2976,6 +2990,8 @@ int ha_partition::write_row(uchar * buf)
   }
   m_last_part= part_id;
   DBUG_PRINT("info", ("Insert in partition %d", part_id));
+  start_part_bulk_insert(part_id);
+
   tmp_disable_binlog(thd); /* Do not replicate the low-level changes. */
   error= m_file[part_id]->ha_write_row(buf);
   if (have_auto_increment && !table->s->next_number_keypart)
@@ -3038,6 +3054,7 @@ int ha_partition::update_row(const uchar
   }
 
   m_last_part= new_part_id;
+  start_part_bulk_insert(new_part_id);
   if (new_part_id == old_part_id)
   {
     DBUG_PRINT("info", ("Update in partition %d", new_part_id));
@@ -3197,23 +3214,66 @@ int ha_partition::delete_all_rows()
   DESCRIPTION
     rows == 0 means we will probably insert many rows
 */
-
 void ha_partition::start_bulk_insert(ha_rows rows)
 {
-  handler **file;
   DBUG_ENTER("ha_partition::start_bulk_insert");
 
-  rows= rows ? rows/m_tot_parts + 1 : 0;
-  file= m_file;
-  do
-  {
-    (*file)->ha_start_bulk_insert(rows);
-  } while (*(++file));
+  m_bulk_inserted_rows= 0;
+  bitmap_clear_all(&m_bulk_insert_started);
+  /* use the last bit for marking if bulk_insert_started was called */
+  bitmap_set_bit(&m_bulk_insert_started, m_tot_parts);
   DBUG_VOID_RETURN;
 }
 
 
 /*
+  Check if start_bulk_insert has been called for this partition,
+  if not, call it and mark it called
+*/
+void ha_partition::start_part_bulk_insert(uint part_id)
+{
+  if (!bitmap_is_set(&m_bulk_insert_started, part_id) &&
+      bitmap_is_set(&m_bulk_insert_started, m_tot_parts))
+  {
+    m_file[part_id]->ha_start_bulk_insert(guess_bulk_insert_rows());
+    bitmap_set_bit(&m_bulk_insert_started, part_id);
+  }
+  m_bulk_inserted_rows++;
+}
+
+
+/*
+  Try to predict the number of inserts into this partition.
+
+  If less than 10 rows (including 0 which means Unknown)
+    just give that as a guess
+  If monotonic partitioning function was used
+    guess that 50 % of the inserts goes to the first partition
+  For all other cases, guess on equal distribution between the partitions
+*/ 
+ha_rows ha_partition::guess_bulk_insert_rows()
+{
+  DBUG_ENTER("guess_bulk_insert_rows");
+
+  if (estimation_rows_to_insert < 10)
+    DBUG_RETURN(estimation_rows_to_insert);
+
+  /* If first insert/partition and monotonic partition function, guess 50%.  */
+  if (!m_bulk_inserted_rows && 
+      m_part_func_monotonicity_info != NON_MONOTONIC &&
+      m_tot_parts > 1)
+    DBUG_RETURN(estimation_rows_to_insert / 2);
+
+  /* Else guess on equal distribution (+1 is to avoid returning 0/Unknown) */
+  if (m_bulk_inserted_rows < estimation_rows_to_insert)
+    DBUG_RETURN(((estimation_rows_to_insert - m_bulk_inserted_rows)
+                / m_tot_parts) + 1);
+  /* The estimation was wrong, must say 'Unknown' */
+  DBUG_RETURN(0);
+}
+
+
+/*
   Finish a large batch of insert rows
 
   SYNOPSIS
@@ -3228,16 +3288,18 @@ void ha_partition::start_bulk_insert(ha_
 int ha_partition::end_bulk_insert(bool abort)
 {
   int error= 0;
-  handler **file;
+  uint i;
   DBUG_ENTER("ha_partition::end_bulk_insert");
 
-  file= m_file;
-  do
+  DBUG_ASSERT(bitmap_is_set(&m_bulk_insert_started, m_tot_parts));
+  for (i= 0; i < m_tot_parts; i++)
   {
     int tmp;
-    if ((tmp= (*file)->ha_end_bulk_insert(abort)))
+    if (bitmap_is_set(&m_bulk_insert_started, i) &&
+        (tmp= m_file[i]->ha_end_bulk_insert(abort)))
       error= tmp;
-  } while (*(++file));
+  }
+  bitmap_clear_all(&m_bulk_insert_started);
   DBUG_RETURN(error);
 }
 

=== modified file 'sql/ha_partition.h'
--- a/sql/ha_partition.h	2008-11-15 00:34:27 +0000
+++ b/sql/ha_partition.h	2008-12-01 15:11:54 +0000
@@ -177,6 +177,11 @@ private:
     This to ensure it will work with statement based replication.
   */
   bool auto_increment_safe_stmt_log_lock;
+  /** For optimizing ha_start_bulk_insert calls */
+  MY_BITMAP m_bulk_insert_started;
+  ha_rows   m_bulk_inserted_rows;
+  /** used for prediction of start_bulk_insert rows */
+  enum_monotonicity_info m_part_func_monotonicity_info;
 public:
   handler *clone(MEM_ROOT *mem_root);
   virtual void set_part_info(partition_info *part_info, bool early)
@@ -348,7 +353,6 @@ public:
     Bulk inserts are supported if all underlying handlers support it.
     start_bulk_insert and end_bulk_insert is called before and after a
     number of calls to write_row.
-    Not yet though.
   */
   virtual int write_row(uchar * buf);
   virtual int update_row(const uchar * old_data, uchar * new_data);
@@ -356,6 +360,10 @@ public:
   virtual int delete_all_rows(void);
   virtual void start_bulk_insert(ha_rows rows);
   virtual int end_bulk_insert(bool);
+private:
+  ha_rows guess_bulk_insert_rows();
+  void start_part_bulk_insert(uint part_id);
+public:
 
   virtual bool is_fatal_error(int error, uint flags)
   {

=== modified file 'sql/item.cc'
--- a/sql/item.cc	2008-11-06 18:39:27 +0000
+++ b/sql/item.cc	2008-12-09 12:08:02 +0000
@@ -5294,6 +5294,9 @@ int Item_hex_string::save_in_field(Field
 
   ulonglong nr;
   uint32 length= str_value.length();
+  if (!length)
+    return 1;
+
   if (length > 8)
   {
     nr= field->flags & UNSIGNED_FLAG ? ULONGLONG_MAX : LONGLONG_MAX;

=== modified file 'sql/item_strfunc.cc'
--- a/sql/item_strfunc.cc	2008-10-20 09:16:47 +0000
+++ b/sql/item_strfunc.cc	2008-12-09 12:08:02 +0000
@@ -2177,10 +2177,11 @@ Item_func_format::Item_func_format(Item 
 
 void Item_func_format::fix_length_and_dec()
 {
-  collation.set(default_charset());
   uint char_length= args[0]->max_length/args[0]->collation.collation->mbmaxlen;
-  max_length= ((char_length + (char_length-args[0]->decimals)/3) *
-               collation.collation->mbmaxlen);
+  uint max_sep_count= char_length/3 + (decimals ? 1 : 0) + /*sign*/1;
+  collation.set(default_charset());
+  max_length= (char_length + max_sep_count + decimals) *
+    collation.collation->mbmaxlen;
 }
 
 

=== modified file 'sql/log.cc'
--- a/sql/log.cc	2008-11-13 08:40:43 +0000
+++ b/sql/log.cc	2008-12-09 14:05:03 +0000
@@ -230,6 +230,7 @@ public:
       truncate(0);
     before_stmt_pos= MY_OFF_T_UNDEF;
     trans_log.end_of_file= max_binlog_cache_size;
+    DBUG_ASSERT(empty());
   }
 
   Rows_log_event *pending() const
@@ -2596,8 +2597,6 @@ binlog_end_trans(THD *thd, binlog_trx_da
                       FLAGSTR(thd->options, OPTION_NOT_AUTOCOMMIT),
                       FLAGSTR(thd->options, OPTION_BEGIN)));
 
-  thd->binlog_flush_pending_rows_event(TRUE);
-
   /*
     NULL denotes ROLLBACK with nothing to replicate: i.e., rollback of
     only transactional tables.  If the transaction contain changes to
@@ -2606,6 +2605,7 @@ binlog_end_trans(THD *thd, binlog_trx_da
   */
   if (end_ev != NULL)
   {
+    thd->binlog_flush_pending_rows_event(TRUE);
     /*
       Doing a commit or a rollback including non-transactional tables,
       i.e., ending a transaction where we might write the transaction
@@ -2659,6 +2659,7 @@ binlog_end_trans(THD *thd, binlog_trx_da
     mysql_bin_log.update_table_map_version();
   }
 
+  DBUG_ASSERT(thd->binlog_get_pending_rows_event() == NULL);
   DBUG_RETURN(error);
 }
 
@@ -2690,6 +2691,7 @@ static int binlog_prepare(handlerton *ht
 */
 static int binlog_commit(handlerton *hton, THD *thd, bool all)
 {
+  int error= 0;
   DBUG_ENTER("binlog_commit");
   binlog_trx_data *const trx_data=
     (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton);
@@ -2702,60 +2704,11 @@ static int binlog_commit(handlerton *hto
   }
 
   /*
-    Decision table for committing a transaction. The top part, the
-    *conditions* represent different cases that can occur, and hte
-    bottom part, the *actions*, represent what should be done in that
-    particular case.
-
-    Real transaction        'all' was true
-
-    Statement in cache      There were at least one statement in the
-                            transaction cache
-
-    In transaction          We are inside a transaction
-
-    Stmt modified non-trans The statement being committed modified a
-                            non-transactional table
-
-    All modified non-trans  Some statement before this one in the
-                            transaction modified a non-transactional
-                            table
-
-
-    =============================  = = = = = = = = = = = = = = = =
-    Real transaction               N N N N N N N N N N N N N N N N
-    Statement in cache             N N N N N N N N Y Y Y Y Y Y Y Y
-    In transaction                 N N N N Y Y Y Y N N N N Y Y Y Y
-    Stmt modified non-trans        N N Y Y N N Y Y N N Y Y N N Y Y
-    All modified non-trans         N Y N Y N Y N Y N Y N Y N Y N Y
-
-    Action: (C)ommit/(A)ccumulate  C C - C A C - C - - - - A A - A
-    =============================  = = = = = = = = = = = = = = = =
+    We commit the transaction if:
 
+     - We are not in a transaction and committing a statement, or
 
-    =============================  = = = = = = = = = = = = = = = =
-    Real transaction               Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y
-    Statement in cache             N N N N N N N N Y Y Y Y Y Y Y Y
-    In transaction                 N N N N Y Y Y Y N N N N Y Y Y Y
-    Stmt modified non-trans        N N Y Y N N Y Y N N Y Y N N Y Y
-    All modified non-trans         N Y N Y N Y N Y N Y N Y N Y N Y
-
-    (C)ommit/(A)ccumulate/(-)      - - - - C C - C - - - - C C - C
-    =============================  = = = = = = = = = = = = = = = =
-
-    In other words, we commit the transaction if and only if both of
-    the following are true:
-     - We are not in a transaction and committing a statement
-
-     - We are in a transaction and one (or more) of the following are
-       true:
-
-       - A full transaction is committed
-
-         OR
-
-       - A non-transactional statement is committed and there is
-         no statement cached
+     - We are in a transaction and a full transaction is committed
 
     Otherwise, we accumulate the statement
   */
@@ -2770,23 +2723,22 @@ static int binlog_commit(handlerton *hto
               YESNO(thd->transaction.stmt.modified_non_trans_table)));
   if (thd->options & OPTION_BIN_LOG)
   {
-    if (in_transaction &&
-        (all ||
-         (!trx_data->at_least_one_stmt &&
-          thd->transaction.stmt.modified_non_trans_table)) ||
-        !in_transaction && !all)
+    if (!in_transaction || all)
     {
       Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE);
       qev.error_code= 0; // see comment in MYSQL_LOG::write(THD, IO_CACHE)
-      int error= binlog_end_trans(thd, trx_data, &qev, all);
-      DBUG_RETURN(error);
+      error= binlog_end_trans(thd, trx_data, &qev, all);
+      goto end;
     }
   }
   else
   {
     trx_data->reset();
   }
-  DBUG_RETURN(0);
+end:
+  if (!all)
+    trx_data->before_stmt_pos = MY_OFF_T_UNDEF; // part of the stmt commit
+  DBUG_RETURN(error);
 }
 
 /**
@@ -2846,6 +2798,8 @@ static int binlog_rollback(handlerton *h
      */
     error= binlog_end_trans(thd, trx_data, 0, all);
   }
+  if (!all)
+    trx_data->before_stmt_pos = MY_OFF_T_UNDEF; // part of the stmt rollback
   DBUG_RETURN(error);
 }
 

=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h	2008-12-05 01:05:05 +0000
+++ b/sql/mysql_priv.h	2008-12-09 09:27:28 +0000
@@ -594,7 +594,6 @@ enum open_table_mode
 #define UNCACHEABLE_PREPARE    16
 /* For uncorrelated SELECT in an UNION with some correlated SELECTs */
 #define UNCACHEABLE_UNITED     32
-#define UNCACHEABLE_CHECKOPTION   64
 
 /* Used to check GROUP BY list in the MODE_ONLY_FULL_GROUP_BY mode */
 #define UNDEF_POS (-1)

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2008-12-05 01:05:05 +0000
+++ b/sql/mysqld.cc	2008-12-08 15:32:57 +0000
@@ -261,6 +261,12 @@ int backup_init();
 void backup_shutdown();
 #endif
 
+#if defined(__linux__)
+#define ENABLE_TEMP_POOL 1
+#else
+#define ENABLE_TEMP_TOOL 0
+#endif
+
 /* Constants */
 
 const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"};
@@ -3636,8 +3642,13 @@ static int init_common_variables(const c
     return 1; /* purecov: tested */
 #endif /* defined(ENABLED_DEBUG_SYNC) */
 
+#if (ENABLE_TEMP_POOL)
   if (use_temp_pool && bitmap_init(&temp_pool,0,1024,1))
     return 1;
+#else
+  use_temp_pool= 0;
+#endif
+
   if (my_database_names_init())
     return 1;
 
@@ -6648,9 +6659,14 @@ log and this option does nothing anymore
    0, GET_UINT, OPT_ARG, 0, 0, UINT_MAX, 0, 0, 0},
 #endif /* defined(ENABLED_DEBUG_SYNC) */
   {"temp-pool", OPT_TEMP_POOL,
+#if (ENABLE_TEMP_POOL)
    "Using this option will cause most temporary files created to use a small set of names, rather than a unique name for each new file.",
+#else
+   "This option is ignored on this OS.",
+#endif
    (uchar**) &use_temp_pool, (uchar**) &use_temp_pool, 0, GET_BOOL, NO_ARG, 1,
    0, 0, 0, 0, 0},
+
   {"timed_mutexes", OPT_TIMED_MUTEXES,
    "Specify whether to time mutexes (only InnoDB mutexes are currently supported)",
    (uchar**) &timed_mutexes, (uchar**) &timed_mutexes, 0, GET_BOOL, NO_ARG, 0,

=== modified file 'sql/share/errmsg.txt'
--- a/sql/share/errmsg.txt	2008-11-21 15:14:47 +0000
+++ b/sql/share/errmsg.txt	2008-12-01 16:11:34 +0000
@@ -5769,9 +5769,9 @@ ER_PARTITION_MGMT_ON_NONPARTITIONED
         ger "Partitionsverwaltung einer nicht partitionierten Tabelle ist nicht mREIGN_KEY_ON_PARTITIONED
-        eng "Foreign key condition is not yet supported in conjunction with partitioning"
+        eng "Foreign key clause is not yet supported in conjunction with partitioning"
         ger "Fremdschl�Beschr nicht zul�ig"
-        swe "Foreign key villkor �inte �u implementerad i kombination med partitionering"
+        swe "Foreign key klausul �inte �u implementerad i kombination med partitionering"
 ER_DROP_PARTITION_NON_EXISTENT
         eng "Error in list of partitions to %-.64s"
         ger "Fehler in der Partitionsliste bei %-.64s"
@@ -5785,13 +5785,13 @@ ER_COALESCE_ONLY_ON_HASH_PARTITION
         ger "COALESCE PARTITION kann nur auf HASH- oder KEY-Partitionen benutzt werden"
         swe "COALESCE PARTITION kan bara anv�as p�ASH/KEY partitioner"
 ER_REORG_HASH_ONLY_ON_SAME_NO
-        eng "REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers"
+        eng "REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers"
         ger "REORGANIZE PARTITION kann nur zur Reorganisation von Partitionen verwendet werden, nicht, um ihre Nummern zu �ern"
-        swe "REORGANISE PARTITION kan bara anv �ra deras antal"
+        swe "REORGANIZE PARTITION kan bara anv�as f�tt omorganisera partitioner, inte f�tt �ra deras antal"
 ER_REORG_NO_PARAM_ERROR
-        eng "REORGANISE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs"
+        eng "REORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs"
         ger "REORGANIZE PARTITION ohne Parameter kann nur f�o-partitionierte Tabellen verwendet werden, die HASH-Partitionierung benutzen"
-        swe "REORGANISE PARTITION utan parametrar kan bara anv�as partitionering"
+        swe "REORGANIZE PARTITION utan parametrar kan bara anv�as p�uto-partitionerade tabeller som anv�er HASH partitionering"
 ER_ONLY_ON_RANGE_LIST_PARTITION
         eng "%-.64s PARTITION can only be used on RANGE/LIST partitions"
         ger "%-.64s PARTITION kann nur f�GE- oder LIST-Partitionen verwendet werden"
@@ -5809,7 +5809,7 @@ ER_COALESCE_PARTITION_NO_PARTITION
         ger "Zumindest eine Partition muss mit COALESCE PARTITION zusammengef�rden"
         swe "�minstone en partition m�e sl�ihop vid COALESCE PARTITION"
 ER_REORG_PARTITION_NOT_EXIST
-        eng "More partitions to reorganise than there are partitions"
+        eng "More partitions to reorganize than there are partitions"
         ger "Es wurde versucht, mehr Partitionen als vorhanden zu reorganisieren"
         swe "Fler partitioner att reorganisera �det finns partitioner"
 ER_SAME_NAME_PARTITION
@@ -5821,7 +5821,7 @@ ER_NO_BINLOG_ERROR
         ger "Es es nicht erlaubt, bei diesem Befehl binlog abzuschalten"
         swe "Det �inte till�t att st�a av binlog p�etta kommando"
 ER_CONSECUTIVE_REORG_PARTITIONS
-        eng "When reorganising a set of partitions they must be in consecutive order"
+        eng "When reorganizing a set of partitions they must be in consecutive order"
         ger "Bei der Reorganisation eines Satzes von Partitionen m�diese in geordneter Reihenfolge vorliegen"
         swe "N�ett antal partitioner omorganiseras m�e de vara i konsekutiv ordning"
 ER_REORG_OUTSIDE_RANGE

=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc	2008-11-04 11:30:00 +0000
+++ b/sql/sql_partition.cc	2008-12-01 14:59:09 +0000
@@ -5287,8 +5287,8 @@ static bool write_log_changed_partitions
   DDL_LOG_ENTRY ddl_log_entry;
   partition_info *part_info= lpt->part_info;
   DDL_LOG_MEMORY_ENTRY *log_entry;
-  char tmp_path[FN_LEN];
-  char normal_path[FN_LEN];
+  char tmp_path[FN_REFLEN];
+  char normal_path[FN_REFLEN];
   List_iterator<partition_element> part_it(part_info->partitions);
   uint temp_partitions= part_info->temp_partitions.elements;
   uint no_elements= part_info->partitions.elements;
@@ -5499,7 +5499,7 @@ static bool write_log_drop_shadow_frm(AL
   partition_info *part_info= lpt->part_info;
   DDL_LOG_MEMORY_ENTRY *log_entry;
   DDL_LOG_MEMORY_ENTRY *exec_log_entry= NULL;
-  char shadow_path[FN_LEN];
+  char shadow_path[FN_REFLEN];
   DBUG_ENTER("write_log_drop_shadow_frm");
 
   build_table_shadow_filename(shadow_path, sizeof(shadow_path), lpt);
@@ -5542,8 +5542,8 @@ static bool write_log_rename_frm(ALTER_P
   partition_info *part_info= lpt->part_info;
   DDL_LOG_MEMORY_ENTRY *log_entry;
   DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
-  char path[FN_LEN];
-  char shadow_path[FN_LEN];
+  char path[FN_REFLEN];
+  char shadow_path[FN_REFLEN];
   DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->first_log_entry;
   DBUG_ENTER("write_log_rename_frm");
 
@@ -5593,8 +5593,8 @@ static bool write_log_drop_partition(ALT
   partition_info *part_info= lpt->part_info;
   DDL_LOG_MEMORY_ENTRY *log_entry;
   DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
-  char tmp_path[FN_LEN];
-  char path[FN_LEN];
+  char tmp_path[FN_REFLEN];
+  char path[FN_REFLEN];
   uint next_entry= 0;
   DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->first_log_entry;
   DBUG_ENTER("write_log_drop_partition");
@@ -5652,8 +5652,8 @@ static bool write_log_add_change_partiti
   partition_info *part_info= lpt->part_info;
   DDL_LOG_MEMORY_ENTRY *log_entry;
   DDL_LOG_MEMORY_ENTRY *exec_log_entry= NULL;
-  char tmp_path[FN_LEN];
-  char path[FN_LEN];
+  char tmp_path[FN_REFLEN];
+  char path[FN_REFLEN];
   uint next_entry= 0;
   DBUG_ENTER("write_log_add_change_partition");
 
@@ -5706,8 +5706,8 @@ static bool write_log_final_change_parti
   partition_info *part_info= lpt->part_info;
   DDL_LOG_MEMORY_ENTRY *log_entry;
   DDL_LOG_MEMORY_ENTRY *exec_log_entry= part_info->exec_log_entry;
-  char path[FN_LEN];
-  char shadow_path[FN_LEN];
+  char path[FN_REFLEN];
+  char shadow_path[FN_REFLEN];
   DDL_LOG_MEMORY_ENTRY *old_first_log_entry= part_info->first_log_entry;
   uint next_entry= 0;
   DBUG_ENTER("write_log_final_change_partition");

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2008-11-24 16:51:44 +0000
+++ b/sql/sql_select.cc	2008-12-09 14:05:03 +0000
@@ -16871,6 +16871,7 @@ join_init_cache(THD *thd,JOIN_TAB *table
   length=0;
   for (i=0 ; i < table_count ; i++)
   {
+    bool have_bit_fields= FALSE;
     uint null_fields=0,used_fields;
     Field **f_ptr,*field;
     MY_BITMAP *read_set= tables[i].table->read_set;
@@ -16885,14 +16886,17 @@ join_init_cache(THD *thd,JOIN_TAB *table
 	length+=field->fill_cache_field(copy);
 	if (copy->blob_field)
 	  (*blob_ptr++)=copy;
-	if (field->maybe_null())
+	if (field->real_maybe_null())
 	  null_fields++;
         copy->get_rowid= NULL;
+        if (field->type() == MYSQL_TYPE_BIT &&
+            ((Field_bit*)field)->bit_len)
+          have_bit_fields= TRUE;
 	copy++;
       }
     }
     /* Copy null bits from table */
-    if (null_fields && tables[i].table->s->null_fields)
+    if (null_fields || have_bit_fields)
     {						/* must copy null bits */
       copy->str= tables[i].table->null_flags;
       copy->length= tables[i].table->s->null_bytes;

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2008-11-28 16:30:27 +0000
+++ b/sql/sql_show.cc	2008-12-09 12:08:02 +0000
@@ -862,6 +862,7 @@ static bool get_field_default_value(THD 
 {
   bool has_default;
   bool has_now_default;
+  enum enum_field_types field_type= field->type();
 
   /*
      We are using CURRENT_TIMESTAMP instead of NOW because it is
@@ -870,7 +871,7 @@ static bool get_field_default_value(THD 
   has_now_default= (timestamp_field == field &&
                     field->unireg_check != Field::TIMESTAMP_UN_FIELD);
 
-  has_default= (field->type() != FIELD_TYPE_BLOB &&
+  has_default= (field_type != FIELD_TYPE_BLOB &&
                 !(field->flags & NO_DEFAULT_VALUE_FLAG) &&
                 field->unireg_check != Field::NEXT_NUMBER &&
                 !((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40))
@@ -885,7 +886,19 @@ static bool get_field_default_value(THD 
     {                                             // Not null by default
       char tmp[MAX_FIELD_WIDTH];
       String type(tmp, sizeof(tmp), field->charset());
-      field->val_str(&type);
+      if (field_type == MYSQL_TYPE_BIT)
+      {
+        longlong dec= field->val_int();
+        char *ptr= longlong2str(dec, tmp + 2, 2);
+        uint32 length= (uint32) (ptr - tmp);
+        tmp[0]= 'b';
+        tmp[1]= '\'';        
+        tmp[length]= '\'';
+        type.length(length + 1);
+        quoted= 0;
+      }
+      else
+        field->val_str(&type);
       if (type.length())
       {
         String def_val;

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2008-11-24 19:01:54 +0000
+++ b/sql/sql_table.cc	2008-12-09 14:05:03 +0000
@@ -3192,10 +3192,12 @@ static bool prepare_blob_field(THD *thd,
     push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_AUTO_CONVERT,
                  warn_buff);
   }
-    
+
   if ((sql_field->flags & BLOB_FLAG) && sql_field->length)
   {
-    if (sql_field->sql_type == MYSQL_TYPE_BLOB)
+    if (sql_field->sql_type == FIELD_TYPE_BLOB ||
+        sql_field->sql_type == FIELD_TYPE_TINY_BLOB ||
+        sql_field->sql_type == FIELD_TYPE_MEDIUM_BLOB)
     {
       /* The user has given a length to the blob column */
       sql_field->sql_type= get_blob_type_from_length(sql_field->length);
@@ -3380,7 +3382,7 @@ bool mysql_create_table_no_lock(THD *thd
       if (key->type == Key::FOREIGN_KEY &&
           !part_info->is_auto_partitioned)
       {
-        my_error(ER_CANNOT_ADD_FOREIGN, MYF(0));
+        my_error(ER_FOREIGN_KEY_ON_PARTITIONED, MYF(0));
         goto err;
       }
     }
@@ -4362,6 +4364,7 @@ static bool mysql_admin_table(THD* thd, 
       table->table=0;				// For query cache
       if (protocol->write())
 	goto err;
+      thd->main_da.reset_diagnostics_area();
       continue;
       /* purecov: end */
     }

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2008-10-20 19:13:22 +0000
+++ b/sql/table.cc	2008-12-08 13:44:20 +0000
@@ -1565,7 +1565,9 @@ static int open_binary_frm(THD *thd, TAB
           */
           if (ha_option & HA_PRIMARY_KEY_IN_READ_INDEX)
           {
-            field->part_of_key= share->keys_in_use;
+            if (field->key_length() == key_part->length &&
+                !(field->flags & BLOB_FLAG))
+              field->part_of_key= share->keys_in_use;
             if (field->part_of_sortkey.is_set(key))
               field->part_of_sortkey= share->keys_in_use;
           }

=== modified file 'storage/myisam/ft_boolean_search.c'
--- a/storage/myisam/ft_boolean_search.c	2008-05-29 15:44:11 +0000
+++ b/storage/myisam/ft_boolean_search.c	2008-12-09 10:16:06 +0000
@@ -161,11 +161,11 @@ static int FTB_WORD_cmp(my_off_t *v, FTB
 
 static int FTB_WORD_cmp_list(CHARSET_INFO *cs, FTB_WORD **a, FTB_WORD **b)
 {
-  /* ORDER BY word DESC, ndepth DESC */
-  int i= ha_compare_text(cs, (uchar*) (*b)->word+1,(*b)->len-1,
-                             (uchar*) (*a)->word+1,(*a)->len-1,0,0);
+  /* ORDER BY word, ndepth */
+  int i= ha_compare_text(cs, (uchar*) (*a)->word + 1, (*a)->len - 1,
+                             (uchar*) (*b)->word + 1, (*b)->len - 1, 0, 0);
   if (!i)
-    i=CMP_NUM((*b)->ndepth,(*a)->ndepth);
+    i= CMP_NUM((*a)->ndepth, (*b)->ndepth);
   return i;
 }
 
@@ -865,23 +865,49 @@ static int ftb_find_relevance_add_word(M
   FT_INFO *ftb= ftb_param->ftb;
   FTB_WORD *ftbw;
   int a, b, c;
+  /*
+    Find right-most element in the array of query words matching this
+    word from a document.
+  */
   for (a= 0, b= ftb->queue.elements, c= (a+b)/2; b-a>1; c= (a+b)/2)
   {
     ftbw= ftb->list[c];
     if (ha_compare_text(ftb->charset, (uchar*)word, len,
                         (uchar*)ftbw->word+1, ftbw->len-1,
-                        (my_bool)(ftbw->flags&FTB_FLAG_TRUNC), 0) > 0)
+                        (my_bool) (ftbw->flags & FTB_FLAG_TRUNC), 0) < 0)
       b= c;
     else
       a= c;
   }
+  /*
+    If there were no words with truncation operator, we iterate to the
+    beginning of an array until array element is equal to the word from
+    a document. This is done mainly because the same word may be
+    mentioned twice (or more) in the query.
+
+    In case query has words with truncation operator we must iterate
+    to the beginning of the array. There may be non-matching query words
+    between matching word with truncation operator and the right-most
+    matching element. E.g., if we're looking for 'aaa15' in an array of
+    'aaa1* aaa14 aaa15 aaa16'.
+
+    Worse of that there still may be match even if the binary search
+    above didn't find matching element. E.g., if we're looking for
+    'aaa15' in an array of 'aaa1* aaa14 aaa16'. The binary search will
+    stop at 'aaa16'.
+  */
   for (; c >= 0; c--)
   {
     ftbw= ftb->list[c];
     if (ha_compare_text(ftb->charset, (uchar*)word, len,
                         (uchar*)ftbw->word + 1,ftbw->len - 1,
                         (my_bool)(ftbw->flags & FTB_FLAG_TRUNC), 0))
-      break;
+    {
+      if (ftb->with_scan & FTB_FLAG_TRUNC)
+        continue;
+      else
+        break;
+    }
     if (ftbw->docid[1] == ftb->info->lastpos)
       continue;
     ftbw->docid[1]= ftb->info->lastpos;

Thread
bzr commit into mysql-6.0-bugteam branch (satya.bn:2937)Satya B10 Dec