mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01:00
665a31af2b
Merge of 10.0-mdev26 feature tree into 10.0-base. Global transaction ID is prepended to each event group in the binlog. Slave connect can request to start from GTID position instead of specifying file name/offset of master binlog. This facilitates easy switch to a new master. Slave GTID state is stored in a table mysql.rpl_slave_state, which can be InnoDB to get crash-safe slave state. GTID includes a replication domain ID, allowing to keep track of distinct positions for each of multiple masters.
94 lines
3.1 KiB
Text
94 lines
3.1 KiB
Text
include/master-slave.inc
|
|
[connection master]
|
|
set time_zone='+03:00';
|
|
set timestamp=unix_timestamp('2011-01-01 01:01:01') + 0.123456;
|
|
create table t1 (a timestamp(4), b varchar(100), c datetime(2));
|
|
insert t1 (b,c) values (now(6), now(6));
|
|
insert t1 values ('2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010');
|
|
set timestamp=unix_timestamp('2022-02-02 02:02:02') + 0.654321;
|
|
insert t1 (b,c) values (now(), now());
|
|
insert t1 (b,c) values (0,0);
|
|
insert t1 (a,b,c) values (0,0,now(6));
|
|
select * from t1;
|
|
a b c
|
|
2011-01-01 01:01:01.1234 2011-01-01 01:01:01.123456 2011-01-01 01:01:01.12
|
|
2010-10-10 10:10:10.1010 2010-10-10 10:10:10.101010 2010-10-10 10:10:10.10
|
|
2022-02-02 02:02:02.6543 2022-02-02 02:02:02 2022-02-02 02:02:02.00
|
|
2022-02-02 02:02:02.6543 0 0000-00-00 00:00:00.00
|
|
0000-00-00 00:00:00.0000 0 2022-02-02 02:02:02.65
|
|
set time_zone='+03:00';
|
|
select * from t1;
|
|
a b c
|
|
2011-01-01 01:01:01.1234 2011-01-01 01:01:01.123456 2011-01-01 01:01:01.12
|
|
2010-10-10 10:10:10.1010 2010-10-10 10:10:10.101010 2010-10-10 10:10:10.10
|
|
2022-02-02 02:02:02.6543 2022-02-02 02:02:02 2022-02-02 02:02:02.00
|
|
2022-02-02 02:02:02.6543 0 0000-00-00 00:00:00.00
|
|
0000-00-00 00:00:00.0000 0 2022-02-02 02:02:02.65
|
|
drop table t1;
|
|
include/rpl_end.inc
|
|
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
|
|
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
|
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
|
DELIMITER /*!*/;
|
|
ROLLBACK/*!*/;
|
|
use `test`/*!*/;
|
|
SET TIMESTAMP=1293832861/*!*/;
|
|
SET @@session.pseudo_thread_id=999999999/*!*/;
|
|
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
|
|
SET @@session.sql_mode=0/*!*/;
|
|
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
|
|
/*!\C latin1 *//*!*/;
|
|
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
|
SET @@session.lc_time_names=0/*!*/;
|
|
SET @@session.collation_database=DEFAULT/*!*/;
|
|
create table t1 (a timestamp(4), b varchar(100), c datetime(2))
|
|
/*!*/;
|
|
BEGIN
|
|
/*!*/;
|
|
SET TIMESTAMP=1293832861.123456/*!*/;
|
|
SET @@session.time_zone='+03:00'/*!*/;
|
|
insert t1 (b,c) values (now(6), now(6))
|
|
/*!*/;
|
|
SET TIMESTAMP=1293832861.123456/*!*/;
|
|
COMMIT
|
|
/*!*/;
|
|
BEGIN
|
|
/*!*/;
|
|
SET TIMESTAMP=1293832861/*!*/;
|
|
insert t1 values ('2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010','2010-10-10 10:10:10.101010')
|
|
/*!*/;
|
|
SET TIMESTAMP=1293832861/*!*/;
|
|
COMMIT
|
|
/*!*/;
|
|
BEGIN
|
|
/*!*/;
|
|
SET TIMESTAMP=1643756522.654321/*!*/;
|
|
insert t1 (b,c) values (now(), now())
|
|
/*!*/;
|
|
SET TIMESTAMP=1643756522.654321/*!*/;
|
|
COMMIT
|
|
/*!*/;
|
|
BEGIN
|
|
/*!*/;
|
|
SET TIMESTAMP=1643756522.654321/*!*/;
|
|
insert t1 (b,c) values (0,0)
|
|
/*!*/;
|
|
SET TIMESTAMP=1643756522.654321/*!*/;
|
|
COMMIT
|
|
/*!*/;
|
|
BEGIN
|
|
/*!*/;
|
|
SET TIMESTAMP=1643756522.654321/*!*/;
|
|
insert t1 (a,b,c) values (0,0,now(6))
|
|
/*!*/;
|
|
SET TIMESTAMP=1643756522.654321/*!*/;
|
|
COMMIT
|
|
/*!*/;
|
|
SET TIMESTAMP=1643756522/*!*/;
|
|
DROP TABLE `t1` /* generated by server */
|
|
/*!*/;
|
|
DELIMITER ;
|
|
# End of log file
|
|
ROLLBACK /* added by mysqlbinlog */;
|
|
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
|
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
|