Commit de1dcee9 authored by unknown's avatar unknown

after merge fixes

parent 2d8b5199
...@@ -526,13 +526,102 @@ insert into t2 values (@v); ...@@ -526,13 +526,102 @@ insert into t2 values (@v);
show binlog events from 96; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 User var 1 136 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci master-bin.000001 96 User var 1 136 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
master-bin.000001 136 Query 1 219 use `test`; insert into t2 values (@v) master-bin.000001 136 Query 1 226 use `test`; insert into t2 values (@v)
flush logs; flush logs;
/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/;
SET @`v`:=_ucs2 0x006100620063 COLLATE ucs2_general_ci; SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`;
use test; use test;
SET TIMESTAMP=10000; SET TIMESTAMP=10000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0; SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t2 values (@v); insert into t2 values (@v);
drop table t2; drop table t2;
set names latin1;
create table t1 (a enum('x','y','z') character set ucs2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('x','y','z') character set ucs2 default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('x');
insert into t1 values ('y');
insert into t1 values ('z');
select a, hex(a) from t1 order by a;
a hex(a)
x 0078
y 0079
z 007A
alter table t1 change a a enum('x','y','z','d','e','','','') character set ucs2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('x','y','z','d','e','','','') character set ucs2 default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('D');
insert into t1 values ('E ');
insert into t1 values ('');
insert into t1 values ('');
insert into t1 values ('');
select a, hex(a) from t1 order by a;
a hex(a)
x 0078
y 0079
z 007A
d 0064
e 0065
00E4
00F6
00FC
drop table t1;
create table t1 (a set ('x','y','z','','','') character set ucs2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` set('x','y','z','','','') character set ucs2 default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('x');
insert into t1 values ('y');
insert into t1 values ('z');
insert into t1 values ('x,y');
insert into t1 values ('x,y,z,,,');
select a, hex(a) from t1 order by a;
a hex(a)
x 0078
y 0079
x,y 0078002C0079
z 007A
x,y,z,,, 0078002C0079002C007A002C00E4002C00F6002C00FC
drop table t1;
create table t1(a enum('a','b','c')) default character set ucs2;
insert into t1 values('a'),('b'),('c');
alter table t1 add b char(1);
show warnings;
Level Code Message
select * from t1 order by a;
a b
a NULL
b NULL
c NULL
drop table t1;
SET collation_connection='ucs2_general_ci';
create table t1 select repeat('a',4000) a;
delete from t1;
insert into t1 values ('a'), ('a '), ('a\t');
select collation(a),hex(a) from t1 order by a;
collation(a) hex(a)
ucs2_general_ci 00610009
ucs2_general_ci 0061
ucs2_general_ci 00610020
drop table t1;
SET NAMES latin1;
SET collation_connection='ucs2_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
insert into t1 values ('a'), ('a '), ('a\t');
select collation(a),hex(a) from t1 order by a;
collation(a) hex(a)
ucs2_bin 00610009
ucs2_bin 0061
ucs2_bin 00610020
drop table t1;
reset master; reset master;
create database `drop-temp+table-test`; create database `drop-temp+table-test`;
use `drop-temp+table-test`; use `drop-temp+table-test`;
create temporary table shortn1 (a int);
create temporary table `table:name` (a int); create temporary table `table:name` (a int);
create temporary table shortn2 (a int);
select get_lock("a",10); select get_lock("a",10);
get_lock("a",10) get_lock("a",10)
1 1
...@@ -10,9 +12,13 @@ get_lock("a",10) ...@@ -10,9 +12,13 @@ get_lock("a",10)
1 1
show binlog events; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 207 create database `drop-temp+table-test` master-bin.000001 # Query 1 # create database `drop-temp+table-test`
master-bin.000001 207 Query 1 323 use `drop-temp+table-test`; create temporary table `table:name` (a int) master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table shortn1 (a int)
master-bin.000001 323 Query 1 474 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name` master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table `table:name` (a int)
master-bin.000001 474 Query 1 567 use `drop-temp+table-test`; DO RELEASE_LOCK("a") master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table shortn2 (a int)
master-bin.000001 # Query 1 # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`shortn2`
master-bin.000001 # Query 1 # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name`
master-bin.000001 # Query 1 # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`shortn1`
master-bin.000001 # Query 1 # use `drop-temp+table-test`; DO RELEASE_LOCK("a")
drop database `drop-temp+table-test`; drop database `drop-temp+table-test`;
...@@ -249,6 +249,30 @@ n ...@@ -249,6 +249,30 @@ n
4 4
5 5
6 6
set autocommit=0;
begin;
savepoint `my_savepoint`;
insert into t1 values (7);
savepoint `savept2`;
insert into t1 values (3);
select n from t1;
n
3
4
5
6
7
rollback to savepoint `savept2`;
release savepoint `my_savepoint`;
select n from t1;
n
4
5
6
7
rollback to savepoint `my_savepoint`;
ERROR 42000: SAVEPOINT my_savepoint does not exist
set autocommit=1;
rollback; rollback;
drop table t1; drop table t1;
create table t1 (n int not null primary key) engine=innodb; create table t1 (n int not null primary key) engine=innodb;
...@@ -1326,8 +1350,8 @@ truncate table t1; ...@@ -1326,8 +1350,8 @@ truncate table t1;
insert into t1 (a) values (NULL),(NULL); insert into t1 (a) values (NULL),(NULL);
SELECT * from t1; SELECT * from t1;
a a
3 1
4 2
drop table t1; drop table t1;
CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB; CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB;
CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB; CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB;
...@@ -1421,19 +1445,19 @@ insert t2 select * from t1; ...@@ -1421,19 +1445,19 @@ insert t2 select * from t1;
insert t3 select * from t1; insert t3 select * from t1;
checksum table t1, t2, t3, t4 quick; checksum table t1, t2, t3, t4 quick;
Table Checksum Table Checksum
test.t1 272226711 test.t1 2948697075
test.t2 NULL test.t2 NULL
test.t3 NULL test.t3 NULL
test.t4 NULL test.t4 NULL
checksum table t1, t2, t3, t4; checksum table t1, t2, t3, t4;
Table Checksum Table Checksum
test.t1 272226711 test.t1 2948697075
test.t2 968604391 test.t2 968604391
test.t3 968604391 test.t3 968604391
test.t4 NULL test.t4 NULL
checksum table t1, t2, t3, t4 extended; checksum table t1, t2, t3, t4 extended;
Table Checksum Table Checksum
test.t1 272226711 test.t1 3092701434
test.t2 968604391 test.t2 968604391
test.t3 968604391 test.t3 968604391
test.t4 NULL test.t4 NULL
...@@ -1609,14 +1633,14 @@ t2 CREATE TABLE `t2` ( ...@@ -1609,14 +1633,14 @@ t2 CREATE TABLE `t2` (
drop table t2, t1; drop table t2, t1;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
Variable_name Value Variable_name Value
Binlog_cache_use 150 Binlog_cache_use 152
show status like "binlog_cache_disk_use"; show status like "binlog_cache_disk_use";
Variable_name Value Variable_name Value
Binlog_cache_disk_use 0 Binlog_cache_disk_use 0
create table t1 (a int) engine=innodb; create table t1 (a int) engine=innodb;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
Variable_name Value Variable_name Value
Binlog_cache_use 151 Binlog_cache_use 153
show status like "binlog_cache_disk_use"; show status like "binlog_cache_disk_use";
Variable_name Value Variable_name Value
Binlog_cache_disk_use 1 Binlog_cache_disk_use 1
...@@ -1625,7 +1649,7 @@ delete from t1; ...@@ -1625,7 +1649,7 @@ delete from t1;
commit; commit;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
Variable_name Value Variable_name Value
Binlog_cache_use 152 Binlog_cache_use 154
show status like "binlog_cache_disk_use"; show status like "binlog_cache_disk_use";
Variable_name Value Variable_name Value
Binlog_cache_disk_use 1 Binlog_cache_disk_use 1
...@@ -1690,15 +1714,90 @@ Variable_name Value ...@@ -1690,15 +1714,90 @@ Variable_name Value
Innodb_page_size 16384 Innodb_page_size 16384
show status like "Innodb_rows_deleted"; show status like "Innodb_rows_deleted";
Variable_name Value Variable_name Value
Innodb_rows_deleted 2078 Innodb_rows_deleted 2070
show status like "Innodb_rows_inserted"; show status like "Innodb_rows_inserted";
Variable_name Value Variable_name Value
Innodb_rows_inserted 31706 Innodb_rows_inserted 31708
show status like "Innodb_rows_read"; show status like "Innodb_rows_read";
Variable_name Value Variable_name Value
Innodb_rows_read 80161 Innodb_rows_read 80162
show status like "Innodb_rows_updated"; show status like "Innodb_rows_updated";
Variable_name Value Variable_name Value
Innodb_rows_updated 29530 Innodb_rows_updated 29530
show status like "Innodb_row_lock_waits";
Variable_name Value
Innodb_row_lock_waits 0
show status like "Innodb_row_lock_current_waits";
Variable_name Value
Innodb_row_lock_current_waits 0
show status like "Innodb_row_lock_time";
Variable_name Value
Innodb_row_lock_time 0
show status like "Innodb_row_lock_time_max";
Variable_name Value
Innodb_row_lock_time_max 0
show status like "Innodb_row_lock_time_avg";
Variable_name Value
Innodb_row_lock_time_avg 0
show variables like "innodb_sync_spin_loops";
Variable_name Value
innodb_sync_spin_loops 20
set global innodb_sync_spin_loops=1000;
show variables like "innodb_sync_spin_loops";
Variable_name Value
innodb_sync_spin_loops 1000
set global innodb_sync_spin_loops=0;
show variables like "innodb_sync_spin_loops";
Variable_name Value
innodb_sync_spin_loops 0
set global innodb_sync_spin_loops=20;
show variables like "innodb_sync_spin_loops";
Variable_name Value
innodb_sync_spin_loops 20
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 8
set global innodb_thread_concurrency=1000;
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 1000
set global innodb_thread_concurrency=0;
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 1
set global innodb_thread_concurrency=16;
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 16
show variables like "innodb_concurrency_tickets";
Variable_name Value
innodb_concurrency_tickets 500
set global innodb_concurrency_tickets=1000;
show variables like "innodb_concurrency_tickets";
Variable_name Value
innodb_concurrency_tickets 1000
set global innodb_concurrency_tickets=0;
show variables like "innodb_concurrency_tickets";
Variable_name Value
innodb_concurrency_tickets 1
set global innodb_concurrency_tickets=500;
show variables like "innodb_concurrency_tickets";
Variable_name Value
innodb_concurrency_tickets 500
show variables like "innodb_thread_sleep_delay";
Variable_name Value
innodb_thread_sleep_delay 10000
set global innodb_thread_sleep_delay=100000;
show variables like "innodb_thread_sleep_delay";
Variable_name Value
innodb_thread_sleep_delay 100000
set global innodb_thread_sleep_delay=0;
show variables like "innodb_thread_sleep_delay";
Variable_name Value
innodb_thread_sleep_delay 0
set global innodb_thread_sleep_delay=10000;
show variables like "innodb_thread_sleep_delay";
Variable_name Value
innodb_thread_sleep_delay 10000
create table t1 (v varchar(16384)) engine=innodb; create table t1 (v varchar(16384)) engine=innodb;
ERROR 42000: Column length too big for column 'v' (max = 255); use BLOB instead ERROR 42000: Column length too big for column 'v' (max = 255); use BLOB instead
...@@ -75,7 +75,7 @@ ERROR 23000: Duplicate entry '2' for key 1 ...@@ -75,7 +75,7 @@ ERROR 23000: Duplicate entry '2' for key 1
show binlog events; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4 master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 184 use `test`; insert into t1 select * from t2 master-bin.000001 96 Query 1 191 use `test`; insert into t1 select * from t2
select * from t1; select * from t1;
a a
1 1
...@@ -638,3 +638,15 @@ No Field Count ...@@ -638,3 +638,15 @@ No Field Count
0 1 100 0 1 100
0 2 100 0 2 100
drop table t1, t2; drop table t1, t2;
CREATE TABLE t1 (
ID int(11) NOT NULL auto_increment,
NO int(11) NOT NULL default '0',
SEQ int(11) NOT NULL default '0',
PRIMARY KEY (ID),
KEY t1$NO (SEQ,NO)
) ENGINE=MyISAM;
INSERT INTO t1 (SEQ, NO) SELECT "1" AS SEQ, IF(MAX(NO) IS NULL, 0, MAX(NO)) + 1 AS NO FROM t1 WHERE (SEQ = 1);
select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1);
ID NO SEQ
1 1 1
drop table t1;
...@@ -9,9 +9,9 @@ commit; ...@@ -9,9 +9,9 @@ commit;
show binlog events from 96; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 Query 1 # use `test`; BEGIN master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 158 Query 1 # use `test`; insert into t1 values(1) master-bin.000001 165 Query 1 # use `test`; insert into t1 values(1)
master-bin.000001 239 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 327 Xid 1 # COMMIT /* xid=7 */ master-bin.000001 348 Xid 1 # COMMIT /* xid=7 */
delete from t1; delete from t1;
delete from t2; delete from t2;
reset master; reset master;
...@@ -24,9 +24,9 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back ...@@ -24,9 +24,9 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
show binlog events from 96; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 Query 1 # use `test`; BEGIN master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 158 Query 1 # use `test`; insert into t1 values(2) master-bin.000001 165 Query 1 # use `test`; insert into t1 values(2)
master-bin.000001 239 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 327 Query 1 # use `test`; ROLLBACK master-bin.000001 348 Query 1 # use `test`; ROLLBACK
delete from t1; delete from t1;
delete from t2; delete from t2;
reset master; reset master;
...@@ -42,12 +42,12 @@ commit; ...@@ -42,12 +42,12 @@ commit;
show binlog events from 96; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 Query 1 # use `test`; BEGIN master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 158 Query 1 # use `test`; insert into t1 values(3) master-bin.000001 165 Query 1 # use `test`; insert into t1 values(3)
master-bin.000001 239 Query 1 # use `test`; savepoint my_savepoint master-bin.000001 253 Query 1 # use `test`; savepoint my_savepoint
master-bin.000001 318 Query 1 # use `test`; insert into t1 values(4) master-bin.000001 339 Query 1 # use `test`; insert into t1 values(4)
master-bin.000001 399 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 427 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 487 Query 1 # use `test`; rollback to savepoint my_savepoint master-bin.000001 522 Query 1 # use `test`; rollback to savepoint my_savepoint
master-bin.000001 578 Xid 1 # COMMIT /* xid=24 */ master-bin.000001 620 Xid 1 # COMMIT /* xid=24 */
delete from t1; delete from t1;
delete from t2; delete from t2;
reset master; reset master;
...@@ -68,13 +68,13 @@ a ...@@ -68,13 +68,13 @@ a
show binlog events from 96; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 Query 1 # use `test`; BEGIN master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 158 Query 1 # use `test`; insert into t1 values(5) master-bin.000001 165 Query 1 # use `test`; insert into t1 values(5)
master-bin.000001 239 Query 1 # use `test`; savepoint my_savepoint master-bin.000001 253 Query 1 # use `test`; savepoint my_savepoint
master-bin.000001 318 Query 1 # use `test`; insert into t1 values(6) master-bin.000001 339 Query 1 # use `test`; insert into t1 values(6)
master-bin.000001 399 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 427 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 487 Query 1 # use `test`; rollback to savepoint my_savepoint master-bin.000001 522 Query 1 # use `test`; rollback to savepoint my_savepoint
master-bin.000001 578 Query 1 # use `test`; insert into t1 values(7) master-bin.000001 620 Query 1 # use `test`; insert into t1 values(7)
master-bin.000001 659 Xid 1 # COMMIT /* xid=36 */ master-bin.000001 708 Xid 1 # COMMIT /* xid=36 */
delete from t1; delete from t1;
delete from t2; delete from t2;
reset master; reset master;
...@@ -90,10 +90,10 @@ get_lock("a",10) ...@@ -90,10 +90,10 @@ get_lock("a",10)
show binlog events from 96; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 Query 1 # use `test`; BEGIN master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 158 Query 1 # use `test`; insert into t1 values(8) master-bin.000001 165 Query 1 # use `test`; insert into t1 values(8)
master-bin.000001 239 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 327 Query 1 # use `test`; ROLLBACK master-bin.000001 348 Query 1 # use `test`; ROLLBACK
master-bin.000001 392 Query 1 # use `test`; DO RELEASE_LOCK("a") master-bin.000001 420 Query 1 # use `test`; DO RELEASE_LOCK("a")
delete from t1; delete from t1;
delete from t2; delete from t2;
reset master; reset master;
...@@ -102,9 +102,9 @@ insert into t2 select * from t1; ...@@ -102,9 +102,9 @@ insert into t2 select * from t1;
show binlog events from 96; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 Query 1 # use `test`; BEGIN master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 158 Query 1 # use `test`; insert into t1 values(9) master-bin.000001 165 Query 1 # use `test`; insert into t1 values(9)
master-bin.000001 239 Xid 1 # COMMIT /* xid=59 */ master-bin.000001 253 Xid 1 # COMMIT /* xid=59 */
master-bin.000001 266 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 280 Query 1 # use `test`; insert into t2 select * from t1
delete from t1; delete from t1;
delete from t2; delete from t2;
reset master; reset master;
...@@ -114,20 +114,20 @@ insert into t2 select * from t1; ...@@ -114,20 +114,20 @@ insert into t2 select * from t1;
show binlog events from 96; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 Query 1 # use `test`; BEGIN master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 158 Query 1 # use `test`; insert into t1 values(10) master-bin.000001 165 Query 1 # use `test`; insert into t1 values(10)
master-bin.000001 240 Xid 1 # COMMIT /* xid=65 */ master-bin.000001 254 Xid 1 # COMMIT /* xid=65 */
master-bin.000001 267 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 281 Query 1 # use `test`; insert into t2 select * from t1
insert into t1 values(11); insert into t1 values(11);
commit; commit;
show binlog events from 96; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 Query 1 # use `test`; BEGIN master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 158 Query 1 # use `test`; insert into t1 values(10) master-bin.000001 165 Query 1 # use `test`; insert into t1 values(10)
master-bin.000001 240 Xid 1 # COMMIT /* xid=65 */ master-bin.000001 254 Xid 1 # COMMIT /* xid=65 */
master-bin.000001 267 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 281 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 355 Query 1 # use `test`; BEGIN master-bin.000001 376 Query 1 # use `test`; BEGIN
master-bin.000001 417 Query 1 # use `test`; insert into t1 values(11) master-bin.000001 445 Query 1 # use `test`; insert into t1 values(11)
master-bin.000001 499 Xid 1 # COMMIT /* xid=67 */ master-bin.000001 534 Xid 1 # COMMIT /* xid=67 */
alter table t2 engine=INNODB; alter table t2 engine=INNODB;
delete from t1; delete from t1;
delete from t2; delete from t2;
...@@ -139,9 +139,9 @@ commit; ...@@ -139,9 +139,9 @@ commit;
show binlog events from 96; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 Query 1 # use `test`; BEGIN master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 158 Query 1 # use `test`; insert into t1 values(12) master-bin.000001 165 Query 1 # use `test`; insert into t1 values(12)
master-bin.000001 240 Query 1 # use `test`; insert into t2 select * from t1 master-bin.000001 254 Query 1 # use `test`; insert into t2 select * from t1
master-bin.000001 328 Xid 1 # COMMIT /* xid=77 */ master-bin.000001 349 Xid 1 # COMMIT /* xid=77 */
delete from t1; delete from t1;
delete from t2; delete from t2;
reset master; reset master;
...@@ -164,8 +164,8 @@ commit; ...@@ -164,8 +164,8 @@ commit;
show binlog events from 96; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 Query 1 # use `test`; BEGIN master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 158 Query 1 # use `test`; insert into t1 values(14) master-bin.000001 165 Query 1 # use `test`; insert into t1 values(14)
master-bin.000001 240 Xid 1 # COMMIT /* xid=93 */ master-bin.000001 254 Xid 1 # COMMIT /* xid=93 */
delete from t1; delete from t1;
delete from t2; delete from t2;
reset master; reset master;
...@@ -184,9 +184,9 @@ a ...@@ -184,9 +184,9 @@ a
show binlog events from 96; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 Query 1 # use `test`; BEGIN master-bin.000001 96 Query 1 # use `test`; BEGIN
master-bin.000001 158 Query 1 # use `test`; insert into t1 values(16) master-bin.000001 165 Query 1 # use `test`; insert into t1 values(16)
master-bin.000001 240 Query 1 # use `test`; insert into t1 values(18) master-bin.000001 254 Query 1 # use `test`; insert into t1 values(18)
master-bin.000001 322 Xid 1 # COMMIT /* xid=104 */ master-bin.000001 343 Xid 1 # COMMIT /* xid=104 */
delete from t1; delete from t1;
delete from t2; delete from t2;
alter table t2 type=MyISAM; alter table t2 type=MyISAM;
......
...@@ -108,8 +108,10 @@ insert into t1 values ("Alas"); ...@@ -108,8 +108,10 @@ insert into t1 values ("Alas");
use test; use test;
SET TIMESTAMP=1065204671; SET TIMESTAMP=1065204671;
BEGIN; BEGIN;
ROLLBACK;
/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/;
use test; use test;
SET TIMESTAMP=1065204671; SET TIMESTAMP=1065204671;
BEGIN; BEGIN;
ROLLBACK;
drop table t1, t2; drop table t1, t2;
...@@ -16,11 +16,11 @@ n ...@@ -16,11 +16,11 @@ n
1 1
show slave status; 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 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 356 # # master-bin.000001 No No 0 0 275 # None 0 No # # 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 377 # # master-bin.000001 No No 0 0 289 # None 0 No #
change master to master_user='root'; change master to master_user='root';
show slave status; 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 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 275 # # master-bin.000001 No No 0 0 275 # None 0 No # # 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 289 # # master-bin.000001 No No 0 0 289 # None 0 No #
select release_lock("a"); select release_lock("a");
release_lock("a") release_lock("a")
1 1
......
...@@ -4,6 +4,7 @@ reset master; ...@@ -4,6 +4,7 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
set timestamp=1000000000;
drop database if exists mysqltest2; drop database if exists mysqltest2;
drop database if exists mysqltest3; drop database if exists mysqltest3;
create database mysqltest2 character set latin2; create database mysqltest2 character set latin2;
...@@ -87,7 +88,6 @@ a b ...@@ -87,7 +88,6 @@ a b
2 Muffler 2 Muffler
3 latin1_german2_ci 3 latin1_german2_ci
4 Mller 4 Mller
load data infile '../../std_data/words.dat' into table t1 (b);
set @a= _cp850 'Mller' collate cp850_general_ci; set @a= _cp850 'Mller' collate cp850_general_ci;
truncate table t1; truncate table t1;
insert into t1 (b) values(collation(@a)); insert into t1 (b) values(collation(@a));
...@@ -108,63 +108,39 @@ Log_name Pos Event_type Server_id End_log_pos Info ...@@ -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 mysqltest2
master-bin.000001 # Query 1 # drop database if exists mysqltest3 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 # 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 # 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 # 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 # 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`; 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 # 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`; 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 # 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`; 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 # 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`; 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 # 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`; 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 # 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`; 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`; 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 # 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`; 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 # 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`; 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 # 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`; 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 # 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`; 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`; 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 # Intvar 1 # INSERT_ID=1
master-bin.000001 # User var 1 # @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci 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`; 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 # 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 master-bin.000001 # Query 1 # drop database mysqltest3
set global character_set_server=latin2; 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; 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 one_shot @@character_set_server=latin5;
set @@max_join_size=1000; set @@max_join_size=1000;
select @@character_set_server; select @@character_set_server;
...@@ -198,12 +174,75 @@ CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 ...@@ -198,12 +174,75 @@ CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
select hex(c1), hex(c2) from t1; select hex(c1), hex(c2) from t1;
hex(c1) hex(c2) hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
stop slave; /*!40019 SET @@session.max_insert_delayed_threads=0*/;
delete from t1; SET TIMESTAMP=1000000000;
change master to master_log_pos=6810; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
start slave until master_log_file='master-bin.000001', master_log_pos=6968; SET @@session.sql_mode=0;
start slave; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
select hex(c1), hex(c2) from t1; drop database if exists mysqltest2;
hex(c1) hex(c2) SET TIMESTAMP=1000000000;
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 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 (', ',', ');
ROLLBACK;
drop table t1; drop table t1;
...@@ -9,7 +9,7 @@ insert into t1 values (1),(1); ...@@ -9,7 +9,7 @@ insert into t1 values (1),(1);
ERROR 23000: Duplicate entry '1' for key 1 ERROR 23000: Duplicate entry '1' for key 1
show slave status; 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 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 274 # # master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 274 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 288 # # master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 288 # None 0 No #
show tables like 't1'; show tables like 't1';
Tables_in_test (t1) Tables_in_test (t1)
drop table t1; drop table t1;
...@@ -28,12 +28,12 @@ kill @id; ...@@ -28,12 +28,12 @@ kill @id;
drop table t2,t3; drop table t2,t3;
show binlog events from 96; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 Query 1 188 use `test`; create table t1 (a int primary key) master-bin.000001 96 Query 1 195 use `test`; create table t1 (a int primary key)
master-bin.000001 188 Query 1 274 use `test`; insert into t1 values (1),(1) master-bin.000001 195 Query 1 288 use `test`; insert into t1 values (1),(1)
master-bin.000001 274 Query 1 344 use `test`; drop table t1 master-bin.000001 288 Query 1 365 use `test`; drop table t1
master-bin.000001 344 Query 1 436 use `test`; create table t2 (a int primary key) master-bin.000001 365 Query 1 464 use `test`; create table t2 (a int primary key)
master-bin.000001 436 Query 1 517 use `test`; insert into t2 values(1) master-bin.000001 464 Query 1 552 use `test`; insert into t2 values(1)
master-bin.000001 517 Query 1 598 use `test`; create table t3 (id int) master-bin.000001 552 Query 1 640 use `test`; create table t3 (id int)
master-bin.000001 598 Query 1 693 use `test`; insert into t3 values(connection_id()) master-bin.000001 640 Query 1 742 use `test`; insert into t3 values(connection_id())
master-bin.000001 693 Query 1 806 use `test`; update t2 set a = a + 1 + get_lock('crash_lock%20C', 10) master-bin.000001 742 Query 1 862 use `test`; update t2 set a = a + 1 + get_lock('crash_lock%20C', 10)
master-bin.000001 806 Query 1 879 use `test`; drop table t2,t3 master-bin.000001 862 Query 1 942 use `test`; drop table t2,t3
...@@ -14,4 +14,4 @@ start slave; ...@@ -14,4 +14,4 @@ start slave;
flush logs; flush logs;
show slave status; 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 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 200 # # slave-bin.000001 Yes Yes 0 0 200 # None 0 No # # 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 207 # # slave-bin.000001 Yes Yes 0 0 207 # None 0 No #
...@@ -15,26 +15,26 @@ flush no_write_to_binlog tables; ...@@ -15,26 +15,26 @@ flush no_write_to_binlog tables;
show binlog events; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 96 Server ver: SERVER_VERSION, Binlog ver: 4 master-bin.000001 4 Format_desc 1 96 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 176 use `test`; create table t1 (a int) master-bin.000001 96 Query 1 183 use `test`; create table t1 (a int)
master-bin.000001 176 Query 1 259 use `test`; insert into t1 values (10) master-bin.000001 183 Query 1 273 use `test`; insert into t1 values (10)
master-bin.000001 259 Query 1 339 use `test`; create table t2 (a int) master-bin.000001 273 Query 1 360 use `test`; create table t2 (a int)
master-bin.000001 339 Query 1 442 use `test`; create table t3 (a int) engine=merge union(t1) master-bin.000001 360 Query 1 470 use `test`; create table t3 (a int) engine=merge union(t1)
master-bin.000001 442 Query 1 522 use `test`; create table t4 (a int) master-bin.000001 470 Query 1 557 use `test`; create table t4 (a int)
master-bin.000001 522 Query 1 610 use `test`; insert into t4 select * from t3 master-bin.000001 557 Query 1 652 use `test`; insert into t4 select * from t3
master-bin.000001 610 Query 1 698 use `test`; rename table t1 to t5, t2 to t1 master-bin.000001 652 Query 1 747 use `test`; rename table t1 to t5, t2 to t1
select * from t3; select * from t3;
a a
flush tables; flush tables;
show binlog events; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 96 Server ver: SERVER_VERSION, Binlog ver: 4 master-bin.000001 4 Format_desc 1 96 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 176 use `test`; create table t1 (a int) master-bin.000001 96 Query 1 183 use `test`; create table t1 (a int)
master-bin.000001 176 Query 1 259 use `test`; insert into t1 values (10) master-bin.000001 183 Query 1 273 use `test`; insert into t1 values (10)
master-bin.000001 259 Query 1 339 use `test`; create table t2 (a int) master-bin.000001 273 Query 1 360 use `test`; create table t2 (a int)
master-bin.000001 339 Query 1 442 use `test`; create table t3 (a int) engine=merge union(t1) master-bin.000001 360 Query 1 470 use `test`; create table t3 (a int) engine=merge union(t1)
master-bin.000001 442 Query 1 522 use `test`; create table t4 (a int) master-bin.000001 470 Query 1 557 use `test`; create table t4 (a int)
master-bin.000001 522 Query 1 610 use `test`; insert into t4 select * from t3 master-bin.000001 557 Query 1 652 use `test`; insert into t4 select * from t3
master-bin.000001 610 Query 1 698 use `test`; rename table t1 to t5, t2 to t1 master-bin.000001 652 Query 1 747 use `test`; rename table t1 to t5, t2 to t1
master-bin.000001 698 Query 1 767 use `test`; flush tables master-bin.000001 747 Query 1 823 use `test`; flush tables
select * from t3; select * from t3;
a a
...@@ -22,7 +22,7 @@ day id category name ...@@ -22,7 +22,7 @@ day id category name
2003-03-22 2416 a bbbbb 2003-03-22 2416 a bbbbb
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
slave-bin.000001 1069 slave-bin.000001 1097
drop table t1; drop table t1;
drop table t2; drop table t2;
drop table t3; drop table t3;
...@@ -33,7 +33,7 @@ set global sql_slave_skip_counter=1; ...@@ -33,7 +33,7 @@ set global sql_slave_skip_counter=1;
start slave; start slave;
show slave status; 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 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 1504 # # master-bin.000001 Yes Yes 0 0 1504 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1560 # # master-bin.000001 Yes Yes 0 0 1560 # None 0 No #
set sql_log_bin=0; set sql_log_bin=0;
delete from t1; delete from t1;
set sql_log_bin=1; set sql_log_bin=1;
...@@ -43,7 +43,7 @@ change master to master_user='test'; ...@@ -43,7 +43,7 @@ change master to master_user='test';
change master to master_user='root'; change master to master_user='root';
show slave status; 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 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 1612 # # master-bin.000001 No No 0 0 1612 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1668 # # master-bin.000001 No No 0 0 1668 # None 0 No #
set global sql_slave_skip_counter=1; set global sql_slave_skip_counter=1;
start slave; start slave;
set sql_log_bin=0; set sql_log_bin=0;
...@@ -64,5 +64,5 @@ terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by ...@@ -64,5 +64,5 @@ terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
ERROR 23000: Duplicate entry '2003-03-22' for key 1 ERROR 23000: Duplicate entry '2003-03-22' for key 1
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 530 master-bin.000001 537
drop table t2; drop table t2;
...@@ -12,6 +12,6 @@ use mysqltest; ...@@ -12,6 +12,6 @@ use mysqltest;
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
show binlog events from 96; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 Query 1 191 drop database if exists mysqltest master-bin.000001 96 Query 1 198 drop database if exists mysqltest
master-bin.000001 191 Query 1 278 create database mysqltest master-bin.000001 198 Query 1 292 create database mysqltest
drop database mysqltest; drop database mysqltest;
...@@ -20,24 +20,24 @@ drop table t1; ...@@ -20,24 +20,24 @@ drop table t1;
show binlog events; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4 master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 211 use `test`; create table t1(n int not null auto_increment primary key) master-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 211 Intvar 1 239 INSERT_ID=1 master-bin.000001 218 Intvar 1 246 INSERT_ID=1
master-bin.000001 239 Query 1 324 use `test`; insert into t1 values (NULL) master-bin.000001 246 Query 1 338 use `test`; insert into t1 values (NULL)
master-bin.000001 324 Query 1 394 use `test`; drop table t1 master-bin.000001 338 Query 1 415 use `test`; drop table t1
master-bin.000001 394 Query 1 491 use `test`; create table t1 (word char(20) not null) master-bin.000001 415 Query 1 519 use `test`; create table t1 (word char(20) not null)
master-bin.000001 491 Create_file 1 1161 db=test;table=t1;file_id=1;block_len=581 master-bin.000001 519 Create_file 1 1189 db=test;table=t1;file_id=1;block_len=581
master-bin.000001 1161 Exec_load 1 1184 ;file_id=1 master-bin.000001 1189 Exec_load 1 1212 ;file_id=1
master-bin.000001 1184 Query 1 1254 use `test`; drop table t1 master-bin.000001 1212 Query 1 1289 use `test`; drop table t1
show binlog events from 96 limit 1; show binlog events from 96 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 Query 1 211 use `test`; create table t1(n int not null auto_increment primary key) master-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
show binlog events from 96 limit 2; show binlog events from 96 limit 2;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 Query 1 211 use `test`; create table t1(n int not null auto_increment primary key) master-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 211 Intvar 1 239 INSERT_ID=1 master-bin.000001 218 Intvar 1 246 INSERT_ID=1
show binlog events from 96 limit 2,1; show binlog events from 96 limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 239 Query 1 324 use `test`; insert into t1 values (NULL) master-bin.000001 246 Query 1 338 use `test`; insert into t1 values (NULL)
flush logs; flush logs;
create table t5 (a int); create table t5 (a int);
drop table t5; drop table t5;
...@@ -50,23 +50,23 @@ drop table t1; ...@@ -50,23 +50,23 @@ drop table t1;
show binlog events; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4 master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 211 use `test`; create table t1(n int not null auto_increment primary key) master-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 211 Intvar 1 239 INSERT_ID=1 master-bin.000001 218 Intvar 1 246 INSERT_ID=1
master-bin.000001 239 Query 1 324 use `test`; insert into t1 values (NULL) master-bin.000001 246 Query 1 338 use `test`; insert into t1 values (NULL)
master-bin.000001 324 Query 1 394 use `test`; drop table t1 master-bin.000001 338 Query 1 415 use `test`; drop table t1
master-bin.000001 394 Query 1 491 use `test`; create table t1 (word char(20) not null) master-bin.000001 415 Query 1 519 use `test`; create table t1 (word char(20) not null)
master-bin.000001 491 Create_file 1 1161 db=test;table=t1;file_id=1;block_len=581 master-bin.000001 519 Create_file 1 1189 db=test;table=t1;file_id=1;block_len=581
master-bin.000001 1161 Exec_load 1 1184 ;file_id=1 master-bin.000001 1189 Exec_load 1 1212 ;file_id=1
master-bin.000001 1184 Query 1 1254 use `test`; drop table t1 master-bin.000001 1212 Query 1 1289 use `test`; drop table t1
master-bin.000001 1254 Rotate 1 1298 master-bin.000002;pos=4 master-bin.000001 1289 Rotate 1 1333 master-bin.000002;pos=4
show binlog events in 'master-bin.000002'; show binlog events in 'master-bin.000002';
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4 master-bin.000002 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
master-bin.000002 96 Query 1 176 use `test`; create table t5 (a int) master-bin.000002 96 Query 1 183 use `test`; create table t5 (a int)
master-bin.000002 176 Query 1 246 use `test`; drop table t5 master-bin.000002 183 Query 1 260 use `test`; drop table t5
master-bin.000002 246 Query 1 326 use `test`; create table t1 (n int) master-bin.000002 260 Query 1 347 use `test`; create table t1 (n int)
master-bin.000002 326 Query 1 408 use `test`; insert into t1 values (1) master-bin.000002 347 Query 1 436 use `test`; insert into t1 values (1)
master-bin.000002 408 Query 1 478 use `test`; drop table t1 master-bin.000002 436 Query 1 513 use `test`; drop table t1
show binary logs; show binary logs;
Log_name Log_name
master-bin.000001 master-bin.000001
...@@ -79,25 +79,25 @@ slave-bin.000002 ...@@ -79,25 +79,25 @@ slave-bin.000002
show binlog events in 'slave-bin.000001' from 4; show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 4 Format_desc 2 96 Server ver: VERSION, Binlog ver: 4 slave-bin.000001 4 Format_desc 2 96 Server ver: VERSION, Binlog ver: 4
slave-bin.000001 96 Query 1 211 use `test`; create table t1(n int not null auto_increment primary key) slave-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
slave-bin.000001 211 Intvar 1 239 INSERT_ID=1 slave-bin.000001 218 Intvar 1 246 INSERT_ID=1
slave-bin.000001 239 Query 1 324 use `test`; insert into t1 values (NULL) slave-bin.000001 246 Query 1 338 use `test`; insert into t1 values (NULL)
slave-bin.000001 324 Query 1 394 use `test`; drop table t1 slave-bin.000001 338 Query 1 415 use `test`; drop table t1
slave-bin.000001 394 Query 1 491 use `test`; create table t1 (word char(20) not null) slave-bin.000001 415 Query 1 519 use `test`; create table t1 (word char(20) not null)
slave-bin.000001 491 Create_file 1 1170 db=test;table=t1;file_id=1;block_len=581 slave-bin.000001 519 Create_file 1 1198 db=test;table=t1;file_id=1;block_len=581
slave-bin.000001 1170 Exec_load 1 1193 ;file_id=1 slave-bin.000001 1198 Exec_load 1 1221 ;file_id=1
slave-bin.000001 1193 Query 1 1263 use `test`; drop table t1 slave-bin.000001 1221 Query 1 1298 use `test`; drop table t1
slave-bin.000001 1263 Query 1 1343 use `test`; create table t5 (a int) slave-bin.000001 1298 Query 1 1385 use `test`; create table t5 (a int)
slave-bin.000001 1343 Query 1 1413 use `test`; drop table t5 slave-bin.000001 1385 Query 1 1462 use `test`; drop table t5
slave-bin.000001 1413 Rotate 2 1456 slave-bin.000002;pos=4 slave-bin.000001 1462 Rotate 2 1505 slave-bin.000002;pos=4
show binlog events in 'slave-bin.000002' from 4; show binlog events in 'slave-bin.000002' from 4;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000002 4 Format_desc 2 96 Server ver: VERSION, Binlog ver: 4 slave-bin.000002 4 Format_desc 2 96 Server ver: VERSION, Binlog ver: 4
slave-bin.000002 96 Query 1 176 use `test`; create table t1 (n int) slave-bin.000002 96 Query 1 183 use `test`; create table t1 (n int)
slave-bin.000002 176 Query 1 258 use `test`; insert into t1 values (1) slave-bin.000002 183 Query 1 272 use `test`; insert into t1 values (1)
slave-bin.000002 258 Query 1 328 use `test`; drop table t1 slave-bin.000002 272 Query 1 349 use `test`; drop table t1
show slave status; 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 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 478 # # master-bin.000002 Yes Yes 0 0 478 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000002 513 # # master-bin.000002 Yes Yes 0 0 513 # None 0 No #
show binlog events in 'slave-bin.000005' from 4; show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
...@@ -16,7 +16,7 @@ select @@global.max_relay_log_size; ...@@ -16,7 +16,7 @@ select @@global.max_relay_log_size;
start slave; start slave;
show slave status; 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 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 68138 # # master-bin.000001 Yes Yes 0 0 68138 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73752 # # master-bin.000001 Yes Yes 0 0 73752 # None 0 No #
stop slave; stop slave;
reset slave; reset slave;
set global max_relay_log_size=(5*4096); set global max_relay_log_size=(5*4096);
...@@ -26,7 +26,7 @@ select @@global.max_relay_log_size; ...@@ -26,7 +26,7 @@ select @@global.max_relay_log_size;
start slave; start slave;
show slave status; 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 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 68138 # # master-bin.000001 Yes Yes 0 0 68138 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73752 # # master-bin.000001 Yes Yes 0 0 73752 # None 0 No #
stop slave; stop slave;
reset slave; reset slave;
set global max_relay_log_size=0; set global max_relay_log_size=0;
...@@ -36,7 +36,7 @@ select @@global.max_relay_log_size; ...@@ -36,7 +36,7 @@ select @@global.max_relay_log_size;
start slave; start slave;
show slave status; 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 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 68138 # # master-bin.000001 Yes Yes 0 0 68138 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73752 # # master-bin.000001 Yes Yes 0 0 73752 # None 0 No #
stop slave; stop slave;
reset slave; reset slave;
flush logs; flush logs;
...@@ -49,12 +49,12 @@ flush logs; ...@@ -49,12 +49,12 @@ flush logs;
create table t1 (a int); create table t1 (a int);
show slave status; 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 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 68218 # # master-bin.000001 Yes Yes 0 0 68218 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73839 # # master-bin.000001 Yes Yes 0 0 73839 # None 0 No #
flush logs; flush logs;
drop table t1; drop table t1;
show slave status; 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 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 68288 # # master-bin.000001 Yes Yes 0 0 68288 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73916 # # master-bin.000001 Yes Yes 0 0 73916 # None 0 No #
flush logs; flush logs;
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
......
...@@ -18,5 +18,5 @@ max(a) ...@@ -18,5 +18,5 @@ max(a)
8000 8000
show slave status; 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 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 687172 # # master-bin.000001 Yes Yes 0 0 687172 # None 0 No # # 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 743186 # # master-bin.000001 Yes Yes 0 0 743186 # None 0 No #
drop table t1; drop table t1;
...@@ -28,4 +28,4 @@ ERROR 42S02: Table 'test.t11' doesn't exist ...@@ -28,4 +28,4 @@ ERROR 42S02: Table 'test.t11' doesn't exist
drop table if exists t1,t2,t11; drop table if exists t1,t2,t11;
show slave status; 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 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 1555 # # master-bin.000001 Yes Yes test.t1 0 0 1555 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1618 # # master-bin.000001 Yes Yes test.t1 0 0 1618 # None 0 No #
drop table if exists t1, t2, t3, t4; drop table if exists t1, t2, t3, t4;
drop table if exists t1, t2, t3, t4; drop table if exists t1, t2, t3, t4;
start slave; start slave;
ERROR HY000: File 'TESTDIR/var/slave-data/master.info' not found (Errcode: 13) Got one of the listed errors
start slave; start slave;
ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
...@@ -16,7 +16,7 @@ create table t1 (s text); ...@@ -16,7 +16,7 @@ create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard'); insert into t1 values('Could not break slave'),('Tried hard');
show slave status; 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 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 522 # # master-bin.000001 Yes Yes 0 0 522 # None 0 No # # 127.0.0.1 root MASTER_PORT 60 master-bin.000001 550 # # master-bin.000001 Yes Yes 0 0 550 # None 0 No #
select * from t1; select * from t1;
s s
Could not break slave Could not break slave
...@@ -57,7 +57,7 @@ master-bin.000003 ...@@ -57,7 +57,7 @@ master-bin.000003
insert into t2 values (65); insert into t2 values (65);
show slave status; 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 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 470 # # master-bin.000003 Yes Yes 0 0 470 # None 0 No # # 127.0.0.1 root MASTER_PORT 60 master-bin.000003 498 # # master-bin.000003 Yes Yes 0 0 498 # None 0 No #
select * from t2; select * from t2;
m m
34 34
...@@ -79,13 +79,13 @@ master-bin.000004 ...@@ -79,13 +79,13 @@ master-bin.000004
master-bin.000005 master-bin.000005
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000005 1388 master-bin.000005 2051
select * from t4; select * from t4;
a a
testing temporary tables part 2 testing temporary tables part 2
show slave status; 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 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 1388 # # master-bin.000005 Yes Yes 0 0 1388 # None 0 No # # 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2051 # # master-bin.000005 Yes Yes 0 0 2051 # None 0 No #
lock tables t3 read; lock tables t3 read;
select count(*) from t3 where n >= 4; select count(*) from t3 where n >= 4;
count(*) count(*)
......
...@@ -39,18 +39,18 @@ f ...@@ -39,18 +39,18 @@ f
show binlog events; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4 master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 179 use `test`; drop table if exists t1,t2 master-bin.000001 96 Query 1 186 use `test`; drop table if exists t1,t2
master-bin.000001 179 Query 1 258 use `test`; create table t1(f int) master-bin.000001 186 Query 1 272 use `test`; create table t1(f int)
master-bin.000001 258 Query 1 337 use `test`; create table t2(f int) master-bin.000001 272 Query 1 358 use `test`; create table t2(f int)
master-bin.000001 337 Query 1 456 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10) master-bin.000001 358 Query 1 484 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)
master-bin.000001 456 Query 1 545 use `test`; create temporary table t3(f int) master-bin.000001 484 Query 1 580 use `test`; create temporary table t3(f int)
master-bin.000001 545 Query 1 643 use `test`; insert into t3 select * from t1 where f<6 master-bin.000001 580 Query 1 685 use `test`; insert into t3 select * from t1 where f<6
master-bin.000001 643 Query 1 732 use `test`; create temporary table t3(f int) master-bin.000001 685 Query 1 781 use `test`; create temporary table t3(f int)
master-bin.000001 732 Query 1 827 use `test`; insert into t2 select count(*) from t3 master-bin.000001 781 Query 1 883 use `test`; insert into t2 select count(*) from t3
master-bin.000001 827 Query 1 926 use `test`; insert into t3 select * from t1 where f>=4 master-bin.000001 883 Query 1 989 use `test`; insert into t3 select * from t1 where f>=4
master-bin.000001 926 Query 1 1006 use `test`; drop temporary table t3 master-bin.000001 989 Query 1 1076 use `test`; drop temporary table t3
master-bin.000001 1006 Query 1 1101 use `test`; insert into t2 select count(*) from t3 master-bin.000001 1076 Query 1 1178 use `test`; insert into t2 select count(*) from t3
master-bin.000001 1101 Query 1 1181 use `test`; drop temporary table t3 master-bin.000001 1178 Query 1 1265 use `test`; drop temporary table t3
drop table t1, t2; drop table t1, t2;
use test; use test;
SET TIMESTAMP=1040323920; SET TIMESTAMP=1040323920;
......
...@@ -33,12 +33,12 @@ t ...@@ -33,12 +33,12 @@ t
show binlog events; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4 master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 182 use `test`; create table t1 (t timestamp) master-bin.000001 96 Query 1 189 use `test`; create table t1 (t timestamp)
master-bin.000001 182 Query 1 267 use `test`; create table t2 (t char(32)) master-bin.000001 189 Query 1 281 use `test`; create table t2 (t char(32))
master-bin.000001 267 Query 1 352 use `test`; SET ONE_SHOT TIME_ZONE='UTC' master-bin.000001 281 Query 1 373 use `test`; SET ONE_SHOT TIME_ZONE='UTC'
master-bin.000001 352 Query 1 469 use `test`; insert into t1 values ('20040101000000'), ('20040611093902') master-bin.000001 373 Query 1 497 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
master-bin.000001 469 Query 1 540 use `test`; delete from t1 master-bin.000001 497 Query 1 575 use `test`; delete from t1
master-bin.000001 540 Query 1 657 use `test`; insert into t1 values ('20040101000000'), ('20040611093902') master-bin.000001 575 Query 1 699 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
set time_zone='MET'; set time_zone='MET';
insert into t2 (select t from t1); insert into t2 (select t from t1);
select * from t1; select * from t1;
......
...@@ -15,13 +15,13 @@ drop table t2; ...@@ -15,13 +15,13 @@ drop table t2;
show binlog events; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4 master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
master-bin.000001 96 Query 1 211 use `test`; create table t1(n int not null auto_increment primary key) master-bin.000001 96 Query 1 218 use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 211 Query 1 305 use `test`; insert into t1 values (1),(2),(3),(4) master-bin.000001 218 Query 1 319 use `test`; insert into t1 values (1),(2),(3),(4)
master-bin.000001 305 Query 1 375 use `test`; drop table t1 master-bin.000001 319 Query 1 396 use `test`; drop table t1
master-bin.000001 375 Query 1 490 use `test`; create table t2(n int not null auto_increment primary key) master-bin.000001 396 Query 1 518 use `test`; create table t2(n int not null auto_increment primary key)
master-bin.000001 490 Query 1 576 use `test`; insert into t2 values (1),(2) master-bin.000001 518 Query 1 611 use `test`; insert into t2 values (1),(2)
master-bin.000001 576 Query 1 662 use `test`; insert into t2 values (3),(4) master-bin.000001 611 Query 1 704 use `test`; insert into t2 values (3),(4)
master-bin.000001 662 Query 1 732 use `test`; drop table t2 master-bin.000001 704 Query 1 781 use `test`; drop table t2
start slave until master_log_file='master-bin.000001', master_log_pos=304; start slave until master_log_file='master-bin.000001', master_log_pos=304;
select * from t1; select * from t1;
n n
...@@ -31,7 +31,7 @@ n ...@@ -31,7 +31,7 @@ n
4 4
show slave status; 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 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 732 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 305 # Master master-bin.000001 304 No # # 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 781 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 319 # Master master-bin.000001 304 No #
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
select * from t1; select * from t1;
n n
...@@ -41,7 +41,7 @@ n ...@@ -41,7 +41,7 @@ n
4 4
show slave status; 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 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 732 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 305 # Master master-no-such-bin.000001 291 No # # 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 781 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 319 # Master master-no-such-bin.000001 291 No #
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=710; start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=710;
select * from t2; select * from t2;
n n
...@@ -49,13 +49,13 @@ n ...@@ -49,13 +49,13 @@ n
2 2
show slave status; 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 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 732 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 576 # Relay slave-relay-bin.000004 710 No # # 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 781 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 611 # Relay slave-relay-bin.000004 710 No #
start slave; start slave;
stop slave; stop slave;
start slave until master_log_file='master-bin.000001', master_log_pos=710; start slave until master_log_file='master-bin.000001', master_log_pos=710;
show slave status; 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 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 732 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 732 # Master master-bin.000001 710 No # # 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 781 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 781 # Master master-bin.000001 710 No #
start slave until master_log_file='master-bin', master_log_pos=561; start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL 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; start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
......
...@@ -76,34 +76,35 @@ abcn1n2 ...@@ -76,34 +76,35 @@ abcn1n2
NULL NULL
NULL NULL
NULL NULL
show binlog events from 180; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 180 User var 2 223 @`i1`=12345678901234 slave-bin.000001 96 Query 1 187 use `test`; create table t1(n char(30))
slave-bin.000001 223 User var 2 266 @`i2`=-12345678901234 slave-bin.000001 187 User var 2 230 @`i1`=12345678901234
slave-bin.000001 266 User var 2 309 @`i3`=0 slave-bin.000001 230 User var 2 273 @`i2`=-12345678901234
slave-bin.000001 309 User var 2 352 @`i4`=-1 slave-bin.000001 273 User var 2 316 @`i3`=0
slave-bin.000001 352 Query 1 457 use `test`; insert into t1 values (@i1), (@i2), (@i3), (@i4) slave-bin.000001 316 User var 2 359 @`i4`=-1
slave-bin.000001 457 User var 2 500 @`r1`=12.5 slave-bin.000001 359 Query 1 471 use `test`; insert into t1 values (@i1), (@i2), (@i3), (@i4)
slave-bin.000001 500 User var 2 543 @`r2`=-12.5 slave-bin.000001 471 User var 2 510 @`r1`=12.5
slave-bin.000001 543 Query 1 634 use `test`; insert into t1 values (@r1), (@r2) slave-bin.000001 510 User var 2 549 @`r2`=-12.5
slave-bin.000001 634 User var 2 683 @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci slave-bin.000001 549 Query 1 647 use `test`; insert into t1 values (@r1), (@r2)
slave-bin.000001 683 User var 2 718 @`s2`=_latin1 "" COLLATE latin1_swedish_ci slave-bin.000001 647 User var 2 696 @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci
slave-bin.000001 718 User var 2 760 @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci slave-bin.000001 696 User var 2 731 @`s2`=_latin1 "" COLLATE latin1_swedish_ci
slave-bin.000001 760 User var 2 802 @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci slave-bin.000001 731 User var 2 773 @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
slave-bin.000001 802 User var 2 844 @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci slave-bin.000001 773 User var 2 815 @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci
slave-bin.000001 844 Query 1 956 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5) slave-bin.000001 815 User var 2 857 @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
slave-bin.000001 956 User var 2 982 @`n1`=NULL slave-bin.000001 857 Query 1 976 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5)
slave-bin.000001 982 Query 1 1066 use `test`; insert into t1 values (@n1) slave-bin.000001 976 User var 2 1002 @`n1`=NULL
slave-bin.000001 1066 User var 2 1092 @`n2`=NULL slave-bin.000001 1002 Query 1 1093 use `test`; insert into t1 values (@n1)
slave-bin.000001 1092 Query 1 1176 use `test`; insert into t1 values (@n2) slave-bin.000001 1093 User var 2 1119 @`n2`=NULL
slave-bin.000001 1176 Query 1 1286 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1) slave-bin.000001 1119 Query 1 1210 use `test`; insert into t1 values (@n2)
slave-bin.000001 1286 User var 2 1328 @`a`=2 slave-bin.000001 1210 Query 1 1327 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1)
slave-bin.000001 1328 Query 1 1422 use `test`; insert into t1 values (@a+(@b:=@a+1)) slave-bin.000001 1327 User var 2 1369 @`a`=2
slave-bin.000001 1422 User var 2 1459 @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci slave-bin.000001 1369 Query 1 1470 use `test`; insert into t1 values (@a+(@b:=@a+1))
slave-bin.000001 1459 Query 1 1585 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2')) slave-bin.000001 1470 User var 2 1507 @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci
slave-bin.000001 1585 User var 2 1627 @`a`=5 slave-bin.000001 1507 Query 1 1640 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'))
slave-bin.000001 1627 Query 1 1715 use `test`; insert into t1 values (@a),(@a) slave-bin.000001 1640 User var 2 1682 @`a`=5
slave-bin.000001 1715 User var 2 1740 @`a`=NULL slave-bin.000001 1682 Query 1 1777 use `test`; insert into t1 values (@a),(@a)
slave-bin.000001 1740 Query 1 1835 use `test`; insert into t1 values (@a),(@a),(@a*5) slave-bin.000001 1777 User var 2 1802 @`a`=NULL
slave-bin.000001 1802 Query 1 1904 use `test`; insert into t1 values (@a),(@a),(@a*5)
drop table t1; drop table t1;
stop slave; stop slave;
...@@ -172,24 +172,28 @@ SET TIMESTAMP=10000; ...@@ -172,24 +172,28 @@ SET TIMESTAMP=10000;
SET @`a b`='hello'; SET @`a b`='hello';
INSERT INTO t1 VALUES(@`a b`); INSERT INTO t1 VALUES(@`a b`);
set @var1= "';aaa"; set @var1= "';aaa";
insert into t1 values (@var1); SET @var2=char(ascii('a'));
insert into t1 values (@var1),(@var2);
show binlog events from 96; show binlog events from 96;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 96 User var 1 137 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci master-bin.000001 96 User var 1 137 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
master-bin.000001 137 Query 1 223 use `test`; INSERT INTO t1 VALUES(@`a b`) master-bin.000001 137 Query 1 230 use `test`; INSERT INTO t1 VALUES(@`a b`)
master-bin.000001 223 User var 1 265 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci master-bin.000001 230 User var 1 272 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
master-bin.000001 265 Query 1 351 use `test`; insert into t1 values (@var1) master-bin.000001 272 User var 1 310 @`var2`=_latin1 0x61 COLLATE latin1_swedish_ci
master-bin.000001 310 Query 1 411 use `test`; insert into t1 values (@var1),(@var2)
flush logs; flush logs;
/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/;
SET @`a b`:=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci; SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`;
use test; use test;
SET TIMESTAMP=10000; SET TIMESTAMP=10000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0; 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`); INSERT INTO t1 VALUES(@`a b`);
SET @`var1`:=_latin1 0x273B616161 COLLATE latin1_swedish_ci; SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`;
SET @`var2`:=_latin1 0x61 COLLATE `latin1_swedish_ci`;
SET TIMESTAMP=10000; SET TIMESTAMP=10000;
insert into t1 values (@var1); insert into t1 values (@var1),(@var2);
drop table t1; drop table t1;
set @var= NULL ; set @var= NULL ;
select FIELD( @var,'1it','Hit') as my_column; select FIELD( @var,'1it','Hit') as my_column;
......
...@@ -139,7 +139,7 @@ select n from t1; ...@@ -139,7 +139,7 @@ select n from t1;
rollback to savepoint `savept2`; rollback to savepoint `savept2`;
release savepoint `my_savepoint`; release savepoint `my_savepoint`;
select n from t1; select n from t1;
-- error 1181 -- error 1305
rollback to savepoint `my_savepoint`; rollback to savepoint `my_savepoint`;
set autocommit=1; set autocommit=1;
# nop # nop
......
...@@ -569,12 +569,12 @@ DROP TABLE t1; ...@@ -569,12 +569,12 @@ DROP TABLE t1;
CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6)); CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6));
INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello '); INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello ');
--error 1400 --error 1406
INSERT INTO t1 (col1) VALUES ('hellobob'); INSERT INTO t1 (col1) VALUES ('hellobob');
--error 1265 --error 1265
INSERT INTO t1 (col2) VALUES ('hellobob'); INSERT INTO t1 (col2) VALUES ('hellobob');
INSERT INTO t1 (col2) VALUES ('hello '); INSERT INTO t1 (col2) VALUES ('hello ');
--error 1400 --error 1406
UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he'; UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he';
--error 1265 --error 1265
UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he'; UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he';
......
...@@ -133,6 +133,23 @@ static HASH archive_open_tables; ...@@ -133,6 +133,23 @@ static HASH archive_open_tables;
#define DATA_BUFFER_SIZE 2 // Size of the data used in the data file #define DATA_BUFFER_SIZE 2 // Size of the data used in the data file
#define ARCHIVE_CHECK_HEADER 254 // The number we use to determine corruption #define ARCHIVE_CHECK_HEADER 254 // The number we use to determine corruption
/* dummy handlerton - only to have something to return from archive_db_init */
static handlerton archive_hton = {
0, /* slot */
0, /* savepoint size. */
0, /* close_connection */
0, /* savepoint */
0, /* rollback to savepoint */
0, /* releas savepoint */
0, /* commit */
0, /* rollback */
0, /* prepare */
0, /* recover */
0, /* commit_by_xid */
0 /* rollback_by_xid */
};
/* /*
Used for hash table that tracks open tables. Used for hash table that tracks open tables.
*/ */
...@@ -152,18 +169,19 @@ static byte* archive_get_key(ARCHIVE_SHARE *share,uint *length, ...@@ -152,18 +169,19 @@ static byte* archive_get_key(ARCHIVE_SHARE *share,uint *length,
void void
RETURN RETURN
FALSE OK &archive_hton OK
TRUE Error 0 Error
*/ */
bool archive_db_init() handlerton *archive_db_init()
{ {
VOID(pthread_mutex_init(&archive_mutex, MY_MUTEX_INIT_FAST)); VOID(pthread_mutex_init(&archive_mutex, MY_MUTEX_INIT_FAST));
return (hash_init(&archive_open_tables, system_charset_info, 32, 0, 0, if (hash_init(&archive_open_tables, system_charset_info, 32, 0, 0,
(hash_get_key) archive_get_key, 0, 0)); (hash_get_key) archive_get_key, 0, 0))
return 0;
return &archive_hton;
} }
/* /*
Release the archive handler. Release the archive handler.
......
...@@ -154,6 +154,7 @@ static int innobase_commit(THD* thd, bool all); ...@@ -154,6 +154,7 @@ static int innobase_commit(THD* thd, bool all);
static int innobase_rollback(THD* thd, bool all); static int innobase_rollback(THD* thd, bool all);
static int innobase_rollback_to_savepoint(THD* thd, void *savepoint); static int innobase_rollback_to_savepoint(THD* thd, void *savepoint);
static int innobase_savepoint(THD* thd, void *savepoint); static int innobase_savepoint(THD* thd, void *savepoint);
static int innobase_release_savepoint(THD* thd, void *savepoint);
static handlerton innobase_hton = { static handlerton innobase_hton = {
0, /* slot */ 0, /* slot */
...@@ -161,7 +162,7 @@ static handlerton innobase_hton = { ...@@ -161,7 +162,7 @@ static handlerton innobase_hton = {
innobase_close_connection, innobase_close_connection,
innobase_savepoint, innobase_savepoint,
innobase_rollback_to_savepoint, innobase_rollback_to_savepoint,
innobase_release_savepoint innobase_release_savepoint,
innobase_commit, /* commit */ innobase_commit, /* commit */
innobase_rollback, /* rollback */ innobase_rollback, /* rollback */
innobase_xa_prepare, /* prepare */ innobase_xa_prepare, /* prepare */
...@@ -1701,7 +1702,7 @@ innobase_rollback_to_savepoint( ...@@ -1701,7 +1702,7 @@ innobase_rollback_to_savepoint(
/********************************************************************* /*********************************************************************
Release transaction savepoint name. */ Release transaction savepoint name. */
int static int
innobase_release_savepoint( innobase_release_savepoint(
/*===========================*/ /*===========================*/
/* out: 0 if success, HA_ERR_NO_SAVEPOINT if /* out: 0 if success, HA_ERR_NO_SAVEPOINT if
...@@ -5575,12 +5576,16 @@ ha_innobase::transactional_table_lock( ...@@ -5575,12 +5576,16 @@ ha_innobase::transactional_table_lock(
/* MySQL is setting a new transactional table lock */ /* MySQL is setting a new transactional table lock */
/* Set the MySQL flag to mark that there is an active transaction */ /* Set the MySQL flag to mark that there is an active transaction */
thd->transaction.all.innodb_active_trans = 1; if (trx->active_trans == 0) {
register_trans(thd);
trx->active_trans = 1;
}
if (thd->in_lock_tables && thd->variables.innodb_table_locks) { if (thd->in_lock_tables && thd->variables.innodb_table_locks) {
ulint error = DB_SUCCESS; ulint error = DB_SUCCESS;
error = row_lock_table_for_mysql(prebuilt,NULL, error = row_lock_table_for_mysql(prebuilt,NULL,
LOCK_TABLE_TRANSACTIONAL); LOCK_TABLE_TRANSACTIONAL);
if (error != DB_SUCCESS) { if (error != DB_SUCCESS) {
...@@ -6299,9 +6304,9 @@ innobase_xa_prepare( ...@@ -6299,9 +6304,9 @@ innobase_xa_prepare(
} }
if (all || (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) { if (all || (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
/* We were instructed to prepare the whole transaction, or /* We were instructed to prepare the whole transaction, or
this is an SQL statement end and autocommit is on */ this is an SQL statement end and autocommit is on */
error = trx_prepare_for_mysql(trx); error = trx_prepare_for_mysql(trx);
} else { } else {
......
...@@ -1530,6 +1530,8 @@ int ha_enable_transaction(THD *thd, bool on) ...@@ -1530,6 +1530,8 @@ int ha_enable_transaction(THD *thd, bool on)
DBUG_ENTER("ha_enable_transaction"); DBUG_ENTER("ha_enable_transaction");
thd->transaction.on= on; thd->transaction.on= on;
if (on)
ha_commit(thd);
DBUG_RETURN(error); DBUG_RETURN(error);
} }
......
...@@ -64,14 +64,11 @@ static handlerton binlog_hton = { ...@@ -64,14 +64,11 @@ static handlerton binlog_hton = {
this function is mostly a placeholder. this function is mostly a placeholder.
conceptually, binlog initialization (now mostly done in MYSQL_LOG::open) conceptually, binlog initialization (now mostly done in MYSQL_LOG::open)
should be moved here. should be moved here.
for now, we fail if binlog is closed (mysql_bin_log.open() failed for some
reason) - it'll make mysqld to shutdown.
*/ */
handlerton *binlog_init() handlerton *binlog_init()
{ {
return mysql_bin_log.is_open() : &binlog_hton : 0; return &binlog_hton;
} }
static int binlog_close_connection(THD *thd) static int binlog_close_connection(THD *thd)
......
...@@ -2743,9 +2743,9 @@ server."); ...@@ -2743,9 +2743,9 @@ server.");
unireg_abort(1); unireg_abort(1);
} }
if (opt_bin_log) if (opt_bin_log && mysql_bin_log.open(opt_bin_logname, LOG_BIN, 0,
mysql_bin_log.open(opt_bin_logname, LOG_BIN, 0, WRITE_CACHE, 0, max_binlog_size, 0))
WRITE_CACHE, 0, max_binlog_size, 0); unireg_abort(1);
#ifdef HAVE_REPLICATION #ifdef HAVE_REPLICATION
if (opt_bin_log && expire_logs_days) if (opt_bin_log && expire_logs_days)
......
...@@ -1835,7 +1835,6 @@ class multi_update :public select_result_interceptor ...@@ -1835,7 +1835,6 @@ class multi_update :public select_result_interceptor
uint table_count; uint table_count;
Copy_field *copy_field; Copy_field *copy_field;
enum enum_duplicates handle_duplicates; enum enum_duplicates handle_duplicates;
bool do_update, trans_safe, transactional_tables;
bool do_update, trans_safe, transactional_tables, ignore; bool do_update, trans_safe, transactional_tables, ignore;
public: public:
......
...@@ -732,7 +732,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok) ...@@ -732,7 +732,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
If we return here we will not have logged the truncation to the bin log If we return here we will not have logged the truncation to the bin log
and we will not send_ok() to the client. and we will not send_ok() to the client.
*/ */
goto end; goto end;
} }
(void) sprintf(path,"%s/%s/%s%s",mysql_data_home,table_list->db, (void) sprintf(path,"%s/%s/%s%s",mysql_data_home,table_list->db,
......
...@@ -833,17 +833,6 @@ static int check_connection(THD *thd) ...@@ -833,17 +833,6 @@ static int check_connection(THD *thd)
return(ER_OUT_OF_RESOURCES); return(ER_OUT_OF_RESOURCES);
thd->client_capabilities=uint2korr(net->read_pos); thd->client_capabilities=uint2korr(net->read_pos);
#ifdef TO_BE_REMOVED_IN_4_1_RELEASE
/*
This is just a safety check against any client that would use the old
CLIENT_CHANGE_USER flag
*/
if ((thd->client_capabilities & CLIENT_PROTOCOL_41) &&
!(thd->client_capabilities & (CLIENT_RESERVED |
CLIENT_SECURE_CONNECTION |
CLIENT_MULTI_RESULTS)))
thd->client_capabilities&= ~CLIENT_PROTOCOL_41;
#endif
if (thd->client_capabilities & CLIENT_PROTOCOL_41) if (thd->client_capabilities & CLIENT_PROTOCOL_41)
{ {
thd->client_capabilities|= ((ulong) uint2korr(net->read_pos+2)) << 16; thd->client_capabilities|= ((ulong) uint2korr(net->read_pos+2)) << 16;
...@@ -1351,36 +1340,15 @@ int end_trans_and_send_ok(THD *thd, enum enum_mysql_completiontype completion) ...@@ -1351,36 +1340,15 @@ int end_trans_and_send_ok(THD *thd, enum enum_mysql_completiontype completion)
case ROLLBACK: case ROLLBACK:
case ROLLBACK_AND_CHAIN: case ROLLBACK_AND_CHAIN:
{ {
bool warn= 0;
thd->server_status&= ~SERVER_STATUS_IN_TRANS; thd->server_status&= ~SERVER_STATUS_IN_TRANS;
if (!ha_rollback(thd)) if (ha_rollback(thd))
{
/*
If a non-transactional table was updated, warn; don't warn if this is a
slave thread (because when a slave thread executes a ROLLBACK, it has
been read from the binary log, so it's 100% sure and normal to produce
error ER_WARNING_NOT_COMPLETE_ROLLBACK. If we sent the warning to the
slave SQL thread, it would not stop the thread but just be printed in
the error log; but we don't want users to wonder why they have this
message in the error log, so we don't send it.
*/
warn= (thd->options & OPTION_STATUS_NO_TRANS_UPDATE) &&
!thd->slave_thread;
}
else
res= -1; res= -1;
thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE); thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE);
if (!res && (completion == ROLLBACK_AND_CHAIN)) if (!res && (completion == ROLLBACK_AND_CHAIN))
res= begin_trans(thd); res= begin_trans(thd);
if (!res) if (!res)
{
if (warn)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARNING_NOT_COMPLETE_ROLLBACK,
ER(ER_WARNING_NOT_COMPLETE_ROLLBACK));
send_ok(thd); send_ok(thd);
}
break; break;
} }
default: default:
...@@ -3886,16 +3854,16 @@ mysql_execute_command(THD *thd) ...@@ -3886,16 +3854,16 @@ mysql_execute_command(THD *thd)
break; break;
case SQLCOM_COMMIT: case SQLCOM_COMMIT:
if (end_trans_and_send_ok(thd, lex->tx_release ? COMMIT_RELEASE : if (end_trans_and_send_ok(thd, lex->tx_release ? COMMIT_RELEASE :
lex->tx_chain ? COMMIT_AND_CHAIN : COMMIT, 0)) lex->tx_chain ? COMMIT_AND_CHAIN : COMMIT))
goto error; goto error;
break; break;
case SQLCOM_ROLLBACK: case SQLCOM_ROLLBACK:
if (end_trans_and_send_ok(thd, lex->tx_release ? ROLLBACK_RELEASE : if (end_trans_and_send_ok(thd, lex->tx_release ? ROLLBACK_RELEASE :
lex->tx_chain ? ROLLBACK_AND_CHAIN : ROLLBACK, lex->tx_chain ? ROLLBACK_AND_CHAIN : ROLLBACK))
0))
goto error; goto error;
break; break;
case SQLCOM_RELEASE_SAVEPOINT: case SQLCOM_RELEASE_SAVEPOINT:
{
SAVEPOINT **sv; SAVEPOINT **sv;
for (sv=&thd->transaction.savepoints; *sv; sv=&(*sv)->prev) for (sv=&thd->transaction.savepoints; *sv; sv=&(*sv)->prev)
{ {
...@@ -3908,7 +3876,9 @@ mysql_execute_command(THD *thd) ...@@ -3908,7 +3876,9 @@ mysql_execute_command(THD *thd)
{ {
if (ha_release_savepoint(thd, *sv)) if (ha_release_savepoint(thd, *sv))
res= TRUE; // cannot happen res= TRUE; // cannot happen
*sv= 0; else
send_ok(thd);
*sv=(*sv)->prev;
} }
else else
{ {
...@@ -3918,6 +3888,7 @@ mysql_execute_command(THD *thd) ...@@ -3918,6 +3888,7 @@ mysql_execute_command(THD *thd)
break; break;
} }
case SQLCOM_ROLLBACK_TO_SAVEPOINT: case SQLCOM_ROLLBACK_TO_SAVEPOINT:
{
SAVEPOINT **sv; SAVEPOINT **sv;
for (sv=&thd->transaction.savepoints; *sv; sv=&(*sv)->prev) for (sv=&thd->transaction.savepoints; *sv; sv=&(*sv)->prev)
{ {
...@@ -3939,7 +3910,7 @@ mysql_execute_command(THD *thd) ...@@ -3939,7 +3910,7 @@ mysql_execute_command(THD *thd)
ER(ER_WARNING_NOT_COMPLETE_ROLLBACK)); ER(ER_WARNING_NOT_COMPLETE_ROLLBACK));
send_ok(thd); send_ok(thd);
} }
*sv= 0; *sv=(*sv)->prev;
} }
else else
{ {
......
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