mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
216 lines
10 KiB
Text
216 lines
10 KiB
Text
stop slave;
|
||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||
reset master;
|
||
reset slave;
|
||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||
start slave;
|
||
drop database if exists mysqltest2;
|
||
drop database if exists mysqltest3;
|
||
create database mysqltest2 character set latin2;
|
||
set @@character_set_server=latin5;
|
||
create database mysqltest3;
|
||
|
||
--- --master--
|
||
show create database mysqltest2;
|
||
Database Create Database
|
||
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
|
||
show create database mysqltest3;
|
||
Database Create Database
|
||
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
|
||
|
||
--- --slave--
|
||
show create database mysqltest2;
|
||
Database Create Database
|
||
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
|
||
show create database mysqltest3;
|
||
Database Create Database
|
||
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
|
||
set @@collation_server=armscii8_bin;
|
||
drop database mysqltest3;
|
||
create database mysqltest3;
|
||
|
||
--- --master--
|
||
show create database mysqltest3;
|
||
Database Create Database
|
||
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
|
||
|
||
--- --slave--
|
||
show create database mysqltest3;
|
||
Database Create Database
|
||
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
|
||
use mysqltest2;
|
||
create table t1 (a int auto_increment primary key, b varchar(100));
|
||
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);
|
||
insert into t1 (b) values(@@character_set_client);
|
||
insert into t1 (b) values(@@character_set_connection);
|
||
insert into t1 (b) values(@@collation_connection);
|
||
|
||
--- --master--
|
||
select * from t1 order by a;
|
||
a b
|
||
1 armscii8
|
||
2 armscii8_bin
|
||
3 cp850
|
||
4 latin2
|
||
5 latin2_croatian_ci
|
||
|
||
--- --slave--
|
||
select * from mysqltest2.t1 order by a;
|
||
a b
|
||
1 armscii8
|
||
2 armscii8_bin
|
||
3 cp850
|
||
4 latin2
|
||
5 latin2_croatian_ci
|
||
set character_set_client=latin1, collation_connection=latin1_german1_ci;
|
||
truncate table t1;
|
||
insert into t1 (b) values(@@collation_connection);
|
||
insert into t1 (b) values(LEAST("M<>ller","Muffler"));
|
||
set collation_connection=latin1_german2_ci;
|
||
insert into t1 (b) values(@@collation_connection);
|
||
insert into t1 (b) values(LEAST("M<>ller","Muffler"));
|
||
|
||
--- --master--
|
||
select * from t1 order by a;
|
||
a b
|
||
1 latin1_german1_ci
|
||
2 Muffler
|
||
3 latin1_german2_ci
|
||
4 M<>ller
|
||
|
||
--- --slave--
|
||
select * from mysqltest2.t1 order by a;
|
||
a b
|
||
1 latin1_german1_ci
|
||
2 Muffler
|
||
3 latin1_german2_ci
|
||
4 M<>ller
|
||
load data infile '../../std_data/words.dat' into table t1 (b);
|
||
set @a= _cp850 'M<>ller' collate cp850_general_ci;
|
||
truncate table t1;
|
||
insert into t1 (b) values(collation(@a));
|
||
|
||
--- --master--
|
||
select * from t1 order by a;
|
||
a b
|
||
1 cp850_general_ci
|
||
|
||
--- --slave--
|
||
select * from mysqltest2.t1 order by a;
|
||
a b
|
||
1 cp850_general_ci
|
||
drop database mysqltest2;
|
||
drop database mysqltest3;
|
||
show binlog events from 79;
|
||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||
master-bin.000001 79 Query 1 79 drop database if exists mysqltest2
|
||
master-bin.000001 154 Query 1 154 drop database if exists mysqltest3
|
||
master-bin.000001 229 Query 1 229 create database mysqltest2 character set latin2
|
||
master-bin.000001 317 Query 1 317 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30
|
||
master-bin.000001 451 Query 1 451 create database mysqltest3
|
||
master-bin.000001 518 Query 1 518 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
|
||
master-bin.000001 652 Query 1 652 drop database mysqltest3
|
||
master-bin.000001 717 Query 1 717 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
|
||
master-bin.000001 851 Query 1 851 create database mysqltest3
|
||
master-bin.000001 918 Query 1 918 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 1058 Query 1 1058 use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))
|
||
master-bin.000001 1165 Query 1 1165 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 1306 Intvar 1 1306 INSERT_ID=1
|
||
master-bin.000001 1334 Query 1 1334 use `mysqltest2`; insert into t1 (b) values(@@character_set_server)
|
||
master-bin.000001 1424 Query 1 1424 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 1565 Intvar 1 1565 INSERT_ID=2
|
||
master-bin.000001 1593 Query 1 1593 use `mysqltest2`; insert into t1 (b) values(@@collation_server)
|
||
master-bin.000001 1679 Query 1 1679 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 1820 Intvar 1 1820 INSERT_ID=3
|
||
master-bin.000001 1848 Query 1 1848 use `mysqltest2`; insert into t1 (b) values(@@character_set_client)
|
||
master-bin.000001 1938 Query 1 1938 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 2079 Intvar 1 2079 INSERT_ID=4
|
||
master-bin.000001 2107 Query 1 2107 use `mysqltest2`; insert into t1 (b) values(@@character_set_connection)
|
||
master-bin.000001 2201 Query 1 2201 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 2342 Intvar 1 2342 INSERT_ID=5
|
||
master-bin.000001 2370 Query 1 2370 use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
|
||
master-bin.000001 2460 Query 1 2460 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 2600 Query 1 2600 use `mysqltest2`; truncate table t1
|
||
master-bin.000001 2658 Query 1 2658 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 2798 Intvar 1 2798 INSERT_ID=1
|
||
master-bin.000001 2826 Query 1 2826 use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
|
||
master-bin.000001 2916 Query 1 2916 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 3056 Intvar 1 3056 INSERT_ID=2
|
||
master-bin.000001 3084 Query 1 3084 use `mysqltest2`; insert into t1 (b) values(LEAST("M<>ller","Muffler"))
|
||
master-bin.000001 3177 Query 1 3177 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 3318 Intvar 1 3318 INSERT_ID=3
|
||
master-bin.000001 3346 Query 1 3346 use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
|
||
master-bin.000001 3436 Query 1 3436 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 3577 Intvar 1 3577 INSERT_ID=4
|
||
master-bin.000001 3605 Query 1 3605 use `mysqltest2`; insert into t1 (b) values(LEAST("M<>ller","Muffler"))
|
||
master-bin.000001 3698 Query 1 3698 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 3839 Intvar 1 3839 INSERT_ID=74
|
||
master-bin.000001 3867 Create_file 1 3867 db=mysqltest2;table=t1;file_id=1;block_len=581
|
||
master-bin.000001 4540 Query 1 4540 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 4681 Intvar 1 4681 INSERT_ID=5
|
||
master-bin.000001 4709 Exec_load 1 4709 ;file_id=1
|
||
master-bin.000001 4732 Query 1 4732 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 4873 Query 1 4873 use `mysqltest2`; truncate table t1
|
||
master-bin.000001 4931 Query 1 4931 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 5072 Intvar 1 5072 INSERT_ID=1
|
||
master-bin.000001 5100 User var 1 5100 @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci
|
||
master-bin.000001 5140 Query 1 5140 use `mysqltest2`; insert into t1 (b) values(collation(@a))
|
||
master-bin.000001 5221 Query 1 5221 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 5362 Query 1 5362 drop database mysqltest2
|
||
master-bin.000001 5427 Query 1 5427 SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||
master-bin.000001 5558 Query 1 5558 drop database mysqltest3
|
||
set global character_set_server=latin2;
|
||
ERROR HY000: Binary logging and replication forbid changing the global server character set or collation
|
||
set global character_set_server=latin2;
|
||
ERROR HY000: Binary logging and replication forbid changing the global server character set or collation
|
||
set one_shot @@character_set_server=latin5;
|
||
set @@max_join_size=1000;
|
||
select @@character_set_server;
|
||
@@character_set_server
|
||
latin5
|
||
select @@character_set_server;
|
||
@@character_set_server
|
||
latin1
|
||
set @@character_set_server=latin5;
|
||
select @@character_set_server;
|
||
@@character_set_server
|
||
latin5
|
||
select @@character_set_server;
|
||
@@character_set_server
|
||
latin5
|
||
set one_shot max_join_size=10;
|
||
ERROR HY000: The SET ONE_SHOT syntax is reserved for purposes internal to the MySQL server
|
||
set character_set_client=9999999;
|
||
ERROR 42000: Unknown character set: '9999999'
|
||
set collation_server=9999998;
|
||
ERROR HY000: Unknown collation: '9999998'
|
||
use test;
|
||
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
|
||
SET CHARACTER_SET_CLIENT=koi8r,
|
||
CHARACTER_SET_CONNECTION=cp1251,
|
||
CHARACTER_SET_RESULTS=koi8r;
|
||
INSERT INTO t1 (c1, c2) VALUES ('<27><>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
||
select hex(c1), hex(c2) from t1;
|
||
hex(c1) hex(c2)
|
||
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=5847;
|
||
start slave until master_log_file='master-bin.000001', master_log_pos=5983;
|
||
start slave;
|
||
select hex(c1), hex(c2) from t1;
|
||
hex(c1) hex(c2)
|
||
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
|
||
drop table t1;
|
||
create table `t1` (
|
||
`pk` varchar(10) not null default '',
|
||
primary key (`pk`)
|
||
) engine=myisam default charset=latin1;
|
||
set @p=_latin1 'test';
|
||
update t1 set pk='test' where pk=@p;
|
||
drop table t1;
|