Skip to content

Commit

Permalink
fix: cluster_info result
Browse files Browse the repository at this point in the history
  • Loading branch information
killme2008 committed Apr 29, 2024
1 parent 6f68436 commit d5d997d
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 64 deletions.
53 changes: 15 additions & 38 deletions tests/cases/distributed/information_schema/cluster_info.result
Original file line number Diff line number Diff line change
Expand Up @@ -22,82 +22,59 @@ DESC TABLE CLUSTER_INFO;
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s\s*)+) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO ORDER BY peer_type;

+---------+-----------+----------------+---------+------------+-------------------------+----------+
| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime|
+---------+-----------+----------------+---------+------------+-------------------------+----------+
| 1 | DATANODE | 127.0.0.1:4101 |Version |Hash |Start_time|Uptime|
| 2 | DATANODE | 127.0.0.1:4102 |Version |Hash |Start_time|Uptime|
| 3 | DATANODE | 127.0.0.1:4103 |Version |Hash |Start_time|Uptime|
| 0 | FRONTEND | 127.0.0.1:4001 |Version |Hash |Start_time|Uptime |
| 0 | METASRV | 127.0.0.1:3002 | UNKNOWN | UNKNOWN | | |
+---------+-----------+----------------+---------+------------+-------------------------+----------+
++++++++|peer_id|peer_type|peer_addr|node_version|git_commit|start_time|uptime|++++++++|1|DATANODE|127.0.0.1:4101|Version|Hash|Start_time|Uptime||2|DATANODE|127.0.0.1:4102|Version|Hash|Start_time|Uptime||3|DATANODE|127.0.0.1:4103|Version|Hash|Start_time|Uptime||0|FRONTEND|127.0.0.1:4001|Version|Hash|Start_time|Uptime||0|METASRV|127.0.0.1:3002|UNKNOWN|UNKNOWN|||++++++++

-- SQLNESS REPLACE version node_version
-- SQLNESS REPLACE unknown UNKNOWN
-- SQLNESS REPLACE (\s\d\.\d\.\d\s) Version
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+\s*) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'METASRV' ORDER BY peer_type;

+---------+-----------+----------------+---------+------------+------------+--------+
| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime|
+---------+-----------+----------------+---------+------------+------------+--------+
| 0 | METASRV | 127.0.0.1:3002 | UNKNOWN | UNKNOWN | | |
+---------+-----------+----------------+---------+------------+------------+--------+
++++++++|peer_id|peer_type|peer_addr|node_version|git_commit|start_time|uptime|++++++++|0|METASRV|127.0.0.1:3002|UNKNOWN|UNKNOWN|||++++++++

-- SQLNESS REPLACE version node_version
-- SQLNESS REPLACE unknown UNKNOWN
-- SQLNESS REPLACE (\s\d\.\d\.\d\s) Version
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+\s*) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'FRONTEND' ORDER BY peer_type;

+---------+-----------+----------------+---------+------------+-------------------------+--------+
| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime|
+---------+-----------+----------------+---------+------------+-------------------------+--------+
| 0 | FRONTEND | 127.0.0.1:4001 |Version |Hash |Start_time|Uptime |
+---------+-----------+----------------+---------+------------+-------------------------+--------+
++++++++|peer_id|peer_type|peer_addr|node_version|git_commit|start_time|uptime|++++++++|0|FRONTEND|127.0.0.1:4001|Version|Hash|Start_time|Uptime|++++++++

-- SQLNESS REPLACE version node_version
-- SQLNESS REPLACE unknown UNKNOWN
-- SQLNESS REPLACE (\s\d\.\d\.\d\s) Version
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+\s*) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE != 'FRONTEND' ORDER BY peer_type;

+---------+-----------+----------------+---------+------------+-------------------------+----------+
| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime|
+---------+-----------+----------------+---------+------------+-------------------------+----------+
| 1 | DATANODE | 127.0.0.1:4101 |Version |Hash |Start_time|Uptime|
| 2 | DATANODE | 127.0.0.1:4102 |Version |Hash |Start_time|Uptime|
| 3 | DATANODE | 127.0.0.1:4103 |Version |Hash |Start_time|Uptime|
| 0 | METASRV | 127.0.0.1:3002 | UNKNOWN | UNKNOWN | | |
+---------+-----------+----------------+---------+------------+-------------------------+----------+
++++++++|peer_id|peer_type|peer_addr|node_version|git_commit|start_time|uptime|++++++++|1|DATANODE|127.0.0.1:4101|Version|Hash|Start_time|Uptime||2|DATANODE|127.0.0.1:4102|Version|Hash|Start_time|Uptime||3|DATANODE|127.0.0.1:4103|Version|Hash|Start_time|Uptime||0|METASRV|127.0.0.1:3002|UNKNOWN|UNKNOWN|||++++++++

-- SQLNESS REPLACE version node_version
-- SQLNESS REPLACE unknown UNKNOWN
-- SQLNESS REPLACE (\s\d\.\d\.\d\s) Version
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+\s*) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO WHERE PEER_ID > 1 ORDER BY peer_type;

+---------+-----------+----------------+---------+------------+-------------------------+----------+
| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime|
+---------+-----------+----------------+---------+------------+-------------------------+----------+
| 2 | DATANODE | 127.0.0.1:4102 |Version |Hash |Start_time|Uptime|
| 3 | DATANODE | 127.0.0.1:4103 |Version |Hash |Start_time|Uptime|
+---------+-----------+----------------+---------+------------+-------------------------+----------+
++++++++|peer_id|peer_type|peer_addr|node_version|git_commit|start_time|uptime|++++++++|2|DATANODE|127.0.0.1:4102|Version|Hash|Start_time|Uptime||3|DATANODE|127.0.0.1:4103|Version|Hash|Start_time|Uptime|++++++++

USE PUBLIC;

Expand Down
15 changes: 10 additions & 5 deletions tests/cases/distributed/information_schema/cluster_info.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ DESC TABLE CLUSTER_INFO;
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s\s*)+) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO ORDER BY peer_type;

-- SQLNESS REPLACE version node_version
Expand All @@ -17,7 +18,8 @@ SELECT * FROM CLUSTER_INFO ORDER BY peer_type;
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+\s*) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'METASRV' ORDER BY peer_type;

-- SQLNESS REPLACE version node_version
Expand All @@ -26,7 +28,8 @@ SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'METASRV' ORDER BY peer_type;
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+\s*) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'FRONTEND' ORDER BY peer_type;

-- SQLNESS REPLACE version node_version
Expand All @@ -35,7 +38,8 @@ SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'FRONTEND' ORDER BY peer_type;
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+\s*) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE != 'FRONTEND' ORDER BY peer_type;

-- SQLNESS REPLACE version node_version
Expand All @@ -44,7 +48,8 @@ SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE != 'FRONTEND' ORDER BY peer_type;
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+\s*) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO WHERE PEER_ID > 1 ORDER BY peer_type;

USE PUBLIC;
27 changes: 9 additions & 18 deletions tests/cases/standalone/information_schema/cluster_info.result
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,22 @@ DESC TABLE CLUSTER_INFO;
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+\s*) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO;

+---------+------------+-----------+---------+------------+-------------------------+--------+
| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime|
+---------+------------+-----------+---------+------------+-------------------------+--------+
| 0 | STANDALONE | | Version |Hash |Start_time|Uptime |
+---------+------------+-----------+---------+------------+-------------------------+--------+
++++++++|peer_id|peer_type|peer_addr|node_version|git_commit|start_time|uptime|++++++++|0|STANDALONE||Version|Hash|Start_time|Uptime|++++++++

-- SQLNESS REPLACE version node_version
-- SQLNESS REPLACE (\d\.\d\.\d) Version
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+\s*) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'STANDALONE';

+---------+------------+-----------+---------+------------+-------------------------+--------+
| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime|
+---------+------------+-----------+---------+------------+-------------------------+--------+
| 0 | STANDALONE | | Version |Hash |Start_time|Uptime |
+---------+------------+-----------+---------+------------+-------------------------+--------+
++++++++|peer_id|peer_type|peer_addr|node_version|git_commit|start_time|uptime|++++++++|0|STANDALONE||Version|Hash|Start_time|Uptime|++++++++

SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE != 'STANDALONE';

Expand All @@ -54,14 +48,11 @@ SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE != 'STANDALONE';
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+\s*) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO WHERE PEER_ID = 0;

+---------+------------+-----------+---------+------------+-------------------------+--------+
| peer_id | peer_type | peer_addr | node_version | git_commit | start_time |uptime|
+---------+------------+-----------+---------+------------+-------------------------+--------+
| 0 | STANDALONE | | Version |Hash |Start_time|Uptime |
+---------+------------+-----------+---------+------------+-------------------------+--------+
++++++++|peer_id|peer_type|peer_addr|node_version|git_commit|start_time|uptime|++++++++|0|STANDALONE||Version|Hash|Start_time|Uptime|++++++++

SELECT * FROM CLUSTER_INFO WHERE PEER_ID > 0;

Expand Down
9 changes: 6 additions & 3 deletions tests/cases/standalone/information_schema/cluster_info.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ DESC TABLE CLUSTER_INFO;
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+\s*) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO;

-- SQLNESS REPLACE version node_version
-- SQLNESS REPLACE (\d\.\d\.\d) Version
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+\s*) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE = 'STANDALONE';

SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE != 'STANDALONE';
Expand All @@ -25,7 +27,8 @@ SELECT * FROM CLUSTER_INFO WHERE PEER_TYPE != 'STANDALONE';
-- SQLNESS REPLACE (\s[a-z0-9]{7}\s) Hash
-- SQLNESS REPLACE (\s[\-0-9T:\.]{23}\s) Start_time
-- SQLNESS REPLACE (\s+uptime\s+) uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+) Uptime
-- SQLNESS REPLACE (\s+(\d+(s|ms|m)\s)+\s*) Uptime
-- SQLNESS REPLACE [\s\-]+
SELECT * FROM CLUSTER_INFO WHERE PEER_ID = 0;

SELECT * FROM CLUSTER_INFO WHERE PEER_ID > 0;
Expand Down

0 comments on commit d5d997d

Please sign in to comment.