List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:August 15 2008 8:39pm
Subject:bzr push into mysql-6.0-bugteam branch (chad:2769 to 2770)
View as plain text  
 2770 Chad MILLER	2008-08-15 [merge]
      Merged from 5.1-bugteam.
removed:
  mysql-test/r/innodb_bug35220.result
  mysql-test/t/innodb_bug35220.test
added:
  mysql-test/r/innodb-autoinc-optimize.result
  mysql-test/r/innodb_bug35220.result
  mysql-test/t/innodb-autoinc-optimize.test
  mysql-test/t/innodb_bug35220.test
modified:
  mysql-test/extra/binlog_tests/binlog_insert_delayed.test
  mysql-test/extra/rpl_tests/rpl_row_basic.test
  mysql-test/include/show_binlog_events.inc
  mysql-test/r/csv.result
  mysql-test/r/partition.result
  mysql-test/suite/binlog/r/binlog_killed_simulate.result
  mysql-test/suite/binlog/r/binlog_row_binlog.result
  mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
  mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result
  mysql-test/suite/binlog/r/binlog_stm_binlog.result
  mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
  mysql-test/suite/rpl/r/rpl_loaddata_map.result
  mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
  mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
  mysql-test/suite/rpl/r/rpl_stm_log.result
  mysql-test/suite/rpl/r/rpl_variables.result
  mysql-test/suite/rpl/t/rpl_incident.test
  mysql-test/suite/rpl/t/rpl_loaddata_map.test
  mysql-test/suite/rpl/t/rpl_trunc_temp.test
  mysql-test/suite/rpl/t/rpl_variables.test
  mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test
  mysql-test/suite/rpl_ndb_big/r/rpl_row_basic_7ndb.result
  mysql-test/t/csv.test
  mysql-test/t/partition.test
  sql/ha_partition.cc
  sql/sql_binlog.cc
  sql/sql_parse.cc
  storage/csv/ha_tina.cc

 2769 Marc Alff	2008-08-15
      Bug#38824 (Unused memory in sp_handler_t::foffset, in stored procedures)
      
      This is a minor code cleanup, to remove dead code in stored procedures.
      
      Removed:
      - unused member sp_handler_t::foffset
      - unused parameter f in push_handler()
      - unused parameter fp in found_handler(),
      adjusted the calling code.
modified:
  sql/sp_head.cc
  sql/sp_rcontext.cc
  sql/sp_rcontext.h

=== modified file 'mysql-test/extra/binlog_tests/binlog_insert_delayed.test'
--- a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test	2007-03-29 19:38:03 +0000
+++ b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test	2008-07-23 16:56:39 +0000
@@ -1,17 +1,43 @@
-# Test of binlogging of INSERT_ID with INSERT DELAYED
+# ==== Purpose ====
+#
+# Verify that INSERT DELAYED in mixed or row mode writes events to the
+# binlog, and that AUTO_INCREMENT works correctly.
+#
+# ==== Method ====
+#
+# Insert both single and multiple rows into an autoincrement column,
+# both with specified value and with NULL.
+#
+# With INSERT DELAYED, the rows do not show up in the table
+# immediately, so we must do source include/wait_until_rows_count.inc
+# between any two INSERT DELAYED statements.  Moreover, if mixed or
+# row-based logging is used, there is also a delay between when rows
+# show up in the table and when they show up in the binlog.  To ensure
+# that the rows show up in the binlog, we call FLUSH TABLES, which
+# waits until the delayed_insert thread has finished.
+#
+# We cannot read the binlog after executing INSERT DELAYED statements
+# that insert multiple rows, because that is nondeterministic. More
+# precisely, rows may be written in batches to the binlog, where each
+# batch has one Table_map_log_event and one or more
+# Write_rows_log_event. The number of rows included in each batch is
+# nondeterministic.
+#
+# ==== Related bugs ====
+#
+# BUG#20627: INSERT DELAYED does not honour auto_increment_* variables
+# Bug in this test: BUG#38068: binlog_stm_binlog fails sporadically in pushbuild
+
+
 create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
-# First, avoid BUG#20627:
-set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
-# Verify that only one INSERT_ID event is binlogged.
-# Note, that because of WL#3368 mixed mode binlog records RBR events for the delayed
-let $table=t1;
-let $rows_inserted=11; # total number of inserted rows in this test
-insert delayed into t1 values (207);
-let $count=1;
 
-# use this macro instead of sleeps.
+let $table=t1;
+let $count=0;
 
+insert delayed into t1 values (207);
+inc $count;
 --source include/wait_until_rows_count.inc
+
 insert delayed into t1 values (null);
 inc $count;
 --source include/wait_until_rows_count.inc
@@ -20,9 +46,10 @@ insert delayed into t1 values (300);
 inc $count;
 --source include/wait_until_rows_count.inc
 
-# moving binlog check affront of multi-rows queries which work is indeterministic (extra
table_maps)
-# todo: better check is to substitute SHOW BINLOG with reading from binlog, probably
bug#19459 is in
-# the way
+# It is not enough to wait until all rows have been inserted into the
+# table. FLUSH TABLES ensures that they are in the binlog too.  See
+# comment above.
+FLUSH TABLES;
 source include/show_binlog_events.inc;
 
 insert delayed into t1 values (null),(null),(null),(null);
@@ -33,8 +60,5 @@ insert delayed into t1 values (null),(nu
 inc $count; inc $count; inc $count; inc $count;
 --source include/wait_until_rows_count.inc
 
-#check this assertion about $count calculation
---echo $count == $rows_inserted
-
 select * from t1;
 drop table t1;

=== modified file 'mysql-test/extra/rpl_tests/rpl_row_basic.test'
--- a/mysql-test/extra/rpl_tests/rpl_row_basic.test	2008-07-25 15:10:14 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test	2008-08-15 18:34:18 +0000
@@ -309,46 +309,46 @@ sync_slave_with_master;
 # 7. Replicating UTF-8 CHAR(255) to CHAR(255) UTF-8
 
 connection master;
-CREATE TABLE t1 (i INT NOT NULL,
-                 c CHAR(16) CHARACTER SET utf8 NOT NULL,
-                 j INT NOT NULL);
-
-CREATE TABLE t2 (i INT NOT NULL,
-                 c CHAR(16) CHARACTER SET utf8 NOT NULL,
-                 j INT NOT NULL);
+eval CREATE TABLE t1 (i INT NOT NULL,
+                      c CHAR(16) CHARACTER SET utf8 NOT NULL,
+                      j INT NOT NULL) ENGINE = $type ;
+
+eval CREATE TABLE t2 (i INT NOT NULL,
+                      c CHAR(16) CHARACTER SET utf8 NOT NULL,
+                      j INT NOT NULL) ENGINE = $type ;
 
 sync_slave_with_master;
 ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
 
 connection master;
-CREATE TABLE t3 (i INT NOT NULL,
-                 c CHAR(128) CHARACTER SET utf8 NOT NULL,
-                 j INT NOT NULL);
+eval CREATE TABLE t3 (i INT NOT NULL,
+                      c CHAR(128) CHARACTER SET utf8 NOT NULL,
+                      j INT NOT NULL) ENGINE = $type ;
 sync_slave_with_master;
 ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
 
 connection master;
-CREATE TABLE t4 (i INT NOT NULL,
-                 c CHAR(128) CHARACTER SET utf8 NOT NULL,
-                 j INT NOT NULL);
-
-CREATE TABLE t5 (i INT NOT NULL,
-                 c CHAR(255) CHARACTER SET utf8 NOT NULL,
-                 j INT NOT NULL);
+eval CREATE TABLE t4 (i INT NOT NULL,
+                      c CHAR(128) CHARACTER SET utf8 NOT NULL,
+                      j INT NOT NULL) ENGINE = $type ;
+
+eval CREATE TABLE t5 (i INT NOT NULL,
+                      c CHAR(255) CHARACTER SET utf8 NOT NULL,
+                      j INT NOT NULL) ENGINE = $type ;
 sync_slave_with_master;
 ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
 
 connection master;
-CREATE TABLE t6 (i INT NOT NULL,
-                 c CHAR(255) CHARACTER SET utf8 NOT NULL,
-                 j INT NOT NULL);
+eval CREATE TABLE t6 (i INT NOT NULL,
+                      c CHAR(255) CHARACTER SET utf8 NOT NULL,
+                      j INT NOT NULL) ENGINE = $type ;
 sync_slave_with_master;
 ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
 
 connection master;
-CREATE TABLE t7 (i INT NOT NULL,
-                 c CHAR(255) CHARACTER SET utf8 NOT NULL,
-                 j INT NOT NULL);
+eval CREATE TABLE t7 (i INT NOT NULL,
+                      c CHAR(255) CHARACTER SET utf8 NOT NULL,
+                      j INT NOT NULL) ENGINE = $type ;
 
 --echo [expecting slave to replicate correctly]
 connection master;
@@ -381,7 +381,11 @@ let $last_error = query_get_value("SHOW 
 disable_query_log;
 eval SELECT "$last_error" AS Last_SQL_Error;
 enable_query_log;
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+connection master;
+RESET MASTER;
+connection slave;
+STOP SLAVE;
+RESET SLAVE;
 START SLAVE;
 source include/wait_for_slave_to_start.inc;
 
@@ -406,7 +410,11 @@ let $last_error = query_get_value("SHOW 
 disable_query_log;
 eval SELECT "$last_error" AS Last_SQL_Error;
 enable_query_log;
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+connection master;
+RESET MASTER;
+connection slave;
+STOP SLAVE;
+RESET SLAVE;
 START SLAVE;
 source include/wait_for_slave_to_start.inc;
 
@@ -421,7 +429,11 @@ let $last_error = query_get_value("SHOW 
 disable_query_log;
 eval SELECT "$last_error" AS Last_SQL_Error;
 enable_query_log;
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+connection master;
+RESET MASTER;
+connection slave;
+STOP SLAVE;
+RESET SLAVE;
 START SLAVE;
 source include/wait_for_slave_to_start.inc;
 

=== modified file 'mysql-test/include/show_binlog_events.inc'
--- a/mysql-test/include/show_binlog_events.inc	2008-04-01 15:13:57 +0000
+++ b/mysql-test/include/show_binlog_events.inc	2008-08-15 18:34:18 +0000
@@ -4,7 +4,7 @@ if (!$binlog_start)
 {
   let $binlog_start=107;
 }
---replace_result $binlog_start <binlog_start>
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start>
 --replace_column 2 # 4 # 5 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
/file_id=[0-9]+/file_id=#/
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
/file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/
 --eval show binlog events from $binlog_start

=== modified file 'mysql-test/r/csv.result'
--- a/mysql-test/r/csv.result	2008-01-17 23:37:18 +0000
+++ b/mysql-test/r/csv.result	2008-08-15 06:53:54 +0000
@@ -5388,4 +5388,10 @@ select * from t1;
 c1
 That
 drop table t1;
+create table t1 (a int not null) engine=csv;
+lock tables t1 read;
+select * from t1;
+ERROR HY000: File './test/t1.CSV' not found (Errcode: 2)
+unlock tables;
+drop table t1;
 End of 5.1 tests

=== added file 'mysql-test/r/innodb-autoinc-optimize.result'
--- a/mysql-test/r/innodb-autoinc-optimize.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/innodb-autoinc-optimize.result	2008-07-31 21:47:57 +0000
@@ -0,0 +1,6 @@
+drop table if exists t1;
+create table t1(a int not null auto_increment primary key) engine=innodb;
+insert into t1 set a = -1;
+optimize table t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	status	OK

=== added file 'mysql-test/r/innodb_bug35220.result'
--- a/mysql-test/r/innodb_bug35220.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/innodb_bug35220.result	2008-08-08 00:25:24 +0000
@@ -0,0 +1 @@
+SET storage_engine=InnoDB;

=== removed file 'mysql-test/r/innodb_bug35220.result'
--- a/mysql-test/r/innodb_bug35220.result	2008-06-12 00:08:07 +0000
+++ b/mysql-test/r/innodb_bug35220.result	1970-01-01 00:00:00 +0000
@@ -1 +0,0 @@
-SET storage_engine=InnoDB;

=== modified file 'mysql-test/r/partition.result'
--- a/mysql-test/r/partition.result	2008-08-12 08:20:26 +0000
+++ b/mysql-test/r/partition.result	2008-08-15 18:34:18 +0000
@@ -1661,4 +1661,29 @@ t1	CREATE TABLE `t1` (
   PRIMARY KEY (`id`)
 ) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id)
SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE =
MyISAM, PARTITION pa2 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION pa11 VALUES LESS
THAN MAXVALUE ENGINE = MyISAM) */
 drop table t1;
+CREATE TABLE  t1 (
+`ID` bigint(20) NOT NULL AUTO_INCREMENT,
+`createdDate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`number` int,
+PRIMARY KEY (`ID`, number)
+)
+PARTITION BY RANGE (number) (
+PARTITION p0 VALUES LESS THAN (6),
+PARTITION p1 VALUES LESS THAN (11)
+);
+create table t2 (
+`ID` bigint(20),
+`createdDate` TIMESTAMP,
+`number` int
+);
+INSERT INTO t1 SET number=1;
+insert into t2 select * from t1;
+SELECT SLEEP(1);
+SLEEP(1)
+0
+UPDATE t1 SET number=6;
+select count(*) from t1, t2 where t1.createdDate = t2.createdDate;
+count(*)
+1
+drop table t1, t2;
 End of 5.1 tests

=== modified file 'mysql-test/suite/binlog/r/binlog_killed_simulate.result'
--- a/mysql-test/suite/binlog/r/binlog_killed_simulate.result	2008-01-29 13:43:41 +0000
+++ b/mysql-test/suite/binlog/r/binlog_killed_simulate.result	2008-07-29 15:36:13 +0000
@@ -18,7 +18,7 @@ load data infile '../std_data_ln/rpl_loa
 ERROR 70100: Query execution was interrupted
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Begin_load_query	#	#	;file_id=#;block_len=12
+master-bin.000001	#	Begin_load_query	#	#	;file_id=#;block_len=#
 master-bin.000001	#	Execute_load_query	#	#	use `test`; load data infile
'../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */
;file_id=#
 select
 (@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))

=== modified file 'mysql-test/suite/binlog/r/binlog_row_binlog.result'
--- a/mysql-test/suite/binlog/r/binlog_row_binlog.result	2008-04-02 13:14:23 +0000
+++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result	2008-08-15 18:34:18 +0000
@@ -1141,10 +1141,10 @@ master-bin.000001	#	Delete_rows	#	#	tabl
 master-bin.000001	#	Query	#	#	use `mysql`; COMMIT
 drop table t1,t2,t3,tt1;
 create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
-set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
 insert delayed into t1 values (207);
 insert delayed into t1 values (null);
 insert delayed into t1 values (300);
+FLUSH TABLES;
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	use `test`; create table t1 (id tinyint auto_increment
primary key)
@@ -1188,9 +1188,9 @@ 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	#	Query	#	#	use `test`; COMMIT
+master-bin.000001	#	Query	#	#	use `test`; FLUSH TABLES
 insert delayed into t1 values (null),(null),(null),(null);
 insert delayed into t1 values (null),(null),(400),(null);
-11 == 11
 select * from t1;
 a
 207

=== 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-05-09 10:27:23
+0000
+++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result	2008-08-15 18:34:18
+0000
@@ -927,7 +927,7 @@ Log_name	Pos	Event_type	Server_id	End_lo
 master-bin.000001	#	Query	#	#	use `test`; BEGIN
 master-bin.000001	#	Intvar	#	#	INSERT_ID=10
 master-bin.000001	#	User var	#	#	@`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
-master-bin.000001	#	Begin_load_query	#	#	;file_id=#;block_len=12
+master-bin.000001	#	Begin_load_query	#	#	;file_id=#;block_len=#
 master-bin.000001	#	Intvar	#	#	INSERT_ID=10
 master-bin.000001	#	User var	#	#	@`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
 master-bin.000001	#	Execute_load_query	#	#	use `test`; load data infile
'../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2)
;file_id=#

=== modified file 'mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result'
--- a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result	2007-06-27 12:28:02
+0000
+++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result	2008-07-29 15:36:13
+0000
@@ -1,8 +1,8 @@
 create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
-set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
 insert delayed into t1 values (207);
 insert delayed into t1 values (null);
 insert delayed into t1 values (300);
+FLUSH TABLES;
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	use `test`; create table t1 (a int not null auto_increment,
primary key (a)) engine=myisam
@@ -10,9 +10,9 @@ master-bin.000001	#	Query	#	#	use `test`
 master-bin.000001	#	Intvar	#	#	INSERT_ID=208
 master-bin.000001	#	Query	#	#	use `test`; insert delayed into t1 values (null)
 master-bin.000001	#	Query	#	#	use `test`; insert delayed into t1 values (300)
+master-bin.000001	#	Query	#	#	use `test`; FLUSH TABLES
 insert delayed into t1 values (null),(null),(null),(null);
 insert delayed into t1 values (null),(null),(400),(null);
-11 == 11
 select * from t1;
 a
 207

=== modified file 'mysql-test/suite/binlog/r/binlog_stm_binlog.result'
--- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result	2008-04-01 15:13:57 +0000
+++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result	2008-08-15 18:34:18 +0000
@@ -629,10 +629,10 @@ master-bin.000001	#	Query	#	#	use `mysql
 master-bin.000001	#	Query	#	#	use `mysql`; DELETE FROM user WHERE host='localhost' AND
user='@#@'
 drop table t1,t2,t3,tt1;
 create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
-set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
 insert delayed into t1 values (207);
 insert delayed into t1 values (null);
 insert delayed into t1 values (300);
+FLUSH TABLES;
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	use `test`; create table t1 (id tinyint auto_increment
primary key)
@@ -660,9 +660,9 @@ 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	#	Query	#	#	use `test`; COMMIT
+master-bin.000001	#	Query	#	#	use `test`; FLUSH TABLES
 insert delayed into t1 values (null),(null),(null),(null);
 insert delayed into t1 values (null),(null),(400),(null);
-11 == 11
 select * from t1;
 a
 207

=== modified file 'mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result'
--- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result	2008-05-09 10:27:23
+0000
+++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result	2008-08-15 18:34:18
+0000
@@ -624,7 +624,7 @@ 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	#	Intvar	#	#	INSERT_ID=10
-master-bin.000001	#	Begin_load_query	#	#	;file_id=#;block_len=12
+master-bin.000001	#	Begin_load_query	#	#	;file_id=#;block_len=#
 master-bin.000001	#	Intvar	#	#	INSERT_ID=10
 master-bin.000001	#	Execute_load_query	#	#	use `test`; load data infile
'../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2)
;file_id=#
 master-bin.000001	#	Query	#	#	use `test`; ROLLBACK
@@ -859,7 +859,7 @@ Log_name	Pos	Event_type	Server_id	End_lo
 master-bin.000001	#	Query	#	#	use `test`; BEGIN
 master-bin.000001	#	Intvar	#	#	INSERT_ID=10
 master-bin.000001	#	User var	#	#	@`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
-master-bin.000001	#	Begin_load_query	#	#	;file_id=#;block_len=12
+master-bin.000001	#	Begin_load_query	#	#	;file_id=#;block_len=#
 master-bin.000001	#	Intvar	#	#	INSERT_ID=10
 master-bin.000001	#	User var	#	#	@`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
 master-bin.000001	#	Execute_load_query	#	#	use `test`; load data infile
'../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2)
;file_id=#

=== modified file 'mysql-test/suite/rpl/r/rpl_loaddata_map.result'
--- a/mysql-test/suite/rpl/r/rpl_loaddata_map.result	2008-02-07 06:33:07 +0000
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_map.result	2008-08-15 18:34:18 +0000
@@ -4,6 +4,8 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+==== Create a big file ====
+==== Load our big file into a table ====
 create table t2 (id int not null primary key auto_increment);
 select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
 @@session.read_buffer_size - @@session.max_allowed_packet > 0
@@ -12,15 +14,18 @@ load data infile 'MYSQLTEST_VARDIR/tmp/b
 select count(*) from t2 /* 5 000 */;
 count(*)
 5000
-show binlog events in 'master-bin.000002' from <binlog_start>;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000002	#	Query	#	#	use `test`; create table t2 (id int not null primary key
auto_increment)
-master-bin.000002	#	Begin_load_query	#	#	;file_id=#;block_len=#
-master-bin.000002	#	Append_block	#	#	;file_id=#;block_len=#
-master-bin.000002	#	Append_block	#	#	;file_id=#;block_len=#
-master-bin.000002	#	Execute_load_query	#	#	use `test`; load data infile
'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2 ;file_id=#
+master-bin.000001	#	Query	#	#	use `test`; create table t2 (id int not null primary key
auto_increment)
+master-bin.000001	#	Begin_load_query	#	#	;file_id=#;block_len=#
+master-bin.000001	#	Append_block	#	#	;file_id=#;block_len=#
+master-bin.000001	#	Append_block	#	#	;file_id=#;block_len=#
+master-bin.000001	#	Execute_load_query	#	#	use `test`; load data infile
'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2 ;file_id=#
+==== Verify results on slave ====
+[on slave]
 select count(*) from t2 /* 5 000 */;
 count(*)
 5000
-drop table t1, t2;
-end of the tests
+==== Clean up ====
+[on master]
+drop table t2;

=== modified file 'mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result'
--- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result	2008-07-21 03:55:09 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result	2008-08-15 18:34:18 +0000
@@ -453,29 +453,29 @@ a	b	c
 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
 CREATE TABLE t1 (i INT NOT NULL,
 c CHAR(16) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL);
+j INT NOT NULL) ENGINE = 'MYISAM'  ;
 CREATE TABLE t2 (i INT NOT NULL,
 c CHAR(16) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL);
+j INT NOT NULL) ENGINE = 'MYISAM'  ;
 ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
 CREATE TABLE t3 (i INT NOT NULL,
 c CHAR(128) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL);
+j INT NOT NULL) ENGINE = 'MYISAM'  ;
 ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
 CREATE TABLE t4 (i INT NOT NULL,
 c CHAR(128) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL);
+j INT NOT NULL) ENGINE = 'MYISAM'  ;
 CREATE TABLE t5 (i INT NOT NULL,
 c CHAR(255) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL);
+j INT NOT NULL) ENGINE = 'MYISAM'  ;
 ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
 CREATE TABLE t6 (i INT NOT NULL,
 c CHAR(255) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL);
+j INT NOT NULL) ENGINE = 'MYISAM'  ;
 ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
 CREATE TABLE t7 (i INT NOT NULL,
 c CHAR(255) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL);
+j INT NOT NULL) ENGINE = 'MYISAM'  ;
 [expecting slave to replicate correctly]
 INSERT INTO t1 VALUES (1, "", 1);
 INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
@@ -489,7 +489,9 @@ INSERT INTO t3 VALUES (1, "", 1);
 INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
 Last_SQL_Error
 Table definition on master and slave does not match: Column 1 size mismatch - master has
size 512, test.t3 on slave has size 65. Master's column size should be <= the slave's
column size.
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
 START SLAVE;
 [expecting slave to replicate correctly]
 INSERT INTO t4 VALUES (1, "", 1);
@@ -500,14 +502,18 @@ INSERT INTO t5 VALUES (1, "", 1);
 INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
 Last_SQL_Error
 Table definition on master and slave does not match: Column 1 size mismatch - master has
size 1020, test.t5 on slave has size 65. Master's column size should be <= the slave's
column size.
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
 START SLAVE;
 [expecting slave to stop]
 INSERT INTO t6 VALUES (1, "", 1);
 INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
 Last_SQL_Error
 Table definition on master and slave does not match: Column 1 size mismatch - master has
size 1020, test.t6 on slave has size 513. Master's column size should be <= the
slave's column size.
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
 START SLAVE;
 [expecting slave to replicate correctly]
 INSERT INTO t7 VALUES (1, "", 1);

=== modified file 'mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result	2008-07-21 03:55:09 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result	2008-08-15 18:34:18 +0000
@@ -453,29 +453,29 @@ a	b	c
 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
 CREATE TABLE t1 (i INT NOT NULL,
 c CHAR(16) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL);
+j INT NOT NULL) ENGINE = 'INNODB'  ;
 CREATE TABLE t2 (i INT NOT NULL,
 c CHAR(16) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL);
+j INT NOT NULL) ENGINE = 'INNODB'  ;
 ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
 CREATE TABLE t3 (i INT NOT NULL,
 c CHAR(128) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL);
+j INT NOT NULL) ENGINE = 'INNODB'  ;
 ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
 CREATE TABLE t4 (i INT NOT NULL,
 c CHAR(128) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL);
+j INT NOT NULL) ENGINE = 'INNODB'  ;
 CREATE TABLE t5 (i INT NOT NULL,
 c CHAR(255) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL);
+j INT NOT NULL) ENGINE = 'INNODB'  ;
 ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
 CREATE TABLE t6 (i INT NOT NULL,
 c CHAR(255) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL);
+j INT NOT NULL) ENGINE = 'INNODB'  ;
 ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
 CREATE TABLE t7 (i INT NOT NULL,
 c CHAR(255) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL);
+j INT NOT NULL) ENGINE = 'INNODB'  ;
 [expecting slave to replicate correctly]
 INSERT INTO t1 VALUES (1, "", 1);
 INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
@@ -489,7 +489,9 @@ INSERT INTO t3 VALUES (1, "", 1);
 INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
 Last_SQL_Error
 Table definition on master and slave does not match: Column 1 size mismatch - master has
size 512, test.t3 on slave has size 65. Master's column size should be <= the slave's
column size.
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
 START SLAVE;
 [expecting slave to replicate correctly]
 INSERT INTO t4 VALUES (1, "", 1);
@@ -500,14 +502,18 @@ INSERT INTO t5 VALUES (1, "", 1);
 INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
 Last_SQL_Error
 Table definition on master and slave does not match: Column 1 size mismatch - master has
size 1020, test.t5 on slave has size 65. Master's column size should be <= the slave's
column size.
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
 START SLAVE;
 [expecting slave to stop]
 INSERT INTO t6 VALUES (1, "", 1);
 INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
 Last_SQL_Error
 Table definition on master and slave does not match: Column 1 size mismatch - master has
size 1020, test.t6 on slave has size 513. Master's column size should be <= the
slave's column size.
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
 START SLAVE;
 [expecting slave to replicate correctly]
 INSERT INTO t7 VALUES (1, "", 1);

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_log.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_log.result	2008-02-12 10:27:52 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_log.result	2008-08-15 18:34:18 +0000
@@ -196,7 +196,7 @@ master-bin.000001	#	Intvar	#	#	INSERT_ID
 master-bin.000001	#	Query	#	#	use `test`; insert into t1 values (NULL)
 master-bin.000001	#	Query	#	#	use `test`; drop table t1
 master-bin.000001	#	Query	#	#	use `test`; create table t1 (word char(20) not
null)ENGINE=MyISAM
-master-bin.000001	#	Begin_load_query	#	#	;file_id=#;block_len=581
+master-bin.000001	#	Begin_load_query	#	#	;file_id=#;block_len=#
 master-bin.000001	#	Execute_load_query	#	#	use `test`; load data infile
'../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=#
 master-bin.000001	#	Rotate	#	#	master-bin.000002;pos=4
 show binlog events in 'master-bin.000002';

=== modified file 'mysql-test/suite/rpl/r/rpl_variables.result'
--- a/mysql-test/suite/rpl/r/rpl_variables.result	2008-03-07 12:59:36 +0000
+++ b/mysql-test/suite/rpl/r/rpl_variables.result	2008-07-17 16:26:59 +0000
@@ -45,7 +45,7 @@ RESET SLAVE;
 RESET MASTER;
 START SLAVE;
 [on slave]
-SET @@global.init_slave = 'ant';
+SET @@global.init_slave = 'SELECT 1';
 [on master]
 CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY,
 truth BOOLEAN,
@@ -66,9 +66,9 @@ SET @@global.sync_binlog = 2000000;
 INSERT INTO tstmt(num) VALUES (@@global.sync_binlog);
 SET @@global.sync_binlog = 3000000;
 INSERT INTO tstmt(num) VALUES (@@global.sync_binlog);
-SET @@global.init_slave = 'bison';
+SET @@global.init_slave = 'SELECT 2';
 INSERT INTO tstmt(text) VALUES (@@global.init_slave);
-SET @@global.init_slave = 'cat';
+SET @@global.init_slave = 'SELECT 3';
 INSERT INTO tstmt(text) VALUES (@@global.init_slave);
 SET @@global.slave_exec_mode = 'IDEMPOTENT';
 INSERT INTO tstmt(text) VALUES (@@global.slave_exec_mode);
@@ -140,9 +140,9 @@ INSERT INTO tproc(num) VALUES (@@global.
 SET @@global.sync_binlog = 3000000;
 INSERT INTO tproc(num) VALUES (@@global.sync_binlog);
 # string
-SET @@global.init_slave = 'bison';
+SET @@global.init_slave = 'SELECT 2';
 INSERT INTO tproc(text) VALUES (@@global.init_slave);
-SET @@global.init_slave = 'cat';
+SET @@global.init_slave = 'SELECT 3';
 INSERT INTO tproc(text) VALUES (@@global.init_slave);
 # enumeration
 SET @@global.slave_exec_mode = 'IDEMPOTENT';
@@ -226,9 +226,9 @@ INSERT INTO tfunc(num) VALUES (@@global.
 SET @@global.sync_binlog = 3000000;
 INSERT INTO tfunc(num) VALUES (@@global.sync_binlog);
 # string
-SET @@global.init_slave = 'bison';
+SET @@global.init_slave = 'SELECT 2';
 INSERT INTO tfunc(text) VALUES (@@global.init_slave);
-SET @@global.init_slave = 'cat';
+SET @@global.init_slave = 'SELECT 3';
 INSERT INTO tfunc(text) VALUES (@@global.init_slave);
 # enumeration
 SET @@global.slave_exec_mode = 'IDEMPOTENT';
@@ -316,9 +316,9 @@ INSERT INTO ttrig(num) VALUES (@@global.
 SET @@global.sync_binlog = 3000000;
 INSERT INTO ttrig(num) VALUES (@@global.sync_binlog);
 # string
-SET @@global.init_slave = 'bison';
+SET @@global.init_slave = 'SELECT 2';
 INSERT INTO ttrig(text) VALUES (@@global.init_slave);
-SET @@global.init_slave = 'cat';
+SET @@global.init_slave = 'SELECT 3';
 INSERT INTO ttrig(text) VALUES (@@global.init_slave);
 # enumeration
 SET @@global.slave_exec_mode = 'IDEMPOTENT';
@@ -395,9 +395,9 @@ PREPARE p5 FROM 'SET @@global.sync_binlo
 PREPARE p6 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)';
 PREPARE p7 FROM 'SET @@global.sync_binlog = 3000000';
 PREPARE p8 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)';
-PREPARE p9 FROM 'SET @@global.init_slave = \'bison\'';
+PREPARE p9 FROM 'SET @@global.init_slave = \'SELECT 2\'';
 PREPARE p10 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
-PREPARE p11 FROM 'SET @@global.init_slave = \'cat\'';
+PREPARE p11 FROM 'SET @@global.init_slave = \'SELECT 3\'';
 PREPARE p12 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
 PREPARE p13 FROM 'SET @@global.slave_exec_mode = \'IDEMPOTENT\'';
 PREPARE p14 FROM 'INSERT INTO tprep(text) VALUES (@@global.slave_exec_mode)';
@@ -522,8 +522,8 @@ id	truth	num	text
 2	0	NULL	NULL
 3	NULL	2000000	NULL
 4	NULL	3000000	NULL
-5	NULL	NULL	bison
-6	NULL	NULL	cat
+5	NULL	NULL	SELECT 2
+6	NULL	NULL	SELECT 3
 7	NULL	NULL	IDEMPOTENT
 8	NULL	NULL	STRICT
 9	1	NULL	NULL

=== modified file 'mysql-test/suite/rpl/t/rpl_incident.test'
--- a/mysql-test/suite/rpl/t/rpl_incident.test	2007-06-27 12:28:02 +0000
+++ b/mysql-test/suite/rpl/t/rpl_incident.test	2008-07-18 13:07:14 +0000
@@ -19,6 +19,37 @@ connection slave;
 # The 4 should not be inserted into the table, since the incident log
 # event should have stop the slave.
 --echo **** On Slave ****
+#### BEGIN DEBUG INFO ADDED BY SVEN 2008-07-18 -- SEE BUG#38077 ####
+let $tables= query_get_value(SHOW TABLES, Tables_in_test, 1);
+if (`SELECT '$tables' != 't1'`)
+{
+  --echo **** TEST CASE BUG! PRINTING DEBUG INFO! ****
+  --echo **** Dear developer, if you see this in the output of a test
+  --echo **** case run, please add all the information below as a
+  --echo **** comment to BUG#38077. If it's a pushbuild failure, please
+  --echo **** include a link to the push page.
+  --echo **** Thank you! /Sven
+  SHOW BINLOG EVENTS;
+  --echo **** master binlog ****
+  --error 0,1
+  --exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/master-bin.000001
+  --echo **** slave binlog ****
+  --error 0,1
+  --exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/slave-bin.000001
+  --echo **** slave status ****
+  query_vertical SHOW SLAVE STATUS;
+  --echo **** slave's master status ****
+  SHOW MASTER STATUS;
+  --echo **** slave binlog events ****
+  --echo [on master]
+  connection master;
+  --echo **** master status ****
+  SHOW MASTER STATUS;
+  --echo **** master binlog events ****
+  SHOW BINLOG EVENTS;
+  exit;
+}
+#### END DEBUG INFO ####
 SELECT * FROM t1;
 
 --replace_result $MASTER_MYPORT MASTER_PORT

=== modified file 'mysql-test/suite/rpl/t/rpl_loaddata_map.test'
--- a/mysql-test/suite/rpl/t/rpl_loaddata_map.test	2008-02-05 14:30:44 +0000
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_map.test	2008-08-15 18:34:18 +0000
@@ -1,7 +1,16 @@
+# ==== Purpose ====
 #
 #  check replication of load data with the server parameters subjected to
 #  read_buffer_size > max_allowed_packet
 #
+# ==== Implementation ====
+#
+# Insert many rows into t1, write t1 to file.
+# Load the file into t2.
+# See that t2 came out as expected on slave.
+#
+# ==== Related Bugs ====
+#
 #  BUG#30435 loading large LOAD DATA INFILE breaks slave with 
 #            read_buffer_size set on master
 #  BUG#33413 show binlog events fails if binlog has event size of close
@@ -9,10 +18,17 @@
 
 source include/have_binlog_format_mixed_or_statement.inc;
 source include/master-slave.inc;
-source include/have_innodb.inc;
-source include/have_binlog_format_mixed_or_statement.inc;
+
+
+--echo ==== Create a big file ====
+
+# We turn off binlogging to avoid too much noise in the binlog. t1 is
+# just an auxiliary construction anyways, it is not needed on the
+# slave.
 
 --disable_query_log
+SET @@sql_log_bin= 0;
+
 let $rows= 5000;
 create table t1 (id int not null primary key auto_increment);
 
@@ -22,10 +38,13 @@ while($rows)
   dec $rows;
 }
 eval select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1;
-flush logs;
+
+DROP TABLE t1;
+SET @@sql_log_bin= 1;
 --enable_query_log
 
-connection master;
+
+--echo ==== Load our big file into a table ====
 create table t2 (id int not null primary key auto_increment);
 
 select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ;
@@ -34,21 +53,21 @@ select @@session.read_buffer_size - @@se
 eval load data infile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2;
 select count(*) from t2 /* 5 000 */;
 
-# the binglog will show fragmented Append_block events
---let $binlog_start=107
---replace_column 2 # 4 # 5 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /file_id=[0-9]+/file_id=#/
/block_len=[0-9]+/block_len=#/
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start>
---eval show binlog events in 'master-bin.000002' from $binlog_start
+# the binlog will show fragmented Append_block events
+source include/show_binlog_events.inc;
+
 
+--echo ==== Verify results on slave ====
 
+--echo [on slave]
 sync_slave_with_master;
-#connection slave;
 select count(*) from t2 /* 5 000 */;
 
+
+--echo ==== Clean up ====
+
+--echo [on master]
 connection master;
-drop table t1, t2;
+drop table t2;
 sync_slave_with_master;
 remove_file $MYSQLTEST_VARDIR/tmp/bug30435_5k.txt;
-
---echo end of the tests

=== modified file 'mysql-test/suite/rpl/t/rpl_trunc_temp.test'
--- a/mysql-test/suite/rpl/t/rpl_trunc_temp.test	2008-02-28 11:36:14 +0000
+++ b/mysql-test/suite/rpl/t/rpl_trunc_temp.test	2008-07-23 10:13:55 +0000
@@ -1,13 +1,30 @@
-# Requires statement logging
+# ==== Purpose ====
+#
+# Verify that Slave_open_temp_tables is increased when a temporary
+# table is opened on the slave, and decreased when a temporary table
+# is closed on the slave, and that it is preserved during 'DELETE FROM
+# table' and 'TRUNCATE table'.
+#
+# ==== Method ====
+#
+# Create a temporary table on master, insert rows, and try:
+#  - delete rows from the table
+#  - truncate the table
+#  - drop the table
+#
+# ==== Related bugs ====
+#
+# BUG#17137 Running "truncate table" on temporary table leaves the table open on a slave
+#
+# Bug in this test: BUG#37493: rpl_trunc_temp.test nondeterministic
+
+
+# Requires statement-based logging since temporary tables are not
+# logged in row-based logging
 -- source include/have_binlog_format_mixed_or_statement.inc
 
 source include/master-slave.inc;
 
-#
-# Bug#17137 Running "truncate table" on temporary table
-# leaves the table open on a slave
-#
-
 create temporary table t1 (n int);
 insert into t1 values(1);
 sync_slave_with_master;
@@ -28,13 +45,10 @@ show status like 'Slave_open_temp_tables
 # Disconnect the master, temp table on slave should dissapear
 disconnect master;
 
-connection master1;
-# Wait until drop of temp tables appers in binlog
+connection slave;
+
+# Wait until drop of temp tables appers in slave's binlog
 let $wait_binlog_event= DROP;
 source include/wait_for_binlog_event.inc;
 
-connection slave;
 show status like 'Slave_open_temp_tables';
-
-
-# End of 4.1 tests

=== modified file 'mysql-test/suite/rpl/t/rpl_variables.test'
--- a/mysql-test/suite/rpl/t/rpl_variables.test	2008-03-07 12:59:36 +0000
+++ b/mysql-test/suite/rpl/t/rpl_variables.test	2008-07-17 16:26:59 +0000
@@ -117,7 +117,7 @@ source include/reset_master_and_slave.in
 # above, but can't because it affects how the slave works.
 --echo [on slave]
 connection slave;
-SET @@global.init_slave = 'ant';
+SET @@global.init_slave = 'SELECT 1';
 
 
 --echo [on master]
@@ -154,9 +154,9 @@ SET @@global.sync_binlog = 3000000;
 INSERT INTO tstmt(num) VALUES (@@global.sync_binlog);
 
 # string
-SET @@global.init_slave = 'bison';
+SET @@global.init_slave = 'SELECT 2';
 INSERT INTO tstmt(text) VALUES (@@global.init_slave);
-SET @@global.init_slave = 'cat';
+SET @@global.init_slave = 'SELECT 3';
 INSERT INTO tstmt(text) VALUES (@@global.init_slave);
 
 # enumeration
@@ -258,9 +258,9 @@ BEGIN
   INSERT INTO tproc(num) VALUES (@@global.sync_binlog);
 
   # string
-  SET @@global.init_slave = 'bison';
+  SET @@global.init_slave = 'SELECT 2';
   INSERT INTO tproc(text) VALUES (@@global.init_slave);
-  SET @@global.init_slave = 'cat';
+  SET @@global.init_slave = 'SELECT 3';
   INSERT INTO tproc(text) VALUES (@@global.init_slave);
 
   # enumeration
@@ -367,9 +367,9 @@ BEGIN
   INSERT INTO tfunc(num) VALUES (@@global.sync_binlog);
 
   # string
-  SET @@global.init_slave = 'bison';
+  SET @@global.init_slave = 'SELECT 2';
   INSERT INTO tfunc(text) VALUES (@@global.init_slave);
-  SET @@global.init_slave = 'cat';
+  SET @@global.init_slave = 'SELECT 3';
   INSERT INTO tfunc(text) VALUES (@@global.init_slave);
 
   # enumeration
@@ -478,9 +478,9 @@ BEGIN
   INSERT INTO ttrig(num) VALUES (@@global.sync_binlog);
 
   # string
-  SET @@global.init_slave = 'bison';
+  SET @@global.init_slave = 'SELECT 2';
   INSERT INTO ttrig(text) VALUES (@@global.init_slave);
-  SET @@global.init_slave = 'cat';
+  SET @@global.init_slave = 'SELECT 3';
   INSERT INTO ttrig(text) VALUES (@@global.init_slave);
 
   # enumeration
@@ -581,9 +581,9 @@ PREPARE p7 FROM 'SET @@global.sync_binlo
 PREPARE p8 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)';
 
 # string
-PREPARE p9 FROM 'SET @@global.init_slave = \'bison\'';
+PREPARE p9 FROM 'SET @@global.init_slave = \'SELECT 2\'';
 PREPARE p10 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
-PREPARE p11 FROM 'SET @@global.init_slave = \'cat\'';
+PREPARE p11 FROM 'SET @@global.init_slave = \'SELECT 3\'';
 PREPARE p12 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)';
 
 # enumeration

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test	2008-06-26 05:18:28 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test	2008-08-15 18:34:18 +0000
@@ -1,6 +1,6 @@
 # Same test as rpl_truncate_7ndb.test, but with mixed mode
 # This is marked with 'big_test' just because the rpl_truncate_7ndb test is
 # so slow...
-
+--source include/have_binlog_format_mixed.inc
 --source include/big_test.inc
 --source suite/rpl_ndb/t/rpl_truncate_7ndb.test

=== modified file 'mysql-test/suite/rpl_ndb_big/r/rpl_row_basic_7ndb.result'
--- a/mysql-test/suite/rpl_ndb_big/r/rpl_row_basic_7ndb.result	2008-06-27 12:39:40 +0000
+++ b/mysql-test/suite/rpl_ndb_big/r/rpl_row_basic_7ndb.result	2008-08-15 18:34:18 +0000
@@ -437,7 +437,7 @@ SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
 COUNT(*)	0
 set @@global.slave_exec_mode= default;
 Last_SQL_Error
-0
+
 SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
 COUNT(*)	0
 **** Test for BUG#37076 ****
@@ -451,3 +451,72 @@ SELECT * FROM t1;
 a	b	c
 2005-11-14 01:01:01	2005-11-14 01:01:02	2005-11-14
 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
+CREATE TABLE t1 (i INT NOT NULL,
+c CHAR(16) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL) ENGINE = 'NDB'  ;
+CREATE TABLE t2 (i INT NOT NULL,
+c CHAR(16) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL) ENGINE = 'NDB'  ;
+ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t3 (i INT NOT NULL,
+c CHAR(128) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL) ENGINE = 'NDB'  ;
+ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t4 (i INT NOT NULL,
+c CHAR(128) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL) ENGINE = 'NDB'  ;
+CREATE TABLE t5 (i INT NOT NULL,
+c CHAR(255) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL) ENGINE = 'NDB'  ;
+ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t6 (i INT NOT NULL,
+c CHAR(255) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL) ENGINE = 'NDB'  ;
+ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t7 (i INT NOT NULL,
+c CHAR(255) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL) ENGINE = 'NDB'  ;
+[expecting slave to replicate correctly]
+INSERT INTO t1 VALUES (1, "", 1);
+INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
+Comparing tables master:test.t1 and slave:test.t1
+[expecting slave to replicate correctly]
+INSERT INTO t2 VALUES (1, "", 1);
+INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
+Comparing tables master:test.t2 and slave:test.t2
+[expecting slave to stop]
+INSERT INTO t3 VALUES (1, "", 1);
+INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
+Last_SQL_Error
+Table definition on master and slave does not match: Column 1 size mismatch - master has
size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's
column size.
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
+START SLAVE;
+[expecting slave to replicate correctly]
+INSERT INTO t4 VALUES (1, "", 1);
+INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
+Comparing tables master:test.t4 and slave:test.t4
+[expecting slave to stop]
+INSERT INTO t5 VALUES (1, "", 1);
+INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
+Last_SQL_Error
+Table definition on master and slave does not match: Column 1 size mismatch - master has
size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's
column size.
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
+START SLAVE;
+[expecting slave to stop]
+INSERT INTO t6 VALUES (1, "", 1);
+INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
+Last_SQL_Error
+Table definition on master and slave does not match: Column 1 size mismatch - master has
size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's
column size.
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
+START SLAVE;
+[expecting slave to replicate correctly]
+INSERT INTO t7 VALUES (1, "", 1);
+INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
+Comparing tables master:test.t7 and slave:test.t7
+drop table t1, t2, t3, t4, t5, t6, t7;

=== modified file 'mysql-test/t/csv.test'
--- a/mysql-test/t/csv.test	2008-01-17 23:37:18 +0000
+++ b/mysql-test/t/csv.test	2008-08-15 06:53:54 +0000
@@ -1386,6 +1386,9 @@ UNLOCK TABLES;
 
 # cleanup
 DROP TABLE test_concurrent_insert;
+connection default;                                                                     
+--disconnect con1                                                                       
+--disconnect con2
 
 #
 # Test REPAIR/CHECK TABLE (5.1)
@@ -1784,4 +1787,20 @@ update t1 set c1="That" where c1="This";
 select * from t1;
 drop table t1;
 
+#
+# Bug#36638 mysqld crashes when open file limit is passed and general query log enabled
+#
+create table t1 (a int not null) engine=csv;
+lock tables t1 read;
+connect (con1,localhost,root,,);
+--connection con1
+--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV
+# EE_FILENOTFOUND 29
+--error 29
+select * from t1;
+connection default;
+unlock tables;
+drop table t1;
+--disconnect con1
+
 --echo End of 5.1 tests

=== added file 'mysql-test/t/innodb-autoinc-optimize.test'
--- a/mysql-test/t/innodb-autoinc-optimize.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/innodb-autoinc-optimize.test	2008-07-31 21:47:57 +0000
@@ -0,0 +1,16 @@
+-- source include/have_innodb.inc
+# embedded server ignores 'delayed', so skip this
+-- source include/not_embedded.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# Bug 34286
+#
+create table t1(a int not null auto_increment primary key) engine=innodb;
+insert into t1 set a = -1;
+# NOTE: The database needs to be shutdown and restarted (here) for
+# the test to work. It's included for reference only.
+optimize table t1;

=== added file 'mysql-test/t/innodb_bug35220.test'
--- a/mysql-test/t/innodb_bug35220.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/innodb_bug35220.test	2008-08-08 00:25:24 +0000
@@ -0,0 +1,16 @@
+#
+# Bug#35220 ALTER TABLE too picky on reserved word "foreign"
+# http://bugs.mysql.com/35220
+#
+
+-- source include/have_innodb.inc
+
+SET storage_engine=InnoDB;
+
+# we care only that the following SQL commands do not produce errors
+-- disable_query_log
+-- disable_result_log
+
+CREATE TABLE bug35220 (foreign_col INT, dummy_cant_delete_all_columns INT);
+ALTER TABLE bug35220 DROP foreign_col;
+DROP TABLE bug35220;

=== removed file 'mysql-test/t/innodb_bug35220.test'
--- a/mysql-test/t/innodb_bug35220.test	2008-06-12 00:08:07 +0000
+++ b/mysql-test/t/innodb_bug35220.test	1970-01-01 00:00:00 +0000
@@ -1,16 +0,0 @@
-#
-# Bug#35220 ALTER TABLE too picky on reserved word "foreign"
-# http://bugs.mysql.com/35220
-#
-
--- source include/have_innodb.inc
-
-SET storage_engine=InnoDB;
-
-# we care only that the following SQL commands do not produce errors
--- disable_query_log
--- disable_result_log
-
-CREATE TABLE bug35220 (foreign_col INT, dummy_cant_delete_all_columns INT);
-ALTER TABLE bug35220 DROP foreign_col;
-DROP TABLE bug35220;

=== modified file 'mysql-test/t/partition.test'
--- a/mysql-test/t/partition.test	2008-08-12 08:20:26 +0000
+++ b/mysql-test/t/partition.test	2008-08-15 18:34:18 +0000
@@ -1807,4 +1807,34 @@ while ($n)
 --enable_query_log
 show create table t1;
 drop table t1;
+
+#
+# Bug #38272 timestamps fields incorrectly defaulted on update accross partitions.
+#
+
+CREATE TABLE  t1 (
+  `ID` bigint(20) NOT NULL AUTO_INCREMENT,
+  `createdDate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  `number` int,
+  PRIMARY KEY (`ID`, number)
+)
+PARTITION BY RANGE (number) (
+    PARTITION p0 VALUES LESS THAN (6),
+    PARTITION p1 VALUES LESS THAN (11)
+);
+
+create table t2 (
+  `ID` bigint(20),
+  `createdDate` TIMESTAMP,
+  `number` int
+);
+
+INSERT INTO t1 SET number=1;
+insert into t2 select * from t1;
+SELECT SLEEP(1);
+UPDATE t1 SET number=6;
+select count(*) from t1, t2 where t1.createdDate = t2.createdDate;
+
+drop table t1, t2;
+
 --echo End of 5.1 tests

=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc	2008-08-13 18:09:46 +0000
+++ b/sql/ha_partition.cc	2008-08-15 18:34:18 +0000
@@ -2868,6 +2868,7 @@ int ha_partition::write_row(uchar * buf)
   my_bitmap_map *old_map;
   HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
   THD *thd= ha_thd();
+  timestamp_auto_set_type orig_timestamp_type= table->timestamp_field_type;
 #ifdef NOT_NEEDED
   uchar *rec0= m_rec0;
 #endif
@@ -2877,6 +2878,7 @@ int ha_partition::write_row(uchar * buf)
   /* If we have a timestamp column, update it to the current time */
   if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
     table->timestamp_field->set_time();
+  table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
 
   /*
     If we have an auto_increment column and we are writing a changed row
@@ -2932,6 +2934,7 @@ int ha_partition::write_row(uchar * buf)
     set_auto_increment_if_higher();
   reenable_binlog(thd);
 exit:
+  table->timestamp_field_type= orig_timestamp_type;
   DBUG_RETURN(error);
 }
 
@@ -2982,10 +2985,8 @@ int ha_partition::update_row(const uchar
     inside m_file[*]->update_row() methods
   */
   if (orig_timestamp_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
-  {
     table->timestamp_field->set_time();
-    table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
-  }
+  table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
 
   if ((error= get_parts_for_update(old_data, new_data, table->record[0],
                                    m_part_info, &old_part_id, &new_part_id,

=== modified file 'sql/sql_binlog.cc'
--- a/sql/sql_binlog.cc	2008-05-23 13:54:03 +0000
+++ b/sql/sql_binlog.cc	2008-08-15 18:34:18 +0000
@@ -208,6 +208,7 @@ void mysql_client_binlog_statement(THD* 
 #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
       if (apply_event_and_update_pos(ev, thd, thd->rli_fake, FALSE))
       {
+        delete ev;
         /*
           TODO: Maybe a better error message since the BINLOG statement
           now contains several events.

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2008-08-08 13:34:35 +0000
+++ b/sql/sql_parse.cc	2008-08-15 18:34:18 +0000
@@ -413,6 +413,12 @@ void execute_init_command(THD *thd, sys_
   Vio* save_vio;
   ulong save_client_capabilities;
 
+#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+  thd->profiling.start_new_query();
+  thd->profiling.set_query_source(init_command_var->value,
+                                  init_command_var->value_length);
+#endif
+
   thd_proc_info(thd, "Execution of init_command");
   /*
     We need to lock init_command_var because
@@ -434,6 +440,10 @@ void execute_init_command(THD *thd, sys_
   rw_unlock(var_mutex);
   thd->client_capabilities= save_client_capabilities;
   thd->net.vio= save_vio;
+
+#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+  thd->profiling.finish_current_query();
+#endif
 }
 
 
@@ -541,6 +551,10 @@ pthread_handler_t handle_bootstrap(void 
     bootstrap_error= thd->is_error();
     net_end_statement(thd);
 
+#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+    thd->profiling.finish_current_query();
+#endif
+
     if (bootstrap_error)
       break;
 

=== modified file 'storage/csv/ha_tina.cc'
--- a/storage/csv/ha_tina.cc	2008-06-28 11:00:59 +0000
+++ b/storage/csv/ha_tina.cc	2008-08-15 18:34:18 +0000
@@ -190,17 +190,12 @@ static TINA_SHARE *get_share(const char 
       Usually this will result in auto-repair, and we will get a good
       meta-file in the end.
     */
-    if ((share->meta_file= my_open(meta_file_name,
-                                   O_RDWR|O_CREAT, MYF(0))) == -1)
-      share->crashed= TRUE;
-
-    /*
-      If the meta file will not open we assume it is crashed and
-      mark it as such.
-    */
-    if (read_meta_file(share->meta_file, &share->rows_recorded))
+    if (((share->meta_file= my_open(meta_file_name,
+                                    O_RDWR|O_CREAT, MYF(MY_WME))) == -1) ||
+        read_meta_file(share->meta_file, &share->rows_recorded))
       share->crashed= TRUE;
   }
+
   share->use_count++;
   pthread_mutex_unlock(&tina_mutex);
 
@@ -342,11 +337,11 @@ int ha_tina::init_tina_writer()
   (void)write_meta_file(share->meta_file, share->rows_recorded, TRUE);
 
   if ((share->tina_write_filedes=
-        my_open(share->data_file_name, O_RDWR|O_APPEND, MYF(0))) == -1)
+        my_open(share->data_file_name, O_RDWR|O_APPEND, MYF(MY_WME))) == -1)
   {
     DBUG_PRINT("info", ("Could not open tina file writes"));
     share->crashed= TRUE;
-    DBUG_RETURN(1);
+    DBUG_RETURN(my_errno ? my_errno : -1);
   }
   share->tina_write_opened= TRUE;
 
@@ -829,8 +824,12 @@ int ha_tina::open(const char *name, int 
   }
 
   local_data_file_version= share->data_file_version;
-  if ((data_file= my_open(share->data_file_name, O_RDONLY, MYF(0))) == -1)
-    DBUG_RETURN(0);
+  if ((data_file= my_open(share->data_file_name,
+                          O_RDONLY, MYF(MY_WME))) == -1)
+  {
+    free_share(share);
+    DBUG_RETURN(my_errno ? my_errno : -1);
+  }
 
   /*
     Init locking. Pass handler object to the locking routines,
@@ -1022,8 +1021,8 @@ int ha_tina::init_data_file()
   {
     local_data_file_version= share->data_file_version;
     if (my_close(data_file, MYF(0)) ||
-        (data_file= my_open(share->data_file_name, O_RDONLY, MYF(0))) == -1)
-      return 1;
+        (data_file= my_open(share->data_file_name, O_RDONLY, MYF(MY_WME))) == -1)
+      return my_errno ? my_errno : -1;
   }
   file_buff->init_buff(data_file);
   return 0;
@@ -1290,8 +1289,9 @@ int ha_tina::rnd_end()
       DBUG_RETURN(-1);
 
     /* Open the file again */
-    if (((data_file= my_open(share->data_file_name, O_RDONLY, MYF(0))) == -1))
-      DBUG_RETURN(-1);
+    if (((data_file= my_open(share->data_file_name,
+                             O_RDONLY, MYF(MY_WME))) == -1))
+      DBUG_RETURN(my_errno ? my_errno : -1);
     /*
       As we reopened the data file, increase share->data_file_version 
       in order to force other threads waiting on a table lock and  
@@ -1443,8 +1443,8 @@ int ha_tina::repair(THD* thd, HA_CHECK_O
 
   /* Open the file again, it should now be repaired */
   if ((data_file= my_open(share->data_file_name, O_RDWR|O_APPEND,
-                          MYF(0))) == -1)
-     DBUG_RETURN(-1);
+                          MYF(MY_WME))) == -1)
+     DBUG_RETURN(my_errno ? my_errno : -1);
 
   /* Set new file size. The file size will be updated by ::update_status() */
   local_saved_data_file_length= (size_t) current_position;

Thread
bzr push into mysql-6.0-bugteam branch (chad:2769 to 2770) Chad MILLER15 Aug