Skip to content

Commit dd68e9f

Browse files
committed
wl#9819 patch #14: mtr test for ndbinfo.processes
1 parent fe1415c commit dd68e9f

File tree

2 files changed

+93
-1
lines changed

2 files changed

+93
-1
lines changed

mysql-test/suite/ndb/r/ndbinfo.result

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ table_id table_name comment
8282
35 table_fragments_all Partitions of the tables
8383
36 table_replicas_all Fragment replicas of the tables
8484
37 stored_tables Information about stored tables
85+
38 processes Process ID and Name information for connected nodes
8586
SELECT COUNT(*) FROM ndb$tables;
8687
COUNT(*)
87-
38
88+
39
8889
SELECT * FROM ndb$tables WHERE table_id = 2;
8990
table_id table_name comment
9091
2 test for testing
@@ -122,6 +123,7 @@ table_id table_name comment
122123
35 table_fragments_all Partitions of the tables
123124
36 table_replicas_all Fragment replicas of the tables
124125
37 stored_tables Information about stored tables
126+
38 processes Process ID and Name information for connected nodes
125127
SELECT * FROM ndb$tables WHERE table_name = 'LOGDESTINATION';
126128
table_id table_name comment
127129
SELECT COUNT(*) FROM ndb$tables t, ndb$columns c
@@ -162,6 +164,7 @@ table_id table_name
162164
9 nodes
163165
14 operations
164166
3 pools
167+
38 processes
165168
7 resources
166169
21 restart_info
167170
37 stored_tables
@@ -252,6 +255,7 @@ table_id
252255
35
253256
36
254257
37
258+
38
255259

256260
TRUNCATE ndb$tables;
257261
ERROR HY000: Table 'ndb$tables' is read only
@@ -1638,3 +1642,61 @@ node_id DataMemory
16381642
1 20M
16391643
2 20M
16401644

1645+
desc ndb$processes;
1646+
Field Type Null Key Default Extra
1647+
reporting_node_id int(10) unsigned YES NULL
1648+
node_id int(10) unsigned YES NULL
1649+
node_type int(10) unsigned YES NULL
1650+
host_addr varchar(512) YES NULL
1651+
node_version varchar(512) YES NULL
1652+
process_id int(10) unsigned YES NULL
1653+
angel_process_id int(10) unsigned YES NULL
1654+
process_name varchar(512) YES NULL
1655+
connection_name varchar(512) YES NULL
1656+
application_port int(10) unsigned YES NULL
1657+
show create table processes;
1658+
View Create View character_set_client collation_connection
1659+
processes CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `processes` AS select distinct `ndb$processes`.`node_id` AS `node_id`,(case `ndb$processes`.`node_type` when 0 then 'NDB' when 1 then 'API' when 2 then 'MGM' else NULL end) AS `node_type`,`ndb$processes`.`host_addr` AS `host_addr`,`ndb$processes`.`node_version` AS `node_version`,nullif(`ndb$processes`.`process_id`,0) AS `process_id`,nullif(`ndb$processes`.`angel_process_id`,0) AS `angel_process_id`,`ndb$processes`.`process_name` AS `process_name`,`ndb$processes`.`connection_name` AS `connection_name`,nullif(`ndb$processes`.`application_port`,0) AS `application_port` from `ndb$processes` latin1 latin1_swedish_ci
1660+
1661+
SELECT reporting_node_id, node_id, node_type, process_name, connection_name
1662+
FROM ndb$processes
1663+
ORDER BY reporting_node_id, node_id;
1664+
reporting_node_id node_id node_type process_name connection_name
1665+
1 1 0 ndbmtd
1666+
1 3 2 ndb_mgmd
1667+
1 16 1 mysqld mysqld --server-id=2
1668+
1 32 1 mysqld mysqld --server-id=2 (connection 2)
1669+
1 48 1 mysqld mysqld --server-id=2 (connection 3)
1670+
1 49 1 mysqld mysqld --server-id=1
1671+
1 63 1 mysqld mysqld --server-id=1 (connection 2)
1672+
1 127 1 mysqld mysqld --server-id=1 (connection 3)
1673+
2 2 0 ndbmtd
1674+
2 3 2 ndb_mgmd
1675+
2 16 1 mysqld mysqld --server-id=2
1676+
2 32 1 mysqld mysqld --server-id=2 (connection 2)
1677+
2 48 1 mysqld mysqld --server-id=2 (connection 3)
1678+
2 49 1 mysqld mysqld --server-id=1
1679+
2 63 1 mysqld mysqld --server-id=1 (connection 2)
1680+
2 127 1 mysqld mysqld --server-id=1 (connection 3)
1681+
1682+
SELECT node_id,
1683+
node_type,
1684+
process_name,
1685+
if(process_id is null, "null", "not_null") as proc_id,
1686+
if(angel_process_id is null, "null", "not_null") as angel_proc_id,
1687+
process_name,
1688+
connection_name,
1689+
if(application_port is null, "null", "not_null") as port
1690+
FROM processes
1691+
ORDER BY node_id;
1692+
node_id node_type process_name proc_id angel_proc_id process_name connection_name port
1693+
1 NDB ndbmtd not_null not_null ndbmtd null
1694+
2 NDB ndbmtd not_null not_null ndbmtd null
1695+
3 MGM ndb_mgmd not_null null ndb_mgmd not_null
1696+
16 API mysqld not_null null mysqld mysqld --server-id=2 not_null
1697+
32 API mysqld not_null null mysqld mysqld --server-id=2 (connection 2) not_null
1698+
48 API mysqld not_null null mysqld mysqld --server-id=2 (connection 3) not_null
1699+
49 API mysqld not_null null mysqld mysqld --server-id=1 not_null
1700+
63 API mysqld not_null null mysqld mysqld --server-id=1 (connection 2) not_null
1701+
127 API mysqld not_null null mysqld mysqld --server-id=1 (connection 3) not_null
1702+

mysql-test/suite/ndb/t/ndbinfo.test

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,3 +849,33 @@ select node_id, concat(config_value / 1024 / 1024, 'M') as DataMemory
849849
where config_param = 112 /* DataMemory */
850850
order by node_id;
851851

852+
853+
#
854+
# wl#9819 ndbinfo.processes
855+
#
856+
857+
# (A) Normative tests of table and view definition
858+
desc ndb$processes;
859+
show create table processes;
860+
861+
# (B) Tests of table content.
862+
# These results will change if the cluster config used when running
863+
# this test case changes.
864+
865+
# Query the base table
866+
SELECT reporting_node_id, node_id, node_type, process_name, connection_name
867+
FROM ndb$processes
868+
ORDER BY reporting_node_id, node_id;
869+
870+
# Query the view
871+
SELECT node_id,
872+
node_type,
873+
process_name,
874+
if(process_id is null, "null", "not_null") as proc_id,
875+
if(angel_process_id is null, "null", "not_null") as angel_proc_id,
876+
process_name,
877+
connection_name,
878+
if(application_port is null, "null", "not_null") as port
879+
FROM processes
880+
ORDER BY node_id;
881+

0 commit comments

Comments
 (0)