Skip to content

Commit

Permalink
codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
humengyu2012 committed Apr 12, 2024
1 parent be89107 commit 1d8de76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ public class TimestampType extends AbstractDateTimeType {

public static final MySQLType[] subTypes = new MySQLType[] {MySQLType.TypeTimestamp};

/**
* Default value for timestamp type is 0000-00-00 00:00:00
*/
/** Default value for timestamp type is 0000-00-00 00:00:00 */
public static final String TIMESTAMP_NULL_DEFAULT = "0000-00-00 00:00:00";

TimestampType(MySQLType tp) {
Expand Down Expand Up @@ -97,7 +95,8 @@ protected Timestamp decodeNotNullForBatchWrite(int flag, CodecDataInput cdi) {

@Override
public Object getOriginDefaultValue(String value, long version) {
// avoid exception: org.joda.time.IllegalFieldValueException: Cannot parse "0000-00-00 00:00:00": Value 0 for monthOfYear must be in the range [1,12]
// avoid exception: org.joda.time.IllegalFieldValueException: Cannot parse "0000-00-00
// 00:00:00": Value 0 for monthOfYear must be in the range [1,12]
if (TIMESTAMP_NULL_DEFAULT.equals(value)) {
value = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public void testToProto() {
1,
"",
false);
assertEquals(
"\000", columnInfo.getOriginDefaultValueAsByteString().toStringUtf8());
assertEquals("\000", columnInfo.getOriginDefaultValueAsByteString().toStringUtf8());
}
}

0 comments on commit 1d8de76

Please sign in to comment.