julien-duponchelle / julien-duponchelle/python-mysql-replication

get wrong fsp value for time,datetime,timestamp(new date format)

Open
#231 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.4k
Forks
690
PR merge metrics
No merged PRs in 30d

Description

mysql server version: mysql5.6
schema:
```
CREATE TABLE `mytest` (
`a` int(11) NOT NULL,
`b` smallint(6) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
`d` mediumint(9) DEFAULT NULL,
`y` float DEFAULT NULL,
`x` double DEFAULT NULL,
`e` varchar(100) DEFAULT NULL,
`f` char(20) DEFAULT NULL,
`g` text,
`h` decimal(10,5) DEFAULT NULL,
`i` time(2) DEFAULT NULL,
`j` date DEFAULT NULL,
`k` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
`l` bigint(20) DEFAULT NULL,
`m` year(4) DEFAULT NULL,
`n` enum('a','b','c') DEFAULT NULL,
`o` set('a','b','c') DEFAULT NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `uk_bc` (`b`,`c`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
```

sql:
```
mysql> select * from mytest where a = 9;
+---+------+------+------+-------+------+--------+-------+---------+----------+-------------+------------+-------------------------+------+------+------+------+
| a | b | c | d | y | x | e | f | g | h | i | j | k | l | m | n | o |
+---+------+------+------+-------+------+--------+-------+---------+----------+-------------+------------+-------------------------+------+------+------+------+
| 9 | 10 | 10 | 10 | 10.01 | 10.3 | aasfsd | 435ty | d3yzsaf | 10.22200 | 10:10:10.11 | 1999-01-01 | 2017-09-25 22:09:59.889 | 555 | 1990 | a | a,b |
+---+------+------+------+-------+------+--------+-------+---------+----------+-------------+------------+-------------------------+------+------+------+------+
1 row in set (0.00 sec)

mysql> update mytest set c=101 where a=9;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> select * from mytest where a = 9;
+---+------+------+------+-------+------+--------+-------+---------+----------+-------------+------------+-------------------------+------+------+------+------+
| a | b | c | d | y | x | e | f | g | h | i | j | k | l | m | n | o |
+---+------+------+------+-------+------+--------+-------+---------+----------+-------------+------------+-------------------------+------+------+------+------+
| 9 | 10 | 101 | 10 | 10.01 | 10.3 | aasfsd | 435ty | d3yzsaf | 10.22200 | 10:10:10.11 | 1999-01-01 | 2017-09-25 22:19:43.102 | 555 | 1990 | a | a,b |
+---+------+------+------+-------+------+--------+-------+---------+----------+-------------+------------+-------------------------+------+------+------+------+
1 row in set (0.00 sec)
```

result:
```
=== UpdateRowsEvent ===
Date: 2017-09-25T22:19:43
Log position: 1793388
Event size: 179
Read bytes: 17
Table: dmy2.mytest
Affected columns: 17
Changed rows: 1
Affected columns: 17
Values:
--
*a:9=>9
*c:10=>101
*b:10=>10
*e:aasfsd=>aasfsd
*d:10=>10
*g:d3yzsaf=>d3yzsaf
*f:435ty=>435ty
*i:10:10:10.000011=>10:10:10.000011
*h:10.22200=>10.22200
*k:2017-09-25 22:09:59.000889=>2017-09-25 22:19:43.000102
*j:1999-01-01=>1999-01-01
*m:1990=>1990
*l:555=>555
*o:set([u'a', u'b'])=>set([u'a', u'b'])
*n:a=>a
*y:10.0100002289=>10.0100002289
*x:10.3=>10.3
```

see column i k , it's a wrong value

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.