-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
- I have checked the FAQ of this repository and believe that this is not a duplicate.
environment
- canal version
1.1.3 - mysql version
5.7
Issue Description
MySQL字段类型为TIME时,写入值100:00:01,canal解析出来的值为00:00:01。大于100的时间,例如101:00:01,解析正常。
debug研究了下,应该是RowsLogBuffer解析的bug,第759行,个人觉得应该是d >= 100。
if (d > 100) {
builder.append(String.valueOf(d));
} else {
appendNumber2(builder, d);
}
public static void appendNumber2(StringBuilder builder, int d) {
if (d >= 10) {
builder.append(digits[(d / 10) % 10]).append(digits[d % 10]);
} else {
builder.append('0').append(digits[d]);
}
}
appendNumber2方法里会丢失精度,如果是100,格式化完返回00。
Reactions are currently unavailable