Files
greptimedb/tests/upgrade-compat/standalone/common/table_engine_v0_11_0.sql
discord9 a59fef9ffb test: sqlness upgrade compatibility tests (#5126)
* feat: simple version switch

* chore: remove debug print

* chore: add common folder

* tests: add drop table

* feat: pull versioned binary

* chore: don't use native-tls

* chore: rm outdated docs

* chore: new line

* fix: save old bin dir

* fix: switch version restart all node

* feat: use etcd

* fix: wait for election

* fix: normal sqlness

* refactor: hashmap for bin dir

* test: past 3 major version compat crate table

* refactor: allow using without setup etcd
2024-12-20 14:12:19 +08:00

61 lines
1.6 KiB
SQL

-- SQLNESS ARG version=v0.11.0
CREATE TABLE mito_system_metrics (
host STRING,
idc STRING,
cpu_util DOUBLE,
memory_util DOUBLE,
disk_util DOUBLE,
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP(),
PRIMARY KEY(host, idc),
TIME INDEX(ts)
)ENGINE=mito;
INSERT INTO mito_system_metrics
VALUES
("host1", "idc_a", 11.8, 10.3, 10.3, 1667446797450),
("host2", "idc_a", 80.0, 70.3, 90.0, 1667446797450),
("host1", "idc_b", 50.0, 66.7, 40.6, 1667446797450);
CREATE TABLE phy (ts timestamp time index, cpu_util double) engine=metric with ("physical_metric_table" = "");
CREATE TABLE system_metrics (
host STRING,
cpu_util DOUBLE,
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP(),
PRIMARY KEY(host),
TIME INDEX(ts)
)ENGINE=metric with ("on_physical_table" = "phy");
INSERT INTO system_metrics (host, cpu_util, ts)
VALUES
('host1', 11.8, 1667446797450),
('host2', 80.0, 1667446797450),
('host1', 50.0, 1667446797450);
-- SQLNESS ARG version=latest
SHOW CREATE TABLE mito_system_metrics;
SHOW CREATE TABLE system_metrics;
INSERT INTO mito_system_metrics
VALUES
("host3", "idc_a", 90.0, 70.3, 90.0, 1667446797450),
("host4", "idc_a", 70.0, 70.3, 90.0, 1667446797450),
("host5", "idc_a", 60.0, 70.3, 90.0, 1667446797450);
INSERT INTO system_metrics (host, cpu_util, ts)
VALUES
('host3', 90.0, 1667446797450),
('host4', 70.0, 1667446797450),
('host5', 60.0, 1667446797450);
SELECT * FROM mito_system_metrics;
SELECT * FROM system_metrics;
DROP TABLE mito_system_metrics;
DROP TABLE system_metrics;
DROP TABLE phy;