Files
greptimedb/tests/cases/standalone/common/alter/alter_table_default.result
Yingwen 65f8b72d34 feat: Implement RegionScanner for SeqScan (#4060)
* feat: ordered builder wip

* feat: impl RegionScanner for SeqScan

* feat: implement scan_partition and build_stream

* chore: return SeqScan as RegionScanner

* fix: group parts

* feat: split parts

* chore: reader metrics

* chore: metrics

* chore: remove unused codes

* chore: support holding a group of ranges in ScanPart

* feat: group ScanParts to ScanParts

* feat: impl SeqScanner again

* chore: observe build cost in ScannerMetrics

* chore: fix compiler warnings

* style: fix clippy

* docs: update config docs

* chore: forward DisplayAs to scanner

* test: update sqlness tests

* chore: update debug fmt

* chore: custom debug for timestamp

fix test compiling issue with common-macro when running
cargo nextest -p common-time

* chore: update debug format

* feat: update fmt for scan part

* chore: fix warning

* fix: sanitize parallelism

* feat: split parts

* test: fix config api test

* feat: update logs

* chore: Revert "chore: remove unused codes"

This reverts commit b548b30a01eeded59b1a0a8d89f9293ca63afc41.

* chore: Revert "docs: update config docs"

This reverts commit a7997e78d6ddcf635560574de8c1948c495bdd12.

* feat: each partition scan files in parallel

* test: fix config api test

* docs: fix typo

* chore: address comments, simplify tests

* feat: global semaphore

* feat: always spawn task

* chore: simplify default explain output format

* handle output partiton number is 0

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix typo

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
2024-06-12 08:21:30 +00:00

75 lines
1.9 KiB
Plaintext

--- alter table to add new column with default timestamp values aware of session timezone test ---
CREATE TABLE test1 (i INTEGER, j TIMESTAMP time index, PRIMARY KEY(i));
Affected Rows: 0
INSERT INTO test1 values (1, 1), (2, 2);
Affected Rows: 2
SELECT * FROM test1;
+---+-------------------------+
| i | j |
+---+-------------------------+
| 1 | 1970-01-01T00:00:00.001 |
| 2 | 1970-01-01T00:00:00.002 |
+---+-------------------------+
--- add ts1 column ---
ALTER TABLE test1 ADD COLUMN ts1 TIMESTAMP DEFAULT '2024-01-30 00:01:01' PRIMARY KEY;
Affected Rows: 0
INSERT INTO test1 values (3, 3, DEFAULT), (4, 4, '2024-01-31 00:01:01');
Affected Rows: 2
-- SQLNESS SORT_RESULT 3 1
SELECT i, ts1 FROM test1;
+---+---------------------+
| i | ts1 |
+---+---------------------+
| 1 | 2024-01-30T00:01:01 |
| 2 | 2024-01-30T00:01:01 |
| 3 | 2024-01-30T00:01:01 |
| 4 | 2024-01-31T00:01:01 |
+---+---------------------+
SET time_zone = 'Asia/Shanghai';
Affected Rows: 0
--- add ts2 column, default value is the same as ts1, but with different session timezone ---
ALTER TABLE test1 ADD COLUMN ts2 TIMESTAMP DEFAULT '2024-01-30 00:01:01' PRIMARY KEY;
Affected Rows: 0
INSERT INTO test1 values (5, 5, DEFAULT, DEFAULT), (6, 6, DEFAULT, '2024-01-31 00:01:01');
Affected Rows: 2
-- SQLNESS SORT_RESULT 3 1
SELECT i, ts1, ts2 FROM test1;
+---+---------------------+---------------------+
| i | ts1 | ts2 |
+---+---------------------+---------------------+
| 1 | 2024-01-30T00:01:01 | 2024-01-29T16:01:01 |
| 2 | 2024-01-30T00:01:01 | 2024-01-29T16:01:01 |
| 3 | 2024-01-30T00:01:01 | 2024-01-29T16:01:01 |
| 4 | 2024-01-31T00:01:01 | 2024-01-29T16:01:01 |
| 5 | 2024-01-30T00:01:01 | 2024-01-29T16:01:01 |
| 6 | 2024-01-30T00:01:01 | 2024-01-30T16:01:01 |
+---+---------------------+---------------------+
SET time_zone = 'UTC';
Affected Rows: 0
DROP TABLE test1;
Affected Rows: 0