Files
greptimedb/tests/cases/standalone/common/timestamp/timestamp.result
Lei, HUANG 19d2d77b41 fix: parse large timestamp (#2185)
* feat: support parsing large timestamp values

* chore: update sqlness tests

* fix: tests

* fix: allow larger window
2023-08-24 03:52:15 +00:00

85 lines
2.3 KiB
Plaintext

SELECT timestamp ' 2017-07-23 13:10:11 ';
+-----------------------------+
| Utf8("2017-07-23 13:10:11") |
+-----------------------------+
| 2017-07-23T13:10:11 |
+-----------------------------+
SELECT timestamp ' 2017-07-23 13:10:11 ';
+-----------------------------+
| Utf8("2017-07-23 13:10:11") |
+-----------------------------+
| 2017-07-23T13:10:11 |
+-----------------------------+
CREATE TABLE timestamp_with_precision (ts TIMESTAMP(6) TIME INDEX, cnt INT);
Affected Rows: 0
INSERT INTO timestamp_with_precision(ts,cnt) VALUES ('2023-04-04 08:00:00.0052+0000', 1);
Affected Rows: 1
INSERT INTO timestamp_with_precision(ts,cnt) VALUES ('2023-04-04 08:00:00.0052+0800', 2);
Affected Rows: 1
INSERT INTO timestamp_with_precision(ts,cnt) VALUES ('+100000-01-01 00:00:01.5Z', 3);
Affected Rows: 1
INSERT INTO timestamp_with_precision(ts,cnt) VALUES ('-262144-01-01 00:00:00Z', 4);
Affected Rows: 1
INSERT INTO timestamp_with_precision(ts,cnt) VALUES ('+262143-12-31 23:59:59Z', 5);
Affected Rows: 1
INSERT INTO timestamp_with_precision(ts,cnt) VALUES ('-262144-01-01 00:00:00Z', 6);
Affected Rows: 1
INSERT INTO timestamp_with_precision(ts,cnt) VALUES ('+262143-12-31 23:59:59.999Z', 7);
Affected Rows: 1
INSERT INTO timestamp_with_precision(ts,cnt) VALUES ('-262144-01-01 00:00:00Z', 8);
Affected Rows: 1
INSERT INTO timestamp_with_precision(ts,cnt) VALUES ('+262143-12-31 23:59:59.999999Z', 9);
Affected Rows: 1
INSERT INTO timestamp_with_precision(ts,cnt) VALUES ('1677-09-21 00:12:43.145225Z', 10);
Affected Rows: 1
INSERT INTO timestamp_with_precision(ts,cnt) VALUES ('2262-04-11 23:47:16.854775807Z', 11);
Affected Rows: 1
SELECT * FROM timestamp_with_precision ORDER BY ts ASC;
+-------------------------------+-----+
| ts | cnt |
+-------------------------------+-----+
| -262144-01-01T00:00:00 | 8 |
| 1677-09-21T00:12:43.145225 | 10 |
| 2023-04-04T00:00:00.005200 | 2 |
| 2023-04-04T08:00:00.005200 | 1 |
| 2262-04-11T23:47:16.854775 | 11 |
| +100000-01-01T00:00:01.500 | 3 |
| +262143-12-31T23:59:59 | 5 |
| +262143-12-31T23:59:59.999 | 7 |
| +262143-12-31T23:59:59.999999 | 9 |
+-------------------------------+-----+
DROP TABLE timestamp_with_precision;
Affected Rows: 1