You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: SEC_TO_TIME and MAKETIME boundary/fractional behavior differs from MySQL #25304
Latest origin/main verified locally at 200bfa7e0efb.
Reproduce Steps
set session sql_mode ='';
select sec_to_time(3020399) as max_in_range,
sec_to_time(3020400) as over_range,
sec_to_time(-3020400) as under_range,
sec_to_time(2378.7) as fractional_seconds;
select maketime(12,15,30.9) as fractional_second,
maketime(840,0,0) as over_hour,
maketime(12,60,0) as bad_minute,
maketime(null,1,1) as null_hour;
Found during MySQL compatibility Module 5 exploration for date/time functions. MySQL documents SEC_TO_TIME() and MAKETIME() as time construction/conversion functions, and MAKETIME() allows fractional seconds in the second argument.
Existing main coverage has func_datetime_sec_to_time / func_datetime_maketime, but some boundary comments/expectations are not aligned with MySQL oracle, so this should be fixed as a bug/regression rather than added as a passing BVT row now.
Additional latest-main evidence from ODBC compatibility testing: direct TIME(6) column insertion accepts a value beyond MySQL's documented maximum even with STRICT_TRANS_TABLES enabled.
createtablerepro_time_range(id intprimary key, t time(6));
insert into repro_time_range values (1,'838:59:59.999999');
insert into repro_time_range values (2,'839:00:00');
select id, cast(t asvarchar), time_to_sec(t) from repro_time_range order by id;
Expected under strict MySQL behavior: the second insert is rejected as out of range (maximum 838:59:59.999999). This complements the SEC_TO_TIME/MAKETIME boundary evidence already in this issue: MatrixOne's constructor functions and TIME column cast path disagree at the same boundary.
Evidence: server-scenarios-round3.json R304, server-candidate-repros-round3.sql, and direct-mysql-candidate-repros-round3.log.
Actual: the insert succeeds without warning and stores 839:00:00.000000 / 3020400 seconds. This is the same column-cast boundary evidence previously attached, now reconfirmed on the newest commit.
The server still accepts TIME(6) '839:00:00' without an error or warning, while 838:59:59.999999 succeeds as expected. The no-pooling ODBC boundary round reports 10 PASS / 2 FAIL; this is one of the two failures (the other is MatrixOne's intentional transactional-DDL semantic difference).
Activity
iamlinjunhong commentedon Aug 20, 2026
Additional latest-
mainevidence from ODBC compatibility testing: directTIME(6)column insertion accepts a value beyond MySQL's documented maximum even withSTRICT_TRANS_TABLESenabled.592ad2190a90e063e3877059f4018427a10a49988f1ca365289a0f8ea0d22e6581cce1ea4ae67454@@sql_mode:ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLESActual:
Expected under strict MySQL behavior: the second insert is rejected as out of range (maximum
838:59:59.999999). This complements theSEC_TO_TIME/MAKETIMEboundary evidence already in this issue: MatrixOne's constructor functions andTIMEcolumn cast path disagree at the same boundary.Evidence:
server-scenarios-round3.jsonR304,server-candidate-repros-round3.sql, anddirect-mysql-candidate-repros-round3.log.iamlinjunhong commentedon Aug 26, 2026
Retested the direct
TIME(6)column boundary on latestmain; the existing discrepancy remains reproducible.1891117aedce0419a81630b3011906b560b93d0a390f3cc58ebc06d5e830a7839cccbca2962ffcc4@@sql_modeincludesSTRICT_TRANS_TABLESActual: the insert succeeds without warning and stores
839:00:00.000000/3020400seconds. This is the same column-cast boundary evidence previously attached, now reconfirmed on the newest commit.Evidence:
artifacts/production-release-20260826/logs/repro-time-839-native-1891117.log.iamlinjunhong commentedon Aug 26, 2026
Retested through MatrixOne ODBC on current
main:a53f5a3b757c5b21a36e539e4471533fe1d091a8390f3cc58ebc06d5e830a7839cccbca2962ffcc4STRICT_TRANS_TABLESenabledThe server still accepts
TIME(6) '839:00:00'without an error or warning, while838:59:59.999999succeeds as expected. The no-pooling ODBC boundary round reports 10 PASS / 2 FAIL; this is one of the two failures (the other is MatrixOne's intentional transactional-DDL semantic difference).fix: align sec_to_time and time assignment boundaries (#27780)
Ariznawlll commentedon Aug 31, 2026
测试通过。
验证版本:main@09c9a0b。SEC_TO_TIME 正负 clamp、边界 3020399/400/401、fraction/microsecond,以及 MAKETIME fraction/clamp/非法 minute/second/NULL/strict mode 均连续 3 轮得到预期结果。
已加入 MOTR 回归:https://github.com/matrixorigin/motr/pull/131。
fix: align sec_to_time and time assignment boundaries (matrixorigin#2…
fix: align sec_to_time and time assignment boundaries (matrixorigin#2…
fix: align sec_to_time and time assignment boundaries (matrixorigin#2…