test: add ssts limit compat case (#8427)

Signed-off-by: discord9 <discord9@163.com>
This commit is contained in:
discord9
2026-07-07 11:41:22 +08:00
committed by GitHub
parent 1d819a3982
commit c8c7e77cc3
4 changed files with 77 additions and 0 deletions

View File

@@ -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"

View 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');

View File

@@ -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 |
+-----------------------+

View 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
);