Commit a85df46c authored by guilhem@mysql.com's avatar guilhem@mysql.com

Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-5.0

into mysql.com:/home/mysql_src/mysql-5.0-clean
parents 6e02e19b ac053d80
......@@ -488,6 +488,15 @@ Create_file event for file_id: %u\n",exv->file_id);
static struct my_option my_long_options[] =
{
/*
mysqlbinlog needs charsets knowledge, to be able to convert a charset
number found in binlog to a charset name (to be able to print things
like this:
SET @`a`:=_cp850 0x4DFC6C6C6572 COLLATE `cp850_general_ci`;
*/
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory where character sets are.", (gptr*) &charsets_dir,
(gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DBUG_OFF
{"debug", '#', "Output debug log.", (gptr*) &default_dbug_option,
(gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
......
......@@ -692,7 +692,7 @@ fi
MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent"
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT"
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT"
MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES
......
......@@ -526,13 +526,14 @@ insert into t2 values (@v);
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 User var 1 135 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
master-bin.000001 135 Query 1 218 use `test`; insert into t2 values (@v)
master-bin.000001 135 Query 1 225 use `test`; insert into t2 values (@v)
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`;
use test;
SET TIMESTAMP=10000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t2 values (@v);
drop table t2;
set names latin1;
......
......@@ -11,8 +11,8 @@ get_lock("a",10)
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 206 create database `drop-temp+table-test`
master-bin.000001 206 Query 1 322 use `drop-temp+table-test`; create temporary table `table:name` (a int)
master-bin.000001 322 Query 1 473 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name`
master-bin.000001 473 Query 1 566 use `drop-temp+table-test`; DO RELEASE_LOCK("a")
master-bin.000001 95 Query 1 213 create database `drop-temp+table-test`
master-bin.000001 213 Query 1 336 use `drop-temp+table-test`; create temporary table `table:name` (a int)
master-bin.000001 336 Query 1 494 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name`
master-bin.000001 494 Query 1 594 use `drop-temp+table-test`; DO RELEASE_LOCK("a")
drop database `drop-temp+table-test`;
......@@ -75,7 +75,7 @@ ERROR 23000: Duplicate entry '2' for key 1
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 183 use `test`; insert into t1 select * from t2
master-bin.000001 95 Query 1 190 use `test`; insert into t1 select * from t2
select * from t1;
a
1
......
......@@ -9,9 +9,9 @@ commit;
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 157 Query 1 # use `test`; insert into t1 values(1)
master-bin.000001 238 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 326 Query 1 # use `test`; COMMIT
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(1)
master-bin.000001 252 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 347 Query 1 # use `test`; COMMIT
delete from t1;
delete from t2;
reset master;
......@@ -24,9 +24,9 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 157 Query 1 # use `test`; insert into t1 values(2)
master-bin.000001 238 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 326 Query 1 # use `test`; ROLLBACK
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(2)
master-bin.000001 252 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 347 Query 1 # use `test`; ROLLBACK
delete from t1;
delete from t2;
reset master;
......@@ -42,12 +42,12 @@ commit;
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 157 Query 1 # use `test`; insert into t1 values(3)
master-bin.000001 238 Query 1 # use `test`; savepoint my_savepoint
master-bin.000001 317 Query 1 # use `test`; insert into t1 values(4)
master-bin.000001 398 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 486 Query 1 # use `test`; rollback to savepoint my_savepoint
master-bin.000001 577 Query 1 # use `test`; COMMIT
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(3)
master-bin.000001 252 Query 1 # use `test`; savepoint my_savepoint
master-bin.000001 338 Query 1 # use `test`; insert into t1 values(4)
master-bin.000001 426 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 521 Query 1 # use `test`; rollback to savepoint my_savepoint
master-bin.000001 619 Query 1 # use `test`; COMMIT
delete from t1;
delete from t2;
reset master;
......@@ -68,13 +68,13 @@ a
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 157 Query 1 # use `test`; insert into t1 values(5)
master-bin.000001 238 Query 1 # use `test`; savepoint my_savepoint
master-bin.000001 317 Query 1 # use `test`; insert into t1 values(6)
master-bin.000001 398 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 486 Query 1 # use `test`; rollback to savepoint my_savepoint
master-bin.000001 577 Query 1 # use `test`; insert into t1 values(7)
master-bin.000001 658 Query 1 # use `test`; COMMIT
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(5)
master-bin.000001 252 Query 1 # use `test`; savepoint my_savepoint
master-bin.000001 338 Query 1 # use `test`; insert into t1 values(6)
master-bin.000001 426 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 521 Query 1 # use `test`; rollback to savepoint my_savepoint
master-bin.000001 619 Query 1 # use `test`; insert into t1 values(7)
master-bin.000001 707 Query 1 # use `test`; COMMIT
delete from t1;
delete from t2;
reset master;
......@@ -90,9 +90,9 @@ get_lock("a",10)
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 157 Query 1 # use `test`; insert into t1 values(8)
master-bin.000001 238 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 326 Query 1 # use `test`; ROLLBACK
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(8)
master-bin.000001 252 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 347 Query 1 # use `test`; ROLLBACK
delete from t1;
delete from t2;
reset master;
......@@ -101,7 +101,7 @@ insert into t2 select * from t1;
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; insert into t1 values(9)
master-bin.000001 176 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 183 Query 1 # use `test`; insert into t2 select * from t1
delete from t1;
delete from t2;
reset master;
......@@ -111,16 +111,16 @@ insert into t2 select * from t1;
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; insert into t1 values(10)
master-bin.000001 177 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 184 Query 1 # use `test`; insert into t2 select * from t1
insert into t1 values(11);
commit;
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; insert into t1 values(10)
master-bin.000001 177 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 265 Query 1 # use `test`; BEGIN
master-bin.000001 327 Query 1 # use `test`; insert into t1 values(11)
master-bin.000001 409 Query 1 # use `test`; COMMIT
master-bin.000001 184 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 279 Query 1 # use `test`; BEGIN
master-bin.000001 348 Query 1 # use `test`; insert into t1 values(11)
master-bin.000001 437 Query 1 # use `test`; COMMIT
alter table t2 engine=INNODB;
delete from t1;
delete from t2;
......@@ -132,9 +132,9 @@ commit;
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 157 Query 1 # use `test`; insert into t1 values(12)
master-bin.000001 239 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 327 Query 1 # use `test`; COMMIT
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(12)
master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 348 Query 1 # use `test`; COMMIT
delete from t1;
delete from t2;
reset master;
......@@ -157,8 +157,8 @@ commit;
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 157 Query 1 # use `test`; insert into t1 values(14)
master-bin.000001 239 Query 1 # use `test`; COMMIT
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(14)
master-bin.000001 253 Query 1 # use `test`; COMMIT
delete from t1;
delete from t2;
reset master;
......@@ -177,9 +177,9 @@ a
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 # use `test`; BEGIN
master-bin.000001 157 Query 1 # use `test`; insert into t1 values(16)
master-bin.000001 239 Query 1 # use `test`; insert into t1 values(18)
master-bin.000001 321 Query 1 # use `test`; COMMIT
master-bin.000001 164 Query 1 # use `test`; insert into t1 values(16)
master-bin.000001 253 Query 1 # use `test`; insert into t1 values(18)
master-bin.000001 342 Query 1 # use `test`; COMMIT
delete from t1;
delete from t2;
alter table t2 type=MyISAM;
......
......@@ -19,6 +19,7 @@ use test;
SET TIMESTAMP=1000000000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
drop table if exists t1,t2;
SET TIMESTAMP=1000000000;
create table t1 (word varchar(20));
......@@ -41,6 +42,7 @@ use test;
SET TIMESTAMP=1000000000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values ("Alas");
--- --database --
......@@ -53,6 +55,7 @@ use test;
SET TIMESTAMP=1000000000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values ("Alas");
--- Remote --
......@@ -61,6 +64,7 @@ use test;
SET TIMESTAMP=1000000000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
drop table if exists t1,t2;
SET TIMESTAMP=1000000000;
create table t1 (word varchar(20));
......@@ -83,6 +87,7 @@ use test;
SET TIMESTAMP=1000000000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values ("Alas");
--- --database --
......@@ -95,5 +100,6 @@ use test;
SET TIMESTAMP=1000000000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values ("Alas");
drop table t1, t2;
This diff is collapsed.
......@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set timestamp=1000000000;
drop database if exists mysqltest2;
drop database if exists mysqltest3;
create database mysqltest2 character set latin2;
......@@ -87,7 +88,6 @@ a b
2 Muffler
3 latin1_german2_ci
4 Mller
load data infile '../../std_data/words.dat' into table t1 (b);
set @a= _cp850 'Mller' collate cp850_general_ci;
truncate table t1;
insert into t1 (b) values(collation(@a));
......@@ -108,63 +108,39 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # drop database if exists mysqltest2
master-bin.000001 # Query 1 # drop database if exists mysqltest3
master-bin.000001 # Query 1 # create database mysqltest2 character set latin2
master-bin.000001 # Query 1 # use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30
master-bin.000001 # Query 1 # create database mysqltest3
master-bin.000001 # Query 1 # use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
master-bin.000001 # Query 1 # drop database mysqltest3
master-bin.000001 # Query 1 # use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
master-bin.000001 # Query 1 # create database mysqltest3
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Query 1 # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Intvar 1 # INSERT_ID=1
master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(@@character_set_server)
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Intvar 1 # INSERT_ID=2
master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(@@collation_server)
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Intvar 1 # INSERT_ID=3
master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(@@character_set_client)
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Intvar 1 # INSERT_ID=4
master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(@@character_set_connection)
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Intvar 1 # INSERT_ID=5
master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Query 1 # use `mysqltest2`; truncate table t1
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Intvar 1 # INSERT_ID=1
master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Intvar 1 # INSERT_ID=2
master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(LEAST("Mller","Muffler"))
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Intvar 1 # INSERT_ID=3
master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Intvar 1 # INSERT_ID=4
master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(LEAST("Mller","Muffler"))
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Intvar 1 # INSERT_ID=74
master-bin.000001 # Create_file 1 # db=mysqltest2;table=t1;file_id=1;block_len=581
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Intvar 1 # INSERT_ID=5
master-bin.000001 # Exec_load 1 # ;file_id=1
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Query 1 # use `mysqltest2`; truncate table t1
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Intvar 1 # INSERT_ID=1
master-bin.000001 # User var 1 # @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci
master-bin.000001 # Query 1 # use `mysqltest2`; insert into t1 (b) values(collation(@a))
master-bin.000001 # Query 1 # use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Query 1 # drop database mysqltest2
master-bin.000001 # Query 1 # SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
master-bin.000001 # Query 1 # drop database mysqltest3
set global character_set_server=latin2;
ERROR HY000: Binary logging and replication forbid changing the global server character set, collation
set global character_set_server=latin1;
set global character_set_server=latin2;
ERROR HY000: Binary logging and replication forbid changing the global server character set, collation
set global character_set_server=latin1;
set one_shot @@character_set_server=latin5;
set @@max_join_size=1000;
select @@character_set_server;
......@@ -198,12 +174,74 @@ CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
select hex(c1), hex(c2) from t1;
hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
stop slave;
delete from t1;
change master to master_log_pos=6809;
start slave until master_log_file='master-bin.000001', master_log_pos=6967;
start slave;
select hex(c1), hex(c2) from t1;
hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
SET TIMESTAMP=1000000000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
drop database if exists mysqltest2;
SET TIMESTAMP=1000000000;
drop database if exists mysqltest3;
SET TIMESTAMP=1000000000;
create database mysqltest2 character set latin2;
SET TIMESTAMP=1000000000;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=30;
create database mysqltest3;
SET TIMESTAMP=1000000000;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=64;
drop database mysqltest3;
SET TIMESTAMP=1000000000;
create database mysqltest3;
use mysqltest2;
SET TIMESTAMP=1000000000;
create table t1 (a int auto_increment primary key, b varchar(100));
SET INSERT_ID=1;
SET TIMESTAMP=1000000000;
SET @@session.character_set_client=4,@@session.collation_connection=27,@@session.collation_server=64;
insert into t1 (b) values(@@character_set_server);
SET INSERT_ID=2;
SET TIMESTAMP=1000000000;
insert into t1 (b) values(@@collation_server);
SET INSERT_ID=3;
SET TIMESTAMP=1000000000;
insert into t1 (b) values(@@character_set_client);
SET INSERT_ID=4;
SET TIMESTAMP=1000000000;
insert into t1 (b) values(@@character_set_connection);
SET INSERT_ID=5;
SET TIMESTAMP=1000000000;
insert into t1 (b) values(@@collation_connection);
SET TIMESTAMP=1000000000;
SET @@session.character_set_client=8,@@session.collation_connection=5,@@session.collation_server=64;
truncate table t1;
SET INSERT_ID=1;
SET TIMESTAMP=1000000000;
insert into t1 (b) values(@@collation_connection);
SET INSERT_ID=2;
SET TIMESTAMP=1000000000;
insert into t1 (b) values(LEAST("Mller","Muffler"));
SET INSERT_ID=3;
SET TIMESTAMP=1000000000;
SET @@session.character_set_client=8,@@session.collation_connection=31,@@session.collation_server=64;
insert into t1 (b) values(@@collation_connection);
SET INSERT_ID=4;
SET TIMESTAMP=1000000000;
insert into t1 (b) values(LEAST("Mller","Muffler"));
SET TIMESTAMP=1000000000;
truncate table t1;
SET INSERT_ID=1;
SET @`a`:=_cp850 0x4DFC6C6C6572 COLLATE `cp850_general_ci`;
SET TIMESTAMP=1000000000;
insert into t1 (b) values(collation(@a));
SET TIMESTAMP=1000000000;
drop database mysqltest2;
SET TIMESTAMP=1000000000;
drop database mysqltest3;
use test;
SET TIMESTAMP=1000000000;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=30;
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
SET TIMESTAMP=1000000000;
SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30;
INSERT INTO t1 (c1, c2) VALUES (', ',', ');
drop table t1;
......@@ -9,7 +9,7 @@ insert into t1 values (1),(1);
ERROR 23000: Duplicate entry '1' for key 1
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_PORT 1 master-bin.000001 273 # # master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 273 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 287 # # master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 287 # None 0 No #
show tables like 't1';
Tables_in_test (t1)
drop table t1;
......@@ -28,12 +28,12 @@ kill @id;
drop table t2,t3;
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 187 use `test`; create table t1 (a int primary key)
master-bin.000001 187 Query 1 273 use `test`; insert into t1 values (1),(1)
master-bin.000001 273 Query 1 343 use `test`; drop table t1
master-bin.000001 343 Query 1 435 use `test`; create table t2 (a int primary key)
master-bin.000001 435 Query 1 516 use `test`; insert into t2 values(1)
master-bin.000001 516 Query 1 597 use `test`; create table t3 (id int)
master-bin.000001 597 Query 1 692 use `test`; insert into t3 values(connection_id())
master-bin.000001 692 Query 1 805 use `test`; update t2 set a = a + 1 + get_lock('crash_lock%20C', 10)
master-bin.000001 805 Query 1 878 use `test`; drop table t2,t3
master-bin.000001 95 Query 1 194 use `test`; create table t1 (a int primary key)
master-bin.000001 194 Query 1 287 use `test`; insert into t1 values (1),(1)
master-bin.000001 287 Query 1 364 use `test`; drop table t1
master-bin.000001 364 Query 1 463 use `test`; create table t2 (a int primary key)
master-bin.000001 463 Query 1 551 use `test`; insert into t2 values(1)
master-bin.000001 551 Query 1 639 use `test`; create table t3 (id int)
master-bin.000001 639 Query 1 741 use `test`; insert into t3 values(connection_id())
master-bin.000001 741 Query 1 861 use `test`; update t2 set a = a + 1 + get_lock('crash_lock%20C', 10)
master-bin.000001 861 Query 1 941 use `test`; drop table t2,t3
......@@ -14,4 +14,4 @@ start slave;
flush logs;
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 SLAVE_PORT 60 slave-bin.000001 199 # # slave-bin.000001 Yes Yes 0 0 199 # None 0 No #
# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 206 # # slave-bin.000001 Yes Yes 0 0 206 # None 0 No #
......@@ -15,26 +15,26 @@ flush no_write_to_binlog tables;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 175 use `test`; create table t1 (a int)
master-bin.000001 175 Query 1 258 use `test`; insert into t1 values (10)
master-bin.000001 258 Query 1 338 use `test`; create table t2 (a int)
master-bin.000001 338 Query 1 441 use `test`; create table t3 (a int) engine=merge union(t1)
master-bin.000001 441 Query 1 521 use `test`; create table t4 (a int)
master-bin.000001 521 Query 1 609 use `test`; insert into t4 select * from t3
master-bin.000001 609 Query 1 697 use `test`; rename table t1 to t5, t2 to t1
master-bin.000001 95 Query 1 182 use `test`; create table t1 (a int)
master-bin.000001 182 Query 1 272 use `test`; insert into t1 values (10)
master-bin.000001 272 Query 1 359 use `test`; create table t2 (a int)
master-bin.000001 359 Query 1 469 use `test`; create table t3 (a int) engine=merge union(t1)
master-bin.000001 469 Query 1 556 use `test`; create table t4 (a int)
master-bin.000001 556 Query 1 651 use `test`; insert into t4 select * from t3
master-bin.000001 651 Query 1 746 use `test`; rename table t1 to t5, t2 to t1
select * from t3;
a
flush tables;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 175 use `test`; create table t1 (a int)
master-bin.000001 175 Query 1 258 use `test`; insert into t1 values (10)
master-bin.000001 258 Query 1 338 use `test`; create table t2 (a int)
master-bin.000001 338 Query 1 441 use `test`; create table t3 (a int) engine=merge union(t1)
master-bin.000001 441 Query 1 521 use `test`; create table t4 (a int)
master-bin.000001 521 Query 1 609 use `test`; insert into t4 select * from t3
master-bin.000001 609 Query 1 697 use `test`; rename table t1 to t5, t2 to t1
master-bin.000001 697 Query 1 766 use `test`; flush tables
master-bin.000001 95 Query 1 182 use `test`; create table t1 (a int)
master-bin.000001 182 Query 1 272 use `test`; insert into t1 values (10)
master-bin.000001 272 Query 1 359 use `test`; create table t2 (a int)
master-bin.000001 359 Query 1 469 use `test`; create table t3 (a int) engine=merge union(t1)
master-bin.000001 469 Query 1 556 use `test`; create table t4 (a int)
master-bin.000001 556 Query 1 651 use `test`; insert into t4 select * from t3
master-bin.000001 651 Query 1 746 use `test`; rename table t1 to t5, t2 to t1
master-bin.000001 746 Query 1 822 use `test`; flush tables
select * from t3;
a
......@@ -22,7 +22,7 @@ day id category name
2003-03-22 2416 a bbbbb
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
slave-bin.000001 1068
slave-bin.000001 1096
drop table t1;
drop table t2;
drop table t3;
......@@ -33,7 +33,7 @@ set global sql_slave_skip_counter=1;
start slave;
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_PORT 1 master-bin.000001 1503 # # master-bin.000001 Yes Yes 0 0 1503 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1559 # # master-bin.000001 Yes Yes 0 0 1559 # None 0 No #
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
......@@ -43,7 +43,7 @@ change master to master_user='test';
change master to master_user='root';
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_PORT 1 master-bin.000001 1611 # # master-bin.000001 No No 0 0 1611 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1667 # # master-bin.000001 No No 0 0 1667 # None 0 No #
set global sql_slave_skip_counter=1;
start slave;
set sql_log_bin=0;
......@@ -64,5 +64,5 @@ terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
ERROR 23000: Duplicate entry '2003-03-22' for key 1
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 529
master-bin.000001 536
drop table t2;
......@@ -12,6 +12,6 @@ use mysqltest;
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 190 drop database if exists mysqltest
master-bin.000001 190 Query 1 277 create database mysqltest
master-bin.000001 95 Query 1 197 drop database if exists mysqltest
master-bin.000001 197 Query 1 291 create database mysqltest
drop database mysqltest;
......@@ -20,24 +20,24 @@ drop table t1;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 210 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 210 Intvar 1 238 INSERT_ID=1
master-bin.000001 238 Query 1 323 use `test`; insert into t1 values (NULL)
master-bin.000001 323 Query 1 393 use `test`; drop table t1
master-bin.000001 393 Query 1 490 use `test`; create table t1 (word char(20) not null)
master-bin.000001 490 Create_file 1 1160 db=test;table=t1;file_id=1;block_len=581
master-bin.000001 1160 Exec_load 1 1183 ;file_id=1
master-bin.000001 1183 Query 1 1253 use `test`; drop table t1
master-bin.000001 95 Query 1 217 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 217 Intvar 1 245 INSERT_ID=1
master-bin.000001 245 Query 1 337 use `test`; insert into t1 values (NULL)
master-bin.000001 337 Query 1 414 use `test`; drop table t1
master-bin.000001 414 Query 1 518 use `test`; create table t1 (word char(20) not null)
master-bin.000001 518 Create_file 1 1188 db=test;table=t1;file_id=1;block_len=581
master-bin.000001 1188 Exec_load 1 1211 ;file_id=1
master-bin.000001 1211 Query 1 1288 use `test`; drop table t1
show binlog events from 95 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 210 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 95 Query 1 217 use `test`; create table t1(n int not null auto_increment primary key)
show binlog events from 95 limit 2;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 Query 1 210 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 210 Intvar 1 238 INSERT_ID=1
master-bin.000001 95 Query 1 217 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 217 Intvar 1 245 INSERT_ID=1
show binlog events from 95 limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 238 Query 1 323 use `test`; insert into t1 values (NULL)
master-bin.000001 245 Query 1 337 use `test`; insert into t1 values (NULL)
flush logs;
create table t5 (a int);
drop table t5;
......@@ -50,23 +50,23 @@ drop table t1;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 210 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 210 Intvar 1 238 INSERT_ID=1
master-bin.000001 238 Query 1 323 use `test`; insert into t1 values (NULL)
master-bin.000001 323 Query 1 393 use `test`; drop table t1
master-bin.000001 393 Query 1 490 use `test`; create table t1 (word char(20) not null)
master-bin.000001 490 Create_file 1 1160 db=test;table=t1;file_id=1;block_len=581
master-bin.000001 1160 Exec_load 1 1183 ;file_id=1
master-bin.000001 1183 Query 1 1253 use `test`; drop table t1
master-bin.000001 1253 Rotate 1 1297 master-bin.000002;pos=4
master-bin.000001 95 Query 1 217 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 217 Intvar 1 245 INSERT_ID=1
master-bin.000001 245 Query 1 337 use `test`; insert into t1 values (NULL)
master-bin.000001 337 Query 1 414 use `test`; drop table t1
master-bin.000001 414 Query 1 518 use `test`; create table t1 (word char(20) not null)
master-bin.000001 518 Create_file 1 1188 db=test;table=t1;file_id=1;block_len=581
master-bin.000001 1188 Exec_load 1 1211 ;file_id=1
master-bin.000001 1211 Query 1 1288 use `test`; drop table t1
master-bin.000001 1288 Rotate 1 1332 master-bin.000002;pos=4
show binlog events in 'master-bin.000002';
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000002 95 Query 1 175 use `test`; create table t5 (a int)
master-bin.000002 175 Query 1 245 use `test`; drop table t5
master-bin.000002 245 Query 1 325 use `test`; create table t1 (n int)
master-bin.000002 325 Query 1 407 use `test`; insert into t1 values (1)
master-bin.000002 407 Query 1 477 use `test`; drop table t1
master-bin.000002 95 Query 1 182 use `test`; create table t5 (a int)
master-bin.000002 182 Query 1 259 use `test`; drop table t5
master-bin.000002 259 Query 1 346 use `test`; create table t1 (n int)
master-bin.000002 346 Query 1 435 use `test`; insert into t1 values (1)
master-bin.000002 435 Query 1 512 use `test`; drop table t1
show binary logs;
Log_name
master-bin.000001
......@@ -79,25 +79,25 @@ slave-bin.000002
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 4 Format_desc 2 95 Server ver: VERSION, Binlog ver: 4
slave-bin.000001 95 Query 1 210 use `test`; create table t1(n int not null auto_increment primary key)
slave-bin.000001 210 Intvar 1 238 INSERT_ID=1
slave-bin.000001 238 Query 1 323 use `test`; insert into t1 values (NULL)
slave-bin.000001 323 Query 1 393 use `test`; drop table t1
slave-bin.000001 393 Query 1 490 use `test`; create table t1 (word char(20) not null)
slave-bin.000001 490 Create_file 1 1169 db=test;table=t1;file_id=1;block_len=581
slave-bin.000001 1169 Exec_load 1 1192 ;file_id=1
slave-bin.000001 1192 Query 1 1262 use `test`; drop table t1
slave-bin.000001 1262 Query 1 1342 use `test`; create table t5 (a int)
slave-bin.000001 1342 Query 1 1412 use `test`; drop table t5
slave-bin.000001 1412 Rotate 2 1455 slave-bin.000002;pos=4
slave-bin.000001 95 Query 1 217 use `test`; create table t1(n int not null auto_increment primary key)
slave-bin.000001 217 Intvar 1 245 INSERT_ID=1
slave-bin.000001 245 Query 1 337 use `test`; insert into t1 values (NULL)
slave-bin.000001 337 Query 1 414 use `test`; drop table t1
slave-bin.000001 414 Query 1 518 use `test`; create table t1 (word char(20) not null)
slave-bin.000001 518 Create_file 1 1197 db=test;table=t1;file_id=1;block_len=581
slave-bin.000001 1197 Exec_load 1 1220 ;file_id=1
slave-bin.000001 1220 Query 1 1297 use `test`; drop table t1
slave-bin.000001 1297 Query 1 1384 use `test`; create table t5 (a int)
slave-bin.000001 1384 Query 1 1461 use `test`; drop table t5
slave-bin.000001 1461 Rotate 2 1504 slave-bin.000002;pos=4
show binlog events in 'slave-bin.000002' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000002 4 Format_desc 2 95 Server ver: VERSION, Binlog ver: 4
slave-bin.000002 95 Query 1 175 use `test`; create table t1 (n int)
slave-bin.000002 175 Query 1 257 use `test`; insert into t1 values (1)
slave-bin.000002 257 Query 1 327 use `test`; drop table t1
slave-bin.000002 95 Query 1 182 use `test`; create table t1 (n int)
slave-bin.000002 182 Query 1 271 use `test`; insert into t1 values (1)
slave-bin.000002 271 Query 1 348 use `test`; drop table t1
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_PORT 1 master-bin.000002 477 # # master-bin.000002 Yes Yes 0 0 477 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 512 # # master-bin.000002 Yes Yes 0 0 512 # None 0 No #
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
......@@ -16,7 +16,7 @@ select @@global.max_relay_log_size;
start slave;
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_PORT 1 master-bin.000001 68137 # # master-bin.000001 Yes Yes 0 0 68137 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73751 # # master-bin.000001 Yes Yes 0 0 73751 # None 0 No #
stop slave;
reset slave;
set global max_relay_log_size=(5*4096);
......@@ -26,7 +26,7 @@ select @@global.max_relay_log_size;
start slave;
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_PORT 1 master-bin.000001 68137 # # master-bin.000001 Yes Yes 0 0 68137 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73751 # # master-bin.000001 Yes Yes 0 0 73751 # None 0 No #
stop slave;
reset slave;
set global max_relay_log_size=0;
......@@ -36,7 +36,7 @@ select @@global.max_relay_log_size;
start slave;
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_PORT 1 master-bin.000001 68137 # # master-bin.000001 Yes Yes 0 0 68137 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73751 # # master-bin.000001 Yes Yes 0 0 73751 # None 0 No #
stop slave;
reset slave;
flush logs;
......@@ -49,12 +49,12 @@ flush logs;
create table t1 (a int);
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_PORT 1 master-bin.000001 68217 # # master-bin.000001 Yes Yes 0 0 68217 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73838 # # master-bin.000001 Yes Yes 0 0 73838 # None 0 No #
flush logs;
drop table t1;
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_PORT 1 master-bin.000001 68287 # # master-bin.000001 Yes Yes 0 0 68287 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73915 # # master-bin.000001 Yes Yes 0 0 73915 # None 0 No #
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
......
......@@ -18,5 +18,5 @@ max(a)
8000
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 687207 # # master-bin.000001 Yes Yes 0 0 687207 # None 0 No #
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 743228 # # master-bin.000001 Yes Yes 0 0 743228 # None 0 No #
drop table t1;
......@@ -28,4 +28,4 @@ ERROR 42S02: Table 'test.t11' doesn't exist
drop table if exists t1,t2,t11;
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_PORT 1 master-bin.000001 1554 # # master-bin.000001 Yes Yes test.t1 0 0 1554 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1617 # # master-bin.000001 Yes Yes test.t1 0 0 1617 # None 0 No #
......@@ -16,7 +16,7 @@ create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard');
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_PORT 60 master-bin.000001 521 # # master-bin.000001 Yes Yes 0 0 521 # None 0 No #
# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 549 # # master-bin.000001 Yes Yes 0 0 549 # None 0 No #
select * from t1;
s
Could not break slave
......@@ -57,7 +57,7 @@ master-bin.000003
insert into t2 values (65);
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_PORT 60 master-bin.000003 469 # # master-bin.000003 Yes Yes 0 0 469 # None 0 No #
# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 497 # # master-bin.000003 Yes Yes 0 0 497 # None 0 No #
select * from t2;
m
34
......@@ -79,13 +79,13 @@ master-bin.000004
master-bin.000005
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000005 1387
master-bin.000005 2050
select * from t4;
a
testing temporary tables part 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_PORT 60 master-bin.000005 1387 # # master-bin.000005 Yes Yes 0 0 1387 # None 0 No #
# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2050 # # master-bin.000005 Yes Yes 0 0 2050 # None 0 No #
lock tables t3 read;
select count(*) from t3 where n >= 4;
count(*)
......
......@@ -39,18 +39,18 @@ f
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 178 use `test`; drop table if exists t1,t2
master-bin.000001 178 Query 1 257 use `test`; create table t1(f int)
master-bin.000001 257 Query 1 336 use `test`; create table t2(f int)
master-bin.000001 336 Query 1 455 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)
master-bin.000001 455 Query 1 544 use `test`; create temporary table t3(f int)
master-bin.000001 544 Query 1 642 use `test`; insert into t3 select * from t1 where f<6
master-bin.000001 642 Query 1 731 use `test`; create temporary table t3(f int)
master-bin.000001 731 Query 1 826 use `test`; insert into t2 select count(*) from t3
master-bin.000001 826 Query 1 925 use `test`; insert into t3 select * from t1 where f>=4
master-bin.000001 925 Query 1 1005 use `test`; drop temporary table t3
master-bin.000001 1005 Query 1 1100 use `test`; insert into t2 select count(*) from t3
master-bin.000001 1100 Query 1 1180 use `test`; drop temporary table t3
master-bin.000001 95 Query 1 185 use `test`; drop table if exists t1,t2
master-bin.000001 185 Query 1 271 use `test`; create table t1(f int)
master-bin.000001 271 Query 1 357 use `test`; create table t2(f int)
master-bin.000001 357 Query 1 483 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)
master-bin.000001 483 Query 1 579 use `test`; create temporary table t3(f int)
master-bin.000001 579 Query 1 684 use `test`; insert into t3 select * from t1 where f<6
master-bin.000001 684 Query 1 780 use `test`; create temporary table t3(f int)
master-bin.000001 780 Query 1 882 use `test`; insert into t2 select count(*) from t3
master-bin.000001 882 Query 1 988 use `test`; insert into t3 select * from t1 where f>=4
master-bin.000001 988 Query 1 1075 use `test`; drop temporary table t3
master-bin.000001 1075 Query 1 1177 use `test`; insert into t2 select count(*) from t3
master-bin.000001 1177 Query 1 1264 use `test`; drop temporary table t3
drop table t1, t2;
use test;
SET TIMESTAMP=1040323920;
......
......@@ -33,12 +33,12 @@ t
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 181 use `test`; create table t1 (t timestamp)
master-bin.000001 181 Query 1 266 use `test`; create table t2 (t char(32))
master-bin.000001 266 Query 1 351 use `test`; SET ONE_SHOT TIME_ZONE='UTC'
master-bin.000001 351 Query 1 468 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
master-bin.000001 468 Query 1 539 use `test`; delete from t1
master-bin.000001 539 Query 1 656 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
master-bin.000001 95 Query 1 188 use `test`; create table t1 (t timestamp)
master-bin.000001 188 Query 1 280 use `test`; create table t2 (t char(32))
master-bin.000001 280 Query 1 372 use `test`; SET ONE_SHOT TIME_ZONE='UTC'
master-bin.000001 372 Query 1 496 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
master-bin.000001 496 Query 1 574 use `test`; delete from t1
master-bin.000001 574 Query 1 698 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
set time_zone='MET';
insert into t2 (select t from t1);
select * from t1;
......
......@@ -76,34 +76,35 @@ abcn1n2
NULL
NULL
NULL
show binlog events from 179;
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 179 User var 2 222 @`i1`=12345678901234
slave-bin.000001 222 User var 2 265 @`i2`=-12345678901234
slave-bin.000001 265 User var 2 308 @`i3`=0
slave-bin.000001 308 User var 2 351 @`i4`=-1
slave-bin.000001 351 Query 1 456 use `test`; insert into t1 values (@i1), (@i2), (@i3), (@i4)
slave-bin.000001 456 User var 2 499 @`r1`=12.5
slave-bin.000001 499 User var 2 542 @`r2`=-12.5
slave-bin.000001 542 Query 1 633 use `test`; insert into t1 values (@r1), (@r2)
slave-bin.000001 633 User var 2 682 @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci
slave-bin.000001 682 User var 2 717 @`s2`=_latin1 "" COLLATE latin1_swedish_ci
slave-bin.000001 717 User var 2 759 @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
slave-bin.000001 759 User var 2 801 @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci
slave-bin.000001 801 User var 2 843 @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
slave-bin.000001 843 Query 1 955 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5)
slave-bin.000001 955 User var 2 981 @`n1`=NULL
slave-bin.000001 981 Query 1 1065 use `test`; insert into t1 values (@n1)
slave-bin.000001 1065 User var 2 1091 @`n2`=NULL
slave-bin.000001 1091 Query 1 1175 use `test`; insert into t1 values (@n2)
slave-bin.000001 1175 Query 1 1285 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1)
slave-bin.000001 1285 User var 2 1327 @`a`=2
slave-bin.000001 1327 Query 1 1421 use `test`; insert into t1 values (@a+(@b:=@a+1))
slave-bin.000001 1421 User var 2 1458 @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci
slave-bin.000001 1458 Query 1 1584 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'))
slave-bin.000001 1584 User var 2 1626 @`a`=5
slave-bin.000001 1626 Query 1 1714 use `test`; insert into t1 values (@a),(@a)
slave-bin.000001 1714 User var 2 1739 @`a`=NULL
slave-bin.000001 1739 Query 1 1834 use `test`; insert into t1 values (@a),(@a),(@a*5)
slave-bin.000001 95 Query 1 186 use `test`; create table t1(n char(30))
slave-bin.000001 186 User var 2 229 @`i1`=12345678901234
slave-bin.000001 229 User var 2 272 @`i2`=-12345678901234
slave-bin.000001 272 User var 2 315 @`i3`=0
slave-bin.000001 315 User var 2 358 @`i4`=-1
slave-bin.000001 358 Query 1 470 use `test`; insert into t1 values (@i1), (@i2), (@i3), (@i4)
slave-bin.000001 470 User var 2 513 @`r1`=12.5
slave-bin.000001 513 User var 2 556 @`r2`=-12.5
slave-bin.000001 556 Query 1 654 use `test`; insert into t1 values (@r1), (@r2)
slave-bin.000001 654 User var 2 703 @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci
slave-bin.000001 703 User var 2 738 @`s2`=_latin1 "" COLLATE latin1_swedish_ci
slave-bin.000001 738 User var 2 780 @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
slave-bin.000001 780 User var 2 822 @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci
slave-bin.000001 822 User var 2 864 @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
slave-bin.000001 864 Query 1 983 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5)
slave-bin.000001 983 User var 2 1009 @`n1`=NULL
slave-bin.000001 1009 Query 1 1100 use `test`; insert into t1 values (@n1)
slave-bin.000001 1100 User var 2 1126 @`n2`=NULL
slave-bin.000001 1126 Query 1 1217 use `test`; insert into t1 values (@n2)
slave-bin.000001 1217 Query 1 1334 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1)
slave-bin.000001 1334 User var 2 1376 @`a`=2
slave-bin.000001 1376 Query 1 1477 use `test`; insert into t1 values (@a+(@b:=@a+1))
slave-bin.000001 1477 User var 2 1514 @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci
slave-bin.000001 1514 Query 1 1647 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'))
slave-bin.000001 1647 User var 2 1689 @`a`=5
slave-bin.000001 1689 Query 1 1784 use `test`; insert into t1 values (@a),(@a)
slave-bin.000001 1784 User var 2 1809 @`a`=NULL
slave-bin.000001 1809 Query 1 1911 use `test`; insert into t1 values (@a),(@a),(@a*5)
drop table t1;
stop slave;
......@@ -177,16 +177,17 @@ insert into t1 values (@var1),(@var2);
show binlog events from 95;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 95 User var 1 136 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
master-bin.000001 136 Query 1 222 use `test`; INSERT INTO t1 VALUES(@`a b`)
master-bin.000001 222 User var 1 264 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
master-bin.000001 264 User var 1 302 @`var2`=_latin1 0x61 COLLATE latin1_swedish_ci
master-bin.000001 302 Query 1 396 use `test`; insert into t1 values (@var1),(@var2)
master-bin.000001 136 Query 1 229 use `test`; INSERT INTO t1 VALUES(@`a b`)
master-bin.000001 229 User var 1 271 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
master-bin.000001 271 User var 1 309 @`var2`=_latin1 0x61 COLLATE latin1_swedish_ci
master-bin.000001 309 Query 1 410 use `test`; insert into t1 values (@var1),(@var2)
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`;
use test;
SET TIMESTAMP=10000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
INSERT INTO t1 VALUES(@`a b`);
SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`;
SET @`var2`:=_latin1 0x61 COLLATE `latin1_swedish_ci`;
......
# Replication of character sets.
# This test will fail if the server/client does not support enough charsets.
# Remember that there currently exists
# Bug #2326: Charset of table is determined by charset of db only if "USE db;"
source include/master-slave.inc;
--disable_warnings
set timestamp=1000000000;
drop database if exists mysqltest2;
drop database if exists mysqltest3;
--enable_warnings
......@@ -46,7 +44,7 @@ set character_set_client=cp850, collation_connection=latin2_croatian_ci;
insert into t1 (b) values(@@character_set_server);
insert into t1 (b) values(@@collation_server);
# character_set_database and collation_database are not tested as they
# are not replicated (Bar said that this variable may be removed shortly).
# needn't be replicated (Bar said in Jan 2005).
insert into t1 (b) values(@@character_set_client);
# collation_client does not exist
insert into t1 (b) values(@@character_set_connection);
......@@ -79,9 +77,10 @@ select "--- --slave--" as "";
--enable_query_log
select * from mysqltest2.t1 order by a;
# See if SET ONE_SHOT gets into binlog when LOAD DATA
connection master;
load data infile '../../std_data/words.dat' into table t1 (b);
# Presently charset info is not logged with LOAD DATA but it will
# change in Jan 2005 when Dmitri pushes his new LOAD DATA,
# before 5.0.3 goes out. When done, LOAD DATA INFILE should be tested
# here.
# See if user var is prefixed with collation in binlog and replicated well.
# Note: replication of user variables is broken as far as derivation is
......@@ -90,6 +89,7 @@ load data infile '../../std_data/words.dat' into table t1 (b);
# know if the collation was explicit or not, so we use DERIVATION_NONE,
# which provokes error messages (like 'Illegal mix of collation') when
# we replay the master's INSERT/etc statements.
connection master;
set @a= _cp850 'Mller' collate cp850_general_ci;
truncate table t1;
insert into t1 (b) values(collation(@a));
......@@ -110,13 +110,13 @@ drop database mysqltest3;
show binlog events from 95;
sync_slave_with_master;
# Check that we can't change global.collation_server
# Check that we can change global.collation_server (since 5.0.3)
error 1387;
set global character_set_server=latin2;
set global character_set_server=latin1; # back
connection master;
error 1387;
set global character_set_server=latin2;
set global character_set_server=latin1; # back
# Check that SET ONE_SHOT is really one shot
......@@ -150,35 +150,9 @@ select hex(c1), hex(c2) from t1;
sync_slave_with_master;
select hex(c1), hex(c2) from t1;
# Now test for BUG##5705: SET CHARACTER_SET_SERVER etc will be lost if
# STOP SLAVE before following query
stop slave;
delete from t1;
# Slave is now supposed to have stopped _after_ the INSERT
# Note that the following positions may change between MySQL versions!
# This position should be position for the SET ONE SHOT CHARACTER_SET_CLIENT
# command just before the INSERT.
# You can find it by doing:
# ../client/mysqlbinlog var/log/master-bin.000001 | grep -3 CHARACTER_SET | tail -7
change master to master_log_pos=6809;
# This position should be position of the INSERT command.
# You can find it by doing:
#
# ../client/mysqlbinlog var/log/master-bin.000001 | grep -3 INSERT | tail -4
start slave until master_log_file='master-bin.000001', master_log_pos=6967;
# Slave is supposed to stop _after_ the INSERT, even though 'master_log_pos' is
# the position of the beginning of the INSERT; after SET slave is not
# supposed to increment position.
wait_for_slave_to_stop;
start slave;
sync_with_master;
select hex(c1), hex(c2) from t1;
connection master;
# Let's have a look at generated SETs.
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001
drop table t1;
sync_slave_with_master;
......@@ -46,7 +46,7 @@ save_master_pos;
connection slave;
sync_with_master;
select * from t1;
show binlog events from 179;
show binlog events from 95;
connection master;
drop table t1;
save_master_pos;
......
......@@ -1346,7 +1346,7 @@ bool MYSQL_LOG::write(Log_event* event_info)
if (thd)
{
/* NOTE: CHARSET AND TZ REPL WILL BE REWRITTEN SHORTLY */
#if MYSQL_VERSION_ID < 50003
/*
To make replication of charsets working in 4.1 we are writing values
of charset related variables before every statement in the binlog,
......@@ -1375,9 +1375,15 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u",
if (e.write(file))
goto err;
}
#endif
/*
We use the same ONE_SHOT trick for making replication of time zones
working in 4.1. Again in 5.0 we have better means for doing this.
TODO: we should do like we now do with charsets (no more ONE_SHOT;
logging in each event in a compact format). Dmitri says we can do:
if (time_zone_used) write the timezone to binlog (in a format to be
defined).
*/
if (thd->time_zone_used &&
thd->variables.time_zone != global_system_variables.time_zone)
......
This diff is collapsed.
......@@ -232,6 +232,7 @@ struct sql_ex_info
#define Q_SQL_MODE_CODE 1
#define Q_CATALOG_CODE 2
#define Q_AUTO_INCREMENT 3
#define Q_CHARSET_CODE 4
/* Intvar event post-header */
......@@ -401,11 +402,19 @@ typedef struct st_last_event_info
bool sql_mode_inited;
ulong sql_mode; /* must be same as THD.variables.sql_mode */
ulong auto_increment_increment, auto_increment_offset;
bool charset_inited;
char charset[6]; // 3 variables, each of them storable in 2 bytes
st_last_event_info()
:flags2_inited(0), flags2(0), sql_mode_inited(0), sql_mode(0),
auto_increment_increment(1),auto_increment_offset(1)
:flags2_inited(0), sql_mode_inited(0),
auto_increment_increment(1),auto_increment_offset(1), charset_inited(0)
{
db[0]= 0; /* initially, the db is unknown */
/*
Currently we only use static LAST_EVENT_INFO objects, so zeroed at
program's startup, but these explicit bzero() is for the day someone
creates dynamic instances.
*/
bzero(db, sizeof(db));
bzero(charset, sizeof(charset));
}
} LAST_EVENT_INFO;
#endif
......@@ -634,7 +643,7 @@ class Query_log_event: public Log_event
status_vars on disk is a sequence of pairs (code, value) where 'code' means
'sql_mode', 'affected' etc. Sometimes 'value' must be a short string, so
its first byte is its length. For now the order of status vars is:
flags2 - sql_mode - catalog.
flags2 - sql_mode - catalog - autoinc - charset
We should add the same thing to Load_log_event, but in fact
LOAD DATA INFILE is going to be logged with a new type of event (logging of
the plain text query), so Load_log_event would be frozen, so no need. The
......@@ -655,11 +664,13 @@ class Query_log_event: public Log_event
*/
bool flags2_inited;
bool sql_mode_inited;
bool charset_inited;
uint32 flags2;
/* In connections sql_mode is 32 bits now but will be 64 bits soon */
ulong sql_mode;
ulong auto_increment_increment, auto_increment_offset;
char charset[6];
#ifndef MYSQL_CLIENT
......
......@@ -285,6 +285,12 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
#define MODE_TRADITIONAL (MODE_ERROR_FOR_DIVISION_BY_ZERO*2)
#define MODE_NO_AUTO_CREATE_USER (MODE_TRADITIONAL*2)
#define MODE_HIGH_NOT_PRECEDENCE (MODE_NO_AUTO_CREATE_USER*2)
/*
Replication uses 8 bytes to store SQL_MODE in the binary log. The day you
use strictly more than 64 bits by adding one more define above, you should
contact the replication team because the replication code should then be
updated (to store more bytes on disk).
*/
#define RAID_BLOCK_SIZE 1024
......
......@@ -2061,9 +2061,15 @@ void sys_var_character_set_server::set_default(THD *thd, enum_var_type type)
}
}
#if defined(HAVE_REPLICATION)
#if defined(HAVE_REPLICATION) && (MYSQL_VERSION_ID < 50003)
bool sys_var_character_set_server::check(THD *thd, set_var *var)
{
/*
To be perfect we should fail even if we are a 5.0.3 slave, a 4.1 master,
and user wants to change our global character set variables. Because
replicating a 4.1 assumes those are not changed. But that's not easy to
do.
*/
if ((var->type == OPT_GLOBAL) &&
(mysql_bin_log.is_open() ||
active_mi->slave_running || active_mi->rli.slave_running))
......@@ -2168,7 +2174,7 @@ void sys_var_collation_database::set_default(THD *thd, enum_var_type type)
}
}
#if defined(HAVE_REPLICATION)
#if defined(HAVE_REPLICATION) && (MYSQL_VERSION_ID < 50003)
bool sys_var_collation_server::check(THD *thd, set_var *var)
{
if ((var->type == OPT_GLOBAL) &&
......
......@@ -564,7 +564,7 @@ class sys_var_character_set_server :public sys_var_character_set
public:
sys_var_character_set_server(const char *name_arg) :
sys_var_character_set(name_arg) {}
#if defined(HAVE_REPLICATION)
#if defined(HAVE_REPLICATION) && (MYSQL_VERSION_ID < 50003)
bool check(THD *thd, set_var *var);
#endif
void set_default(THD *thd, enum_var_type type);
......@@ -602,7 +602,7 @@ class sys_var_collation_server :public sys_var_collation
{
public:
sys_var_collation_server(const char *name_arg) :sys_var_collation(name_arg) {}
#if defined(HAVE_REPLICATION)
#if defined(HAVE_REPLICATION) && (MYSQL_VERSION_ID < 50003)
bool check(THD *thd, set_var *var);
#endif
bool update(THD *thd, set_var *var);
......
......@@ -660,13 +660,14 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
pthread_cond_t* term_cond,
volatile uint *slave_running)
{
DBUG_ENTER("terminate_slave_thread");
if (term_lock)
{
pthread_mutex_lock(term_lock);
if (!*slave_running)
{
pthread_mutex_unlock(term_lock);
return ER_SLAVE_NOT_RUNNING;
DBUG_RETURN(ER_SLAVE_NOT_RUNNING);
}
}
DBUG_ASSERT(thd != 0);
......@@ -678,6 +679,7 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
while (*slave_running) // Should always be true
{
DBUG_PRINT("loop", ("killing slave thread"));
KICK_SLAVE(thd);
/*
There is a small chance that slave thread might miss the first
......@@ -689,7 +691,7 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
}
if (term_lock)
pthread_mutex_unlock(term_lock);
return 0;
DBUG_RETURN(0);
}
......@@ -1418,13 +1420,20 @@ not always make sense; please check the manual before using it).";
values of these 2 are never used (new connections don't use them).
We don't test equality of global collation_database either as it's is
going to be deprecated (made read-only) in 4.1 very soon.
We don't do it for <3.23.57 because masters <3.23.50 hang on
SELECT @@unknown_var (BUG#7965 - see changelog of 3.23.50).
The test is only relevant if master < 5.0.3 (we'll test only if it's older
than the 5 branch; < 5.0.3 was alpha...), as >= 5.0.3 master stores
charset info in each binlog event.
We don't do it for 3.23 because masters <3.23.50 hang on
SELECT @@unknown_var (BUG#7965 - see changelog of 3.23.50). So finally we
test only if master is 4.x.
*/
if (strncmp(mi->rli.relay_log.description_event_for_queue->server_version,
"3.23.57",7) < 0)
/* redundant with rest of code but safer against later additions */
if (*mysql->server_version == '3')
goto err;
if (!mysql_real_query(mysql, "SELECT @@GLOBAL.COLLATION_SERVER", 32) &&
if ((*mysql->server_version == '4') &&
!mysql_real_query(mysql, "SELECT @@GLOBAL.COLLATION_SERVER", 32) &&
(master_res= mysql_store_result(mysql)))
{
if ((master_row= mysql_fetch_row(master_res)) &&
......@@ -1447,8 +1456,12 @@ be equal for replication to work";
such check will broke everything for them. (And now everything will
work for them because by default both their master and slave will have
'SYSTEM' time zone).
TODO: when the new replication of timezones is sorted out with Dmitri,
change >= '4' to == '4'.
*/
if (!mysql_real_query(mysql, "SELECT @@GLOBAL.TIME_ZONE", 25) &&
if ((*mysql->server_version >= '4') &&
!mysql_real_query(mysql, "SELECT @@GLOBAL.TIME_ZONE", 25) &&
(master_res= mysql_store_result(mysql)))
{
if ((master_row= mysql_fetch_row(master_res)) &&
......@@ -2527,6 +2540,7 @@ st_relay_log_info::st_relay_log_info()
bzero((char*) &info_file, sizeof(info_file));
bzero((char*) &cache_buf, sizeof(cache_buf));
cached_charset_invalidate();
pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST);
pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST);
pthread_mutex_init(&log_space_lock, MY_MUTEX_INIT_FAST);
......@@ -3078,6 +3092,24 @@ bool st_relay_log_info::is_until_satisfied()
}
void st_relay_log_info::cached_charset_invalidate()
{
/* Full of zeroes means uninitialized. */
bzero(cached_charset, sizeof(cached_charset));
}
bool st_relay_log_info::cached_charset_compare(char *charset)
{
if (bcmp(cached_charset, charset, sizeof(cached_charset)))
{
memcpy(cached_charset, charset, sizeof(cached_charset));
return 1;
}
return 0;
}
static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
{
/*
......@@ -3722,6 +3754,8 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
DBUG_PRINT("info",("Signaling possibly waiting master_pos_wait() functions"));
pthread_cond_broadcast(&rli->data_cond);
rli->ignore_log_space_limit= 0; /* don't need any lock */
/* we die so won't remember charset - re-update them on next thread start */
rli->cached_charset_invalidate();
rli->save_temporary_tables = thd->temporary_tables;
/*
......
......@@ -291,6 +291,8 @@ typedef struct st_relay_log_info
UNTIL_LOG_NAMES_CMP_UNKNOWN= -2, UNTIL_LOG_NAMES_CMP_LESS= -1,
UNTIL_LOG_NAMES_CMP_EQUAL= 0, UNTIL_LOG_NAMES_CMP_GREATER= 1
} until_log_names_cmp_result;
char cached_charset[6];
st_relay_log_info();
~st_relay_log_info();
......@@ -334,6 +336,14 @@ typedef struct st_relay_log_info
return ((until_condition == UNTIL_MASTER_POS) ? group_master_log_pos :
group_relay_log_pos);
}
/*
Last charset (6 bytes) seen by slave SQL thread is cached here; it helps
the thread save 3 get_charset() per Query_log_event if the charset is not
changing from event to event (common situation).
When the 6 bytes are equal to 0 is used to mean "cache is invalidated".
*/
void cached_charset_invalidate();
bool cached_charset_compare(char *charset);
} RELAY_LOG_INFO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment