diff --git a/types/time.go b/types/time.go index 3aac6c82f0624..35bae2600041b 100644 --- a/types/time.go +++ b/types/time.go @@ -786,7 +786,8 @@ func isValidSeparator(c byte, prevParts int) bool { return true } - if prevParts == 2 && (c == ' ' || c == 'T') { + // for https://github.com/pingcap/tidb/issues/32232 + if prevParts == 2 && (c == 'T' || c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r') { return true } diff --git a/types/time_test.go b/types/time_test.go index e1f0d91627ba6..bb381be49a421 100644 --- a/types/time_test.go +++ b/types/time_test.go @@ -1077,6 +1077,11 @@ func (s *testTimeSuite) TestParseDateFormat(c *C) { {"T10:10:10", nil}, {"2011-11-11x", []string{"2011", "11", "11x"}}, {"xxx 10:10:10", nil}, + {"2022-02-01\n16:33:00", []string{"2022", "02", "01", "16", "33", "00"}}, + {"2022-02-01\f16:33:00", []string{"2022", "02", "01", "16", "33", "00"}}, + {"2022-02-01\v16:33:00", []string{"2022", "02", "01", "16", "33", "00"}}, + {"2022-02-01\r16:33:00", []string{"2022", "02", "01", "16", "33", "00"}}, + {"2022-02-01\t16:33:00", []string{"2022", "02", "01", "16", "33", "00"}}, } for _, t := range tbl { diff --git a/util/stmtsummary/statement_summary.go b/util/stmtsummary/statement_summary.go index f4c934561fff7..36c22e092f5ae 100644 --- a/util/stmtsummary/statement_summary.go +++ b/util/stmtsummary/statement_summary.go @@ -980,9 +980,9 @@ func (ssElement *stmtSummaryByDigestElement) toDatum(ssbd *stmtSummaryByDigest) avgInt(int64(ssElement.sumPDTotal), ssElement.commitCount), avgInt(int64(ssElement.sumBackoffTotal), ssElement.commitCount), avgInt(int64(ssElement.sumWriteSQLRespTotal), ssElement.commitCount), - int64(ssElement.maxResultRows), - int64(ssElement.minResultRows), - avgInt(int64(ssElement.sumResultRows), ssElement.execCount), + ssElement.maxResultRows, + ssElement.minResultRows, + avgInt(ssElement.sumResultRows, ssElement.execCount), ssElement.prepared, avgFloat(int64(ssElement.sumAffectedRows), ssElement.execCount), types.NewTime(types.FromGoTime(ssElement.firstSeen), mysql.TypeTimestamp, 0),