mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-10-29 23:16:57 +00:00
fix(query): respect query timezone in timestamp casts (#8859)
* fix(query): respect timezone in insert values Signed-off-by: Morax <james20081204@gmail.com> * fix(query): normalize timestamp casts with query timezone Signed-off-by: Morax <james20081204@gmail.com> * fix(query): scope timestamp conversion to insert assignments Signed-off-by: Morax <james20081204@gmail.com> * style(query): simplify Arc usage Signed-off-by: Morax <james20081204@gmail.com> --------- Signed-off-by: Morax <james20081204@gmail.com> (cherry picked from commit f479ddb38f3bdaf29fcb2e174bdfb8f5a13c8e19) (cherry picked from commit a6c99a5334af982888f83b17e592316161b21daf)
This commit is contained in:
@@ -16,8 +16,26 @@ SELECT * FROM test2 ORDER BY j;
|
||||
|
||||
SELECT * FROM test1 ORDER BY j;
|
||||
|
||||
CREATE TABLE test3 (ts TIMESTAMP TIME INDEX, st TIMESTAMP, ts_ns TIMESTAMP(9));
|
||||
|
||||
INSERT INTO test3 (ts) VALUES ('2026-08-01 12:00:00.001');
|
||||
|
||||
INSERT INTO test3 (ts, st) VALUES ('2026-08-02 12:00:00.001', now());
|
||||
|
||||
INSERT INTO test3 (ts, st) SELECT '2026-08-03 12:00:00.001', now();
|
||||
|
||||
INSERT INTO test3 (ts, st, ts_ns) VALUES (
|
||||
'2026-08-04 12:00:00.001',
|
||||
now(),
|
||||
'2026-08-04 12:00:00.123456789'
|
||||
);
|
||||
|
||||
SELECT ts, ts_ns FROM test3 ORDER BY ts;
|
||||
|
||||
SET time_zone = 'UTC';
|
||||
|
||||
DROP TABLE test1;
|
||||
|
||||
DROP TABLE test2;
|
||||
|
||||
DROP TABLE test3;
|
||||
|
||||
Reference in New Issue
Block a user