Skip to content

Commit f5c874f

Browse files
committed
wl#10147 changes after code review
1 parent cf183cb commit f5c874f

File tree

3 files changed

+51
-46
lines changed

3 files changed

+51
-46
lines changed

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

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,17 +1710,21 @@ reporting_node_id int(10) unsigned YES NULL
17101710
node_id int(10) unsigned YES NULL
17111711
node_type int(10) unsigned YES NULL
17121712
node_hostname varchar(512) YES NULL
1713-
show create table config_nodes;
1714-
View Create View character_set_client collation_connection
1715-
config_nodes CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `config_nodes` AS select distinct `ndb$config_nodes`.`node_id` AS `node_id`,(case `ndb$config_nodes`.`node_type` when 0 then 'NDB' when 1 then 'API' when 2 then 'MGM' else NULL end) AS `node_type`,`ndb$config_nodes`.`node_hostname` AS `node_hostname` from `ndb$config_nodes` order by `ndb$config_nodes`.`node_id` latin1 latin1_swedish_ci
1713+
select view_definition, is_updatable, security_type
1714+
FROM information_schema.views
1715+
WHERE table_schema = 'ndbinfo' AND table_name = 'config_nodes';
1716+
view_definition is_updatable security_type
1717+
select distinct `ndbinfo`.`ndb$config_nodes`.`node_id` AS `node_id`,(case `ndbinfo`.`ndb$config_nodes`.`node_type` when 0 then 'NDB' when 1 then 'API' when 2 then 'MGM' else NULL end) AS `node_type`,`ndbinfo`.`ndb$config_nodes`.`node_hostname` AS `node_hostname` from `ndbinfo`.`ndb$config_nodes` order by `ndbinfo`.`ndb$config_nodes`.`node_id` NO INVOKER
17161718

1717-
SELECT * from ndb$config_nodes;
1719+
SELECT * from ndb$config_nodes order by reporting_node_id, node_id;
17181720
reporting_node_id node_id node_type node_hostname
1721+
1 1 0 localhost
1722+
1 2 0 localhost
17191723
1 3 2 localhost
1720-
1 49 1 localhost
17211724
1 16 1 localhost
17221725
1 32 1 localhost
17231726
1 48 1 localhost
1727+
1 49 1 localhost
17241728
1 63 1 localhost
17251729
1 127 1 localhost
17261730
1 192 1 localhost
@@ -1731,13 +1735,13 @@ reporting_node_id node_id node_type node_hostname
17311735
1 232 1 localhost
17321736
1 233 1 localhost
17331737
1 255 1 localhost
1734-
1 1 0 localhost
1735-
1 2 0 localhost
1738+
2 1 0 localhost
1739+
2 2 0 localhost
17361740
2 3 2 localhost
1737-
2 49 1 localhost
17381741
2 16 1 localhost
17391742
2 32 1 localhost
17401743
2 48 1 localhost
1744+
2 49 1 localhost
17411745
2 63 1 localhost
17421746
2 127 1 localhost
17431747
2 192 1 localhost
@@ -1748,26 +1752,12 @@ reporting_node_id node_id node_type node_hostname
17481752
2 232 1 localhost
17491753
2 233 1 localhost
17501754
2 255 1 localhost
1751-
2 1 0 localhost
1752-
2 2 0 localhost
17531755

1754-
SELECT * from config_nodes;
1755-
node_id node_type node_hostname
1756-
1 NDB localhost
1757-
2 NDB localhost
1758-
3 MGM localhost
1759-
16 API localhost
1760-
32 API localhost
1761-
48 API localhost
1762-
49 API localhost
1763-
63 API localhost
1764-
127 API localhost
1765-
192 API localhost
1766-
228 API localhost
1767-
229 API localhost
1768-
230 API localhost
1769-
231 API localhost
1770-
232 API localhost
1771-
233 API localhost
1772-
255 API localhost
1756+
SELECT node_type, count(*),
1757+
GROUP_CONCAT(node_id order by 1 asc separator " ") ids
1758+
FROM config_nodes group by node_type order by node_type;
1759+
node_type count(*) ids
1760+
API 14 16 32 48 49 63 127 192 228 229 230 231 232 233 255
1761+
MGM 1 3
1762+
NDB 2 1 2
17731763

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -884,13 +884,17 @@ ORDER BY node_id;
884884
#
885885
# (A) Normative tests of table and view definition
886886
desc ndb$config_nodes;
887-
show create table config_nodes;
887+
select view_definition, is_updatable, security_type
888+
FROM information_schema.views
889+
WHERE table_schema = 'ndbinfo' AND table_name = 'config_nodes';
888890

889891
# (B) Tests of table content.
890892
# These results will change if the cluster config used when running
891893
# this test case changes.
892-
SELECT * from ndb$config_nodes;
894+
SELECT * from ndb$config_nodes order by reporting_node_id, node_id;
893895

894896
# (C) Tests of view: SELECT DISTINCT, removing reporting_node_id
895-
SELECT * from config_nodes;
897+
SELECT node_type, count(*),
898+
GROUP_CONCAT(node_id order by 1 asc separator " ") ids
899+
FROM config_nodes group by node_type order by node_type;
896900

storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,24 +2229,35 @@ void Cmvmi::execDBINFO_SCANREQ(Signal *signal)
22292229
case Ndbinfo::CONFIG_NODES_TABLEID:
22302230
{
22312231
jam();
2232-
Ndbinfo::Ratelimit rl;
22332232
ndb_mgm_configuration_iterator * iter = m_ctx.m_config.getClusterConfigIterator();
2233+
Uint32 row_num, sent_row_num = cursor->data[0];
22342234

2235-
for(ndb_mgm_first(iter); ndb_mgm_valid(iter); ndb_mgm_next(iter))
2235+
for(row_num = 1, ndb_mgm_first(iter);
2236+
ndb_mgm_valid(iter);
2237+
row_num++, ndb_mgm_next(iter))
22362238
{
2237-
Uint32 row_node_id, row_node_type;
2238-
const char * hostname;
2239-
Ndbinfo::Row row(signal, req);
2240-
row.write_uint32(getOwnNodeId());
2241-
ndb_mgm_get_int_parameter(iter, CFG_NODE_ID, & row_node_id);
2242-
row.write_uint32(row_node_id);
2243-
ndb_mgm_get_int_parameter(iter, CFG_TYPE_OF_SECTION, & row_node_type);
2244-
row.write_uint32(row_node_type);
2245-
ndb_mgm_get_string_parameter(iter, CFG_NODE_HOST, & hostname);
2246-
row.write_string(hostname);
2247-
ndbinfo_send_row(signal, req, row, rl);
2239+
if(row_num > sent_row_num)
2240+
{
2241+
Uint32 row_node_id, row_node_type;
2242+
const char * hostname;
2243+
Ndbinfo::Row row(signal, req);
2244+
row.write_uint32(getOwnNodeId());
2245+
ndb_mgm_get_int_parameter(iter, CFG_NODE_ID, & row_node_id);
2246+
row.write_uint32(row_node_id);
2247+
ndb_mgm_get_int_parameter(iter, CFG_TYPE_OF_SECTION, & row_node_type);
2248+
row.write_uint32(row_node_type);
2249+
ndb_mgm_get_string_parameter(iter, CFG_NODE_HOST, & hostname);
2250+
row.write_string(hostname);
2251+
ndbinfo_send_row(signal, req, row, rl);
2252+
2253+
if (rl.need_break(req))
2254+
{
2255+
jam();
2256+
ndbinfo_send_scan_break(signal, req, rl, row_num);
2257+
return;
2258+
}
2259+
}
22482260
}
2249-
22502261
break;
22512262
}
22522263

0 commit comments

Comments
 (0)