mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-09 06:42:57 +00:00
* test: adds sqlness test for TTL * chore: restart cluster * fix: typo * test: adds database TTL with metric engine tables
44 lines
746 B
Plaintext
44 lines
746 B
Plaintext
CREATE TABLE test_ttl(ts TIMESTAMP TIME INDEX, val INT) WITH (ttl = '1 second');
|
|
|
|
Affected Rows: 0
|
|
|
|
INSERT INTO test_ttl VALUES
|
|
(now(), 1);
|
|
|
|
Affected Rows: 1
|
|
|
|
SELECT val from test_ttl;
|
|
|
|
+-----+
|
|
| val |
|
|
+-----+
|
|
| 1 |
|
|
+-----+
|
|
|
|
-- SQLNESS SLEEP 2s
|
|
ADMIN flush_table('test_ttl');
|
|
|
|
+-------------------------------+
|
|
| ADMIN flush_table('test_ttl') |
|
|
+-------------------------------+
|
|
| 0 |
|
|
+-------------------------------+
|
|
|
|
ADMIN compact_table('test_ttl');
|
|
|
|
+---------------------------------+
|
|
| ADMIN compact_table('test_ttl') |
|
|
+---------------------------------+
|
|
| 0 |
|
|
+---------------------------------+
|
|
|
|
SELECT val from test_ttl;
|
|
|
|
++
|
|
++
|
|
|
|
DROP TABLE test_ttl;
|
|
|
|
Affected Rows: 0
|
|
|