Commit dd8c47ef authored by unknown's avatar unknown
Browse files

Merge mysql.com:/opt/local/work/mysql-5.0-root

into  mysql.com:/opt/local/work/mysql-5.0-runtime-merge


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
parents 90ffe539 bb1c6bf6
Loading
Loading
Loading
Loading
+38 −25
Original line number Diff line number Diff line
@@ -3699,6 +3699,37 @@ os_aio_posix_handle(
}
#endif

/**************************************************************************
Do a 'last millisecond' check that the page end is sensible;
reported page checksum errors from Linux seem to wipe over the page end. */
static
void
os_file_check_page_trailers(
/*========================*/
	byte*	combined_buf,	/* in: combined write buffer */
	ulint	total_len)	/* in: size of combined_buf, in bytes
				(a multiple of UNIV_PAGE_SIZE) */
{
	ulint	len;

	for (len = 0; len + UNIV_PAGE_SIZE <= total_len;
			len += UNIV_PAGE_SIZE) {
		byte*	buf = combined_buf + len;

		if (memcmp(buf + (FIL_PAGE_LSN + 4), buf + (UNIV_PAGE_SIZE
				- FIL_PAGE_END_LSN_OLD_CHKSUM + 4), 4)) {
		    	ut_print_timestamp(stderr);
		    	fprintf(stderr,
"  InnoDB: ERROR: The page to be written seems corrupt!\n"
"InnoDB: Writing a block of %lu bytes, currently at offset %lu\n",
			(ulong)total_len, (ulong)len);
			buf_page_print(buf);
		    	fprintf(stderr,
"InnoDB: ERROR: The page to be written seems corrupt!\n");
		}
	}
}

/**************************************************************************
Does simulated aio. This function should be called by an i/o-handler
thread. */
@@ -3736,7 +3767,6 @@ os_aio_simulated_handle(
	ibool		ret;
	ulint		n;
	ulint		i;
	ulint		len2;
	
	segment = os_aio_get_array_and_local_segment(&array, global_segment);
	
@@ -3944,32 +3974,15 @@ os_aio_simulated_handle(
				ut_error;
			}

			/* Do a 'last millisecond' check that the page end
			is sensible; reported page checksum errors from
			Linux seem to wipe over the page end */

			for (len2 = 0; len2 + UNIV_PAGE_SIZE <= total_len;
						len2 += UNIV_PAGE_SIZE) {
				if (mach_read_from_4(combined_buf + len2
						+ FIL_PAGE_LSN + 4)
				    != mach_read_from_4(combined_buf + len2
				    		+ UNIV_PAGE_SIZE
				    	- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
				    	ut_print_timestamp(stderr);
				    	fprintf(stderr,
"  InnoDB: ERROR: The page to be written seems corrupt!\n");
				    	fprintf(stderr,
"InnoDB: Writing a block of %lu bytes, currently writing at offset %lu\n",
					(ulong)total_len, (ulong)len2);
					buf_page_print(combined_buf + len2);
				    	fprintf(stderr,
"InnoDB: ERROR: The page to be written seems corrupt!\n");
				}
			}
			os_file_check_page_trailers(combined_buf, total_len);
		}

		ret = os_file_write(slot->name, slot->file, combined_buf,
				slot->offset, slot->offset_high, total_len);

		if (array == os_aio_write_array) {
			os_file_check_page_trailers(combined_buf, total_len);
		}
	} else {
		ret = os_file_read(slot->file, combined_buf,
				slot->offset, slot->offset_high, total_len);
+6 −1
Original line number Diff line number Diff line
@@ -189,4 +189,9 @@ HEX(f)
select HEX(f) from t4;
HEX(f)
835C
drop table t1, t2, t03, t04, t3, t4;
flush logs;
select * from t5  /* must be (1),(1) */;
a
1
1
drop table t1, t2, t03, t04, t3, t4, t5;
+136 −12
Original line number Diff line number Diff line
@@ -29,9 +29,40 @@ n
2
3
4
show slave status;
Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	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	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master
#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	776	slave-relay-bin.000004	#	master-bin.000001	#	No							0		0	319	#	Master	master-bin.000001	319	No						#
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	776
Relay_Log_File	slave-relay-bin.000004
Relay_Log_Pos	#
Relay_Master_Log_File	master-bin.000001
Slave_IO_Running	#
Slave_SQL_Running	No
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	319
Relay_Log_Space	#
Until_Condition	Master
Until_Log_File	master-bin.000001
Until_Log_Pos	319
Master_SSL_Allowed	No
Master_SSL_CA_File	
Master_SSL_CA_Path	
Master_SSL_Cert	
Master_SSL_Cipher	
Master_SSL_Key	
Seconds_Behind_Master	#
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
select * from t1;
n
@@ -39,23 +70,116 @@ n
2
3
4
show slave status;
Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	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	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master
#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	776	slave-relay-bin.000004	#	master-bin.000001	#	No							0		0	319	#	Master	master-no-such-bin.000001	291	No						#
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	776
Relay_Log_File	slave-relay-bin.000004
Relay_Log_Pos	#
Relay_Master_Log_File	master-bin.000001
Slave_IO_Running	#
Slave_SQL_Running	No
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	319
Relay_Log_Space	#
Until_Condition	Master
Until_Log_File	master-no-such-bin.000001
Until_Log_Pos	291
Master_SSL_Allowed	No
Master_SSL_CA_File	
Master_SSL_CA_Path	
Master_SSL_Cert	
Master_SSL_Cipher	
Master_SSL_Key	
Seconds_Behind_Master	#
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
select * from t2;
n
1
2
show slave status;
Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	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	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master
#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	776	slave-relay-bin.000004	#	master-bin.000001	#	No							0		0	608	#	Relay	slave-relay-bin.000004	746	No						#
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	776
Relay_Log_File	slave-relay-bin.000004
Relay_Log_Pos	#
Relay_Master_Log_File	master-bin.000001
Slave_IO_Running	#
Slave_SQL_Running	No
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	608
Relay_Log_Space	#
Until_Condition	Relay
Until_Log_File	slave-relay-bin.000004
Until_Log_Pos	746
Master_SSL_Allowed	No
Master_SSL_CA_File	
Master_SSL_CA_Path	
Master_SSL_Cert	
Master_SSL_Cipher	
Master_SSL_Key	
Seconds_Behind_Master	#
start slave;
stop slave;
start slave until master_log_file='master-bin.000001', master_log_pos=776;
show slave status;
Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	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	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master
#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	776	slave-relay-bin.000004	#	master-bin.000001	Yes	No							0		0	776	#	Master	master-bin.000001	776	No						#
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	776
Relay_Log_File	slave-relay-bin.000004
Relay_Log_Pos	#
Relay_Master_Log_File	master-bin.000001
Slave_IO_Running	Yes
Slave_SQL_Running	No
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	776
Relay_Log_Space	#
Until_Condition	Master
Until_Log_File	master-bin.000001
Until_Log_Pos	776
Master_SSL_Allowed	No
Master_SSL_CA_File	
Master_SSL_CA_Path	
Master_SSL_Cert	
Master_SSL_Cipher	
Master_SSL_Key	
Seconds_Behind_Master	#
start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
+10 −2
Original line number Diff line number Diff line
@@ -122,9 +122,17 @@ select HEX(f) from t3;
select HEX(f) from t04;
select HEX(f) from t4;

#
#14157: utf8 encoding in binlog without set character_set_client
#
flush logs;
--exec $MYSQL --character-sets-dir=../sql/share/charsets/ --default-character-set=koi8r test -e 'create table if not exists t5 (a int); set names koi8r; create temporary table `` (a int); insert into `` values (1); insert into t5 select * from ``'

# resulted log is client charset insensitive (latin1 not koi8r) as it must be
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000006 | $MYSQL --default-character-set=latin1
select * from t5  /* must be (1),(1) */;

# clean up
drop table t1, t2, t03, t04, t3, t4; 
drop table t1, t2, t03, t04, t3, t4, t5; 

# End of 4.1 tests
# End of 5.0 tests
+22 −15
Original line number Diff line number Diff line
@@ -163,24 +163,19 @@ drop table t5;
# value was set up at the moment of temp table creation
#
connection con1;
set @session.pseudo_thread_id=100;
set @@session.pseudo_thread_id=100;
create temporary table t101 (id int);
create temporary table t102 (id int);
set @session.pseudo_thread_id=200;
set @@session.pseudo_thread_id=200;
create temporary table t201 (id int);
create temporary table `#not_user_table_prefixed_with_hash_sign_no_harm` (id int);

#
# Don't kill our own connection to the server as
# the result code differs depending on platform.
#
# Select the id to kill into a variable of mysqltest
let $con1_id= `select connection_id()`;
# Switch connection to avoid killing our own connection
connection master;
--disable_query_log
eval kill $con1_id;
--enable_query_log
create temporary table `t``201` (id int);
# emulate internal temp table not to come to binlog
create temporary table `#sql_not_user_table202` (id int);
set @@session.pseudo_thread_id=300;
create temporary table t301 (id int);
create temporary table t302 (id int);
create temporary table `#sql_not_user_table303` (id int);
disconnect con1;

#now do something to show that slave is ok after DROP temp tables
connection master;
@@ -194,4 +189,16 @@ select * from t1 /* must be 1 */;
connection master; 
drop table t1;

#
#14157: utf8 encoding in binlog without set character_set_client
#
--exec $MYSQL --character-sets-dir=../sql/share/charsets/ --default-character-set=koi8r test -e 'create table t1 (a int); set names koi8r; create temporary table `ÑÝÉË` (a int); insert into `ÑÝÉË` values (1); insert into t1 select * from `ÑÝÉË`'

sync_slave_with_master;
#connection slave;
select * from t1;

connection master; 
drop table t1;

# End of 5.0 tests
Loading