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
Currently, TiDB behaves as if TIME_TRUNCATE_FRACTIONAL is always enabled. If this SQL mode is implemented, it will actually change the default behavior of TiDB to round, and require this mode to restore the current behavior.
Consider the following testcase:
CREATETABLEt1 (a INT, b TIME(6));
INSERT INTO t1 (b) VALUES ('-10:10:59.500000');
INSERT INTO t1 (b) VALUES ('-10:10:59.500000');
UPDATE t1 SET a=b;
SELECT*FROM t1;
..
tidb>SELECT*FROM t1;
+---------+------------------+
| a | b |
+---------+------------------+
| -101059 | -10:10:59.500000 |
| -101059 | -10:10:59.500000 |
+---------+------------------+2 rows inset (0.00 sec)
mysql [localhost:5735] {msandbox} (test) >SELECT*FROM t1;
+---------+------------------+
| a | b |
+---------+------------------+
| -101100 | -10:10:59.500000 |
| -101100 | -10:10:59.500000 |
+---------+------------------+2 rows inset (0.00 sec)
Feature Request
Is your feature request related to a problem? Please describe:
No.
Describe the feature you'd like:
Same as mysql
TIME_TRUNCATE_FRACTIONAL
. I don't want to rounddatetime
, truncation is better in my scene.Describe alternatives you've considered:
No.
Teachability, Documentation, Adoption, Migration Strategy:
See MySQL Doc: https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sqlmode_time_truncate_fractional
The text was updated successfully, but these errors were encountered: