-
Notifications
You must be signed in to change notification settings - Fork 817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent behavior for '0000-00-00 00:00:00' garbage dates #210
Comments
Hi Ben. Makes sense. Fixed in 0.14.0 🐦. To activate: EventDeserializer eventDeserializer = new EventDeserializer();
eventDeserializer.setCompatibilityMode(CompatibilityMode.INVALID_DATE_AND_TIME_AS_ZERO,
...rest/* order doesn't matter */);
binaryLogClient.setEventDeserializer(eventDeserializer); 🙇♂️ |
thanks Stanley! you are, as they say, the man. |
bah, sorry @shyiko, but after poking into some failing tests I realize that with this new behavior I can't distinguish between |
I don't think there is a way to distinguish between these two: create table `test` (
id int unsigned not null,
test_timestamp timestamp
);
insert into test values(1, '0000-00-00 00:00:00');
insert into test values(2, '1970-01-01 00:00:00');
insert into test values(3, null);
select * from test;
+----+---------------------+
| id | test_timestamp |
+----+---------------------+
| 1 | 0000-00-00 00:00:00 |
| 2 | 0000-00-00 00:00:00 |
| 3 | 2018-04-05 06:15:35 |
+----+---------------------+
3 rows in set (0.00 sec) (binlog contains zeros in both cases) |
ah, yes. that's true in the case of timestamps, but not in the case of |
Alrighty :) EventDeserializer eventDeserializer = new EventDeserializer();
eventDeserializer.setCompatibilityMode(
CompatibilityMode.INVALID_DATE_AND_TIME_AS_NEGATIVE_ONE,
...rest/* order doesn't matter */
);
binaryLogClient.setEventDeserializer(eventDeserializer); (available in 0.15.0) 🎉 |
ok @shyiko now you're really gonna kill me. I realize too late that How about A millllllion apologies. |
:D No worries, Ben. I can't believe I haven't thought of this myself. I'll publish another release at 12pm, PDT (today). |
EventDeserializer eventDeserializer = new EventDeserializer();
eventDeserializer.setCompatibilityMode(
CompatibilityMode.INVALID_DATE_AND_TIME_AS_MIN_VALUE,
...rest/* order doesn't matter */
);
binaryLogClient.setEventDeserializer(eventDeserializer); (0.16.0 published) |
Hey guys,
I'm poking around on zendesk/maxwell#928 -- one of those issues where yeah, it sucks that mysql ever allowed '0000-00-00' dates, but with maxwell I tend towards "reproduce it faithfully, even if it's garbage".
binlog-connector has some differing behavior for timestamp/datetime columns when encountering these columns (note that I'm using
deserializeDateAndTimeAsLong
):OL
.asUnixTime
.I guess I'd like it if they all came back as
OL
Anyway, hope y'all are doing well.
The text was updated successfully, but these errors were encountered: