mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-10-30 07:26:56 +00:00
fix(mysql): cap timestamp output at microsecond precision (#9831)
* fix(mysql): cap timestamp output at microsecond precision
Truncate MySQL text timestamp results to microseconds while preserving the existing second and millisecond formatting. Keep stored nanoseconds and explicit integer/string representations unchanged.
Fixes #9828
* chore: ignore local output directory
---------
(cherry picked from commit 5af1e3301e)
Signed-off-by: luofucong <luofc@foxmail.com>
18 lines
595 B
Plaintext
18 lines
595 B
Plaintext
-- SQLNESS PROTOCOL MYSQL
|
|
SELECT * FROM timestamps;
|
|
|
|
+----------------------------+
|
|
| ts |
|
|
+----------------------------+
|
|
| 2026-10-21 08:55:35.718870 |
|
|
+----------------------------+
|
|
|
|
-- SQLNESS PROTOCOL MYSQL
|
|
SELECT ts::BIGINT AS epoch_ns, ts::STRING AS timestamp_string FROM timestamps;
|
|
|
|
+---------------------+-------------------------------+
|
|
| epoch_ns | timestamp_string |
|
|
+---------------------+-------------------------------+
|
|
| 1792572935718870300 | 2026-10-21T08:55:35.718870300 |
|
|
+---------------------+-------------------------------+
|