File tree 1 file changed +12
-2
lines changed
src/main/java/com/github/shyiko/mysql/binlog/event/deserialization
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,13 @@ private void ensureCompatibility(EventDataDeserializer eventDataDeserializer) {
173
173
}
174
174
deserializer .setInvalidDateAndTimeRepresentation (-1L );
175
175
}
176
+ if (compatibilitySet .contains (CompatibilityMode .INVALID_DATE_AND_TIME_AS_MIN_VALUE )) {
177
+ if (!deserializeDateAndTimeAsLong ) {
178
+ throw new IllegalArgumentException ("INVALID_DATE_AND_TIME_AS_MIN_VALUE requires " +
179
+ "DATE_AND_TIME_AS_LONG or DATE_AND_TIME_AS_LONG_MICRO" );
180
+ }
181
+ deserializer .setInvalidDateAndTimeRepresentation (Long .MIN_VALUE );
182
+ }
176
183
deserializer .setDeserializeCharAndBinaryAsByteArray (
177
184
compatibilitySet .contains (CompatibilityMode .CHAR_AND_BINARY_AS_BYTE_ARRAY )
178
185
);
@@ -260,10 +267,13 @@ public enum CompatibilityMode {
260
267
/**
261
268
* Return -1 instead of null if year/month/day is 0.
262
269
* Affects DATETIME/DATETIME_V2/DATE/TIME/TIME_V2.
263
- *
264
- * <p>This option is going to be enabled by default starting from mysql-binlog-connector-java@1.0.0.
265
270
*/
266
271
INVALID_DATE_AND_TIME_AS_NEGATIVE_ONE ,
272
+ /**
273
+ * Return Long.MIN_VALUE instead of null if year/month/day is 0.
274
+ * Affects DATETIME/DATETIME_V2/DATE/TIME/TIME_V2.
275
+ */
276
+ INVALID_DATE_AND_TIME_AS_MIN_VALUE ,
267
277
/**
268
278
* Return CHAR/VARCHAR/BINARY/VARBINARY values as byte[]|s (instead of String|s).
269
279
*
You can’t perform that action at this time.
0 commit comments