-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:
region_peers
returns same region_id for multi logical tables (#…
…4190) * fix: `region_peers` returns same region_id for multi logical tables * test: add sqlness test for information_schema.region_peers * refactor: region_peers sqlness
- Loading branch information
Showing
3 changed files
with
97 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
tests/cases/standalone/common/information_schema/region_peers.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- test information_schema.region_peers ---- | ||
USE INFORMATION_SCHEMA; | ||
|
||
Affected Rows: 0 | ||
|
||
CREATE TABLE region_peers_phy (ts timestamp time index, val double) engine = metric with ("physical_metric_table" = ""); | ||
|
||
Affected Rows: 0 | ||
|
||
CREATE TABLE region_peers_t1 ( | ||
ts timestamp time index, | ||
val double, | ||
host string primary key | ||
) engine = metric with ("on_physical_table" = "region_peers_phy"); | ||
|
||
Affected Rows: 0 | ||
|
||
CREATE TABLE region_peers_t2 ( | ||
ts timestamp time index, | ||
job string primary key, | ||
val double | ||
) engine = metric with ("on_physical_table" = "region_peers_phy"); | ||
|
||
Affected Rows: 0 | ||
|
||
CREATE TABLE region_peers_test ( | ||
a int primary key, | ||
b string, | ||
ts timestamp time index, | ||
) PARTITION ON COLUMNS (a) ( | ||
a < 10, | ||
a >= 10 AND a < 20, | ||
a >= 20, | ||
); | ||
|
||
Affected Rows: 0 | ||
|
||
SELECT COUNT(distinct region_id) FROM region_peers; | ||
|
||
+----------------------------------------+ | ||
| COUNT(DISTINCT region_peers.region_id) | | ||
+----------------------------------------+ | ||
| 6 | | ||
+----------------------------------------+ | ||
|
||
DROP TABLE region_peers_t1, region_peers_t2, region_peers_phy, region_peers_test; | ||
|
||
Affected Rows: 0 | ||
|
||
USE public; | ||
|
||
Affected Rows: 0 | ||
|
34 changes: 34 additions & 0 deletions
34
tests/cases/standalone/common/information_schema/region_peers.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- test information_schema.region_peers ---- | ||
USE INFORMATION_SCHEMA; | ||
|
||
CREATE TABLE region_peers_phy (ts timestamp time index, val double) engine = metric with ("physical_metric_table" = ""); | ||
|
||
CREATE TABLE region_peers_t1 ( | ||
ts timestamp time index, | ||
val double, | ||
host string primary key | ||
) engine = metric with ("on_physical_table" = "region_peers_phy"); | ||
|
||
CREATE TABLE region_peers_t2 ( | ||
ts timestamp time index, | ||
job string primary key, | ||
val double | ||
) engine = metric with ("on_physical_table" = "region_peers_phy"); | ||
|
||
CREATE TABLE region_peers_test ( | ||
a int primary key, | ||
b string, | ||
ts timestamp time index, | ||
) PARTITION ON COLUMNS (a) ( | ||
a < 10, | ||
a >= 10 AND a < 20, | ||
a >= 20, | ||
); | ||
|
||
SELECT COUNT(distinct region_id) FROM region_peers; | ||
|
||
DROP TABLE region_peers_t1, region_peers_t2, region_peers_phy, region_peers_test; | ||
|
||
USE public; | ||
|
||
|