mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-07-09 07:20:39 +00:00
test: add ssts limit compat case (#8427)
Signed-off-by: discord9 <discord9@163.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
name = "ssts_limit_old_manifest"
|
||||
reason = "Verify distributed information_schema.ssts_manifest LIMIT queries over SSTs written by old binaries obey a global limit."
|
||||
introduced_by = "PR #8412"
|
||||
topologies = ["distributed"]
|
||||
from_range = ["*"]
|
||||
to_range = [">v1.1.1"]
|
||||
features = ["information_schema", "sst", "metadata", "table", "query"]
|
||||
owner = "query"
|
||||
17
tests/compatibility/cases/ssts_limit_old_manifest/setup.sql
Normal file
17
tests/compatibility/cases/ssts_limit_old_manifest/setup.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE ssts_limit_old_manifest_table (
|
||||
a INT PRIMARY KEY,
|
||||
b STRING,
|
||||
ts TIMESTAMP TIME INDEX
|
||||
)
|
||||
PARTITION ON COLUMNS (a) (
|
||||
a < 1000,
|
||||
a >= 1000 AND a < 2000,
|
||||
a >= 2000
|
||||
);
|
||||
|
||||
INSERT INTO ssts_limit_old_manifest_table VALUES
|
||||
(500, 'a', '2026-07-06 00:00:00+0000'),
|
||||
(1500, 'b', '2026-07-06 00:01:00+0000'),
|
||||
(2500, 'c', '2026-07-06 00:02:00+0000');
|
||||
|
||||
ADMIN FLUSH_TABLE('ssts_limit_old_manifest_table');
|
||||
@@ -0,0 +1,35 @@
|
||||
SELECT COUNT(DISTINCT node_id) > 1 AS has_multi_datanodes
|
||||
FROM information_schema.ssts_manifest;
|
||||
|
||||
+---------------------+
|
||||
| has_multi_datanodes |
|
||||
+---------------------+
|
||||
| true |
|
||||
+---------------------+
|
||||
|
||||
SELECT COUNT(*) AS limited_rows
|
||||
FROM (
|
||||
SELECT region_id
|
||||
FROM information_schema.ssts_manifest
|
||||
LIMIT 1
|
||||
);
|
||||
|
||||
+--------------+
|
||||
| limited_rows |
|
||||
+--------------+
|
||||
| 1 |
|
||||
+--------------+
|
||||
|
||||
SELECT COUNT(*) AS filtered_limited_rows
|
||||
FROM (
|
||||
SELECT region_id
|
||||
FROM information_schema.ssts_manifest
|
||||
WHERE region_id > 0
|
||||
LIMIT 1
|
||||
);
|
||||
|
||||
+-----------------------+
|
||||
| filtered_limited_rows |
|
||||
+-----------------------+
|
||||
| 1 |
|
||||
+-----------------------+
|
||||
17
tests/compatibility/cases/ssts_limit_old_manifest/verify.sql
Normal file
17
tests/compatibility/cases/ssts_limit_old_manifest/verify.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
SELECT COUNT(DISTINCT node_id) > 1 AS has_multi_datanodes
|
||||
FROM information_schema.ssts_manifest;
|
||||
|
||||
SELECT COUNT(*) AS limited_rows
|
||||
FROM (
|
||||
SELECT region_id
|
||||
FROM information_schema.ssts_manifest
|
||||
LIMIT 1
|
||||
);
|
||||
|
||||
SELECT COUNT(*) AS filtered_limited_rows
|
||||
FROM (
|
||||
SELECT region_id
|
||||
FROM information_schema.ssts_manifest
|
||||
WHERE region_id > 0
|
||||
LIMIT 1
|
||||
);
|
||||
Reference in New Issue
Block a user