mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-07-04 13:00:38 +00:00
* test: add recent sqlness compat cases Signed-off-by: discord9 <discord9@163.com> * test: add more sqlness compat cases Signed-off-by: discord9 <discord9@163.com> --------- Signed-off-by: discord9 <discord9@163.com>
42 lines
2.1 KiB
Plaintext
42 lines
2.1 KiB
Plaintext
SELECT ts, host, val, msg, score FROM t_column_default ORDER BY ts, host;
|
|
|
|
+---------------------+--------+-----+----------+-------+
|
|
| ts | host | val | msg | score |
|
|
+---------------------+--------+-----+----------+-------+
|
|
| 2024-02-03T00:00:00 | host_a | 42 | hello | 1.5 |
|
|
| 2024-02-03T00:01:00 | host_b | 42 | hello | 1.5 |
|
|
| 2024-02-03T00:02:00 | host_c | 100 | override | 9.5 |
|
|
+---------------------+--------+-----+----------+-------+
|
|
|
|
INSERT INTO t_column_default (ts, host) VALUES
|
|
('2024-02-03 00:03:00+0000', 'host_d');
|
|
|
|
Affected Rows: 1
|
|
|
|
SELECT ts, host, val, msg, score FROM t_column_default WHERE host = 'host_d';
|
|
|
|
+---------------------+--------+-----+-------+-------+
|
|
| ts | host | val | msg | score |
|
|
+---------------------+--------+-----+-------+-------+
|
|
| 2024-02-03T00:03:00 | host_d | 42 | hello | 1.5 |
|
|
+---------------------+--------+-----+-------+-------+
|
|
|
|
SHOW CREATE TABLE t_column_default;
|
|
|
|
+------------------+-------------------------------------------------+
|
|
| Table | Create Table |
|
|
+------------------+-------------------------------------------------+
|
|
| t_column_default | CREATE TABLE IF NOT EXISTS "t_column_default" ( |
|
|
| | "ts" TIMESTAMP(3) NOT NULL, |
|
|
| | "host" STRING NULL, |
|
|
| | "val" INT NULL DEFAULT 42, |
|
|
| | "msg" STRING NULL DEFAULT 'hello', |
|
|
| | "score" DOUBLE NULL DEFAULT 1.5, |
|
|
| | TIME INDEX ("ts"), |
|
|
| | PRIMARY KEY ("host") |
|
|
| | ) |
|
|
| | |
|
|
| | ENGINE=mito |
|
|
| | |
|
|
+------------------+-------------------------------------------------+
|