1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
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) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 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
connection slave;
connection slave;
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
connection master;
drop table t1;
include/rpl_end.inc
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_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, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=1, @@session.system_versioning_insert_history=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=latin1,@@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) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, b varchar(100), c datetime(2))
/*!*/;
START TRANSACTION
/*!*/;
SET TIMESTAMP=1293832861.123456/*!*/;
SET @@session.time_zone='+03:00'/*!*/;
insert t1 (b,c) values (now(6), now(6))
/*!*/;
SET TIMESTAMP=1293832861.123456/*!*/;
COMMIT
/*!*/;
START TRANSACTION
/*!*/;
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
/*!*/;
START TRANSACTION
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
insert t1 (b,c) values (now(), now())
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
COMMIT
/*!*/;
START TRANSACTION
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
insert t1 (b,c) values (0,0)
/*!*/;
SET TIMESTAMP=1643756522.654321/*!*/;
COMMIT
/*!*/;
START TRANSACTION
/*!*/;
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*/;
|