Skip to content

Commit d3f0c9d

Browse files
phulakundahlerlend
authored andcommitted
WL#6599 - New Data Dictionary and I_S integration.
This is a post-fix patch to fix test failures with NDB. Following are the changes done, - Ignore 'ndbinfo' schema to be exposed by I_S system views. schema 'ndbinfo' and its tables are hidden when ndb cluster engine is not running or system variable "show_hidden" ( exported by ndb plugin) is not set. In 5.7, ha_find_files() is called to check if the 'ndbinfo' schema and its table are hidden or not. Similarly, CAN_ACCESS_* UDFs used by I_S system views are modified to ignore 'ndbinfo' schema and its tables if they are hidden by calling ha_find_files(). - Adjust test cases to mask ndb% tables from I_S queries in test cases.
1 parent 96eef56 commit d3f0c9d

15 files changed

+222
-43
lines changed

mysql-test/r/dd_is_compatibility.result

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ table_name
150150
# 2. The view names in I_S.tables are in upper case.
151151
CREATE VIEW v1 AS SELECT table_name
152152
FROM information_schema.tables
153-
WHERE table_schema LIKE 'information_schema' AND table_name NOT LIKE 'INNODB%'
153+
WHERE table_schema LIKE 'information_schema'
154+
AND table_name NOT LIKE 'INNODB%'
155+
AND table_name NOT LIKE 'ndb%'
154156
ORDER BY table_name COLLATE UTF8_GENERAL_CI;
155157
SELECT * FROM v1;
156158
table_name

mysql-test/r/dd_is_compatibility_ci.result

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ table_name
150150
# 2. The view names in I_S.tables are in upper case.
151151
CREATE VIEW v1 AS SELECT table_name
152152
FROM information_schema.tables
153-
WHERE table_schema LIKE 'information_schema' AND table_name NOT LIKE 'INNODB%'
153+
WHERE table_schema LIKE 'information_schema'
154+
AND table_name NOT LIKE 'INNODB%'
155+
AND table_name NOT LIKE 'ndb%'
154156
ORDER BY table_name COLLATE UTF8_GENERAL_CI;
155157
SELECT * FROM v1;
156158
table_name

mysql-test/r/information_schema.result

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,11 @@ explain select a.ROUTINE_NAME from information_schema.ROUTINES a,
313313
information_schema.SCHEMATA b where
314314
a.ROUTINE_SCHEMA = CONVERT(b.SCHEMA_NAME USING UTF8);
315315
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
316-
1 SIMPLE # NULL index PRIMARY name 194 NULL # 100.00 Using index
317-
1 SIMPLE # NULL ALL NULL NULL NULL NULL # NULL Using join buffer (Block Nested Loop)
318-
1 SIMPLE # NULL ALL catalog_id,default_collation_id NULL NULL NULL # 100.00 Using where; Using join buffer (Block Nested Loop)
319-
1 SIMPLE # NULL eq_ref PRIMARY,character_set_id PRIMARY 8 mysql.sch.default_collation_id # 100.00 NULL
320-
1 SIMPLE # NULL eq_ref PRIMARY PRIMARY 8 mysql.col.character_set_id # 100.00 Using index
316+
1 SIMPLE # NULL index PRIMARY name 194 NULL # # Using index
317+
1 SIMPLE # NULL ALL NULL NULL NULL NULL # # Using join buffer (Block Nested Loop)
318+
1 SIMPLE # NULL ALL catalog_id,default_collation_id NULL NULL NULL # # Using where; Using join buffer (Block Nested Loop)
319+
1 SIMPLE # NULL eq_ref PRIMARY,character_set_id PRIMARY 8 mysql.sch.default_collation_id # # NULL
320+
1 SIMPLE # NULL eq_ref PRIMARY PRIMARY 8 mysql.col.character_set_id # # Using index
321321
Warnings:
322322
Note 1003 #
323323
select count(*) from information_schema.ROUTINES where routine_schema='test';
@@ -382,10 +382,10 @@ sys
382382
test
383383
explain select * from v0;
384384
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
385-
1 SIMPLE # NULL index PRIMARY name 194 NULL 1 100.00 Using index; Using temporary; Using filesort
386-
1 SIMPLE # NULL ALL catalog_id,default_collation_id NULL NULL NULL 6 100.00 Using where; Using join buffer (Block Nested Loop)
387-
1 SIMPLE # NULL eq_ref PRIMARY,character_set_id PRIMARY 8 mysql.sch.default_collation_id 1 100.00 NULL
388-
1 SIMPLE # NULL eq_ref PRIMARY PRIMARY 8 mysql.col.character_set_id 1 100.00 Using index
385+
1 SIMPLE # NULL index PRIMARY name 194 NULL # # Using index; Using temporary; Using filesort
386+
1 SIMPLE # NULL ALL catalog_id,default_collation_id NULL NULL NULL # # Using where; Using join buffer (Block Nested Loop)
387+
1 SIMPLE # NULL eq_ref PRIMARY,character_set_id PRIMARY 8 mysql.sch.default_collation_id # # NULL
388+
1 SIMPLE # NULL eq_ref PRIMARY PRIMARY 8 mysql.col.character_set_id # # Using index
389389
Warnings:
390390
Note 1003 #
391391
create view v1 (c) as select table_name from information_schema.tables
@@ -2118,3 +2118,13 @@ disconnect con1;
21182118
# Clean up.
21192119
connection default;
21202120
DROP VIEW v1;
2121+
#
2122+
# WL#6599: New Data Dictionary and I_S Integration.
2123+
#
2124+
# Test case to check if ndbinfo schema is listed by I_S when ndbcluster
2125+
# is not running.
2126+
#
2127+
SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'ndbinfo';
2128+
SCHEMA_NAME
2129+
SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'ndbinfo';
2130+
TABLE_NAME

mysql-test/r/information_schema_ci.result

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,11 @@ explain select a.ROUTINE_NAME from information_schema.ROUTINES a,
313313
information_schema.SCHEMATA b where
314314
a.ROUTINE_SCHEMA = CONVERT(b.SCHEMA_NAME USING UTF8);
315315
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
316-
1 SIMPLE # NULL index PRIMARY name 194 NULL # 100.00 Using index
317-
1 SIMPLE # NULL ALL NULL NULL NULL NULL # NULL Using join buffer (Block Nested Loop)
318-
1 SIMPLE # NULL ALL catalog_id,default_collation_id NULL NULL NULL # 100.00 Using where; Using join buffer (Block Nested Loop)
319-
1 SIMPLE # NULL eq_ref PRIMARY,character_set_id PRIMARY 8 mysql.sch.default_collation_id # 100.00 NULL
320-
1 SIMPLE # NULL eq_ref PRIMARY PRIMARY 8 mysql.col.character_set_id # 100.00 Using index
316+
1 SIMPLE # NULL index PRIMARY name 194 NULL # # Using index
317+
1 SIMPLE # NULL ALL NULL NULL NULL NULL # # Using join buffer (Block Nested Loop)
318+
1 SIMPLE # NULL ALL catalog_id,default_collation_id NULL NULL NULL # # Using where; Using join buffer (Block Nested Loop)
319+
1 SIMPLE # NULL eq_ref PRIMARY,character_set_id PRIMARY 8 mysql.sch.default_collation_id # # NULL
320+
1 SIMPLE # NULL eq_ref PRIMARY PRIMARY 8 mysql.col.character_set_id # # Using index
321321
Warnings:
322322
Note 1003 #
323323
select count(*) from information_schema.ROUTINES where routine_schema='test';
@@ -382,10 +382,10 @@ sys
382382
test
383383
explain select * from v0;
384384
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
385-
1 SIMPLE # NULL index PRIMARY name 194 NULL 1 100.00 Using index; Using temporary; Using filesort
386-
1 SIMPLE # NULL ALL catalog_id,default_collation_id NULL NULL NULL 6 100.00 Using where; Using join buffer (Block Nested Loop)
387-
1 SIMPLE # NULL eq_ref PRIMARY,character_set_id PRIMARY 8 mysql.sch.default_collation_id 1 100.00 NULL
388-
1 SIMPLE # NULL eq_ref PRIMARY PRIMARY 8 mysql.col.character_set_id 1 100.00 Using index
385+
1 SIMPLE # NULL index PRIMARY name 194 NULL # # Using index; Using temporary; Using filesort
386+
1 SIMPLE # NULL ALL catalog_id,default_collation_id NULL NULL NULL # # Using where; Using join buffer (Block Nested Loop)
387+
1 SIMPLE # NULL eq_ref PRIMARY,character_set_id PRIMARY 8 mysql.sch.default_collation_id # # NULL
388+
1 SIMPLE # NULL eq_ref PRIMARY PRIMARY 8 mysql.col.character_set_id # # Using index
389389
Warnings:
390390
Note 1003 #
391391
create view v1 (c) as select table_name from information_schema.tables
@@ -2118,3 +2118,13 @@ disconnect con1;
21182118
# Clean up.
21192119
connection default;
21202120
DROP VIEW v1;
2121+
#
2122+
# WL#6599: New Data Dictionary and I_S Integration.
2123+
#
2124+
# Test case to check if ndbinfo schema is listed by I_S when ndbcluster
2125+
# is not running.
2126+
#
2127+
SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'ndbinfo';
2128+
SCHEMA_NAME
2129+
SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'ndbinfo';
2130+
TABLE_NAME

mysql-test/suite/ndbcluster/basic.result

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,42 @@ b
2727
MySQL Server with NDB test
2828
DELETE FROM t1 ORDER BY b DESC;
2929
DROP TABLE t1;
30+
#
31+
# WL#6599: New Data Dictionary and I_S Integration.
32+
#
33+
# Test case to check if ndbinfo schema is listed by I_S when ndbcluster
34+
# is running.
35+
#
36+
SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'ndbinfo';
37+
SCHEMA_NAME
38+
ndbinfo
39+
SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'ndbinfo';
40+
TABLE_NAME
41+
arbitrator_validity_detail
42+
arbitrator_validity_summary
43+
blocks
44+
cluster_operations
45+
cluster_transactions
46+
config_params
47+
config_values
48+
counters
49+
dict_obj_types
50+
disk_write_speed_aggregate
51+
disk_write_speed_aggregate_node
52+
disk_write_speed_base
53+
diskpagebuffer
54+
logbuffers
55+
logspaces
56+
membership
57+
memory_per_fragment
58+
memoryusage
59+
nodes
60+
operations_per_fragment
61+
resources
62+
restart_info
63+
server_operations
64+
server_transactions
65+
tc_time_track_stats
66+
threadblocks
67+
threadstat
68+
transporters

mysql-test/suite/ndbcluster/basic.test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,15 @@ SELECT COUNT(*) FROM t1;
2525
SELECT b FROM t1 WHERE b LIKE "MySQL%";
2626
DELETE FROM t1 ORDER BY b DESC;
2727
DROP TABLE t1;
28+
29+
30+
--echo #
31+
--echo # WL#6599: New Data Dictionary and I_S Integration.
32+
--echo #
33+
--echo # Test case to check if ndbinfo schema is listed by I_S when ndbcluster
34+
--echo # is running.
35+
--echo #
36+
#'ndbinfo' schema should be listed when ndbcluster is running.
37+
SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'ndbinfo';
38+
# tables of ndbinfo schema should be listed.
39+
SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'ndbinfo';

mysql-test/suite/ndbcluster/binlog_index_table.result

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ TABLE_SCHEMA TABLE_NAME
44
mysql ndb_binlog_index
55
select ORDINAL_POSITION, COLUMN_NAME, COLUMN_TYPE, COLUMN_DEFAULT,
66
IS_NULLABLE from information_schema.columns
7-
where TABLE_SCHEMA = 'mysql' and TABLE_NAME = 'ndb_binlog_index';
7+
where TABLE_SCHEMA = 'mysql' and TABLE_NAME = 'ndb_binlog_index'
8+
order by ORDINAL_POSITION;
89
ORDINAL_POSITION COLUMN_NAME COLUMN_TYPE COLUMN_DEFAULT IS_NULLABLE
910
1 Position bigint(20) unsigned NULL NO
1011
2 File varchar(255) NULL NO

mysql-test/suite/ndbcluster/binlog_index_table.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ select TABLE_SCHEMA, TABLE_NAME from information_schema.tables
2121
#
2222
select ORDINAL_POSITION, COLUMN_NAME, COLUMN_TYPE, COLUMN_DEFAULT,
2323
IS_NULLABLE from information_schema.columns
24-
where TABLE_SCHEMA = 'mysql' and TABLE_NAME = 'ndb_binlog_index';
24+
where TABLE_SCHEMA = 'mysql' and TABLE_NAME = 'ndb_binlog_index'
25+
order by ORDINAL_POSITION;
2526

mysql-test/t/component-upgrade.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ CALL mtr.add_suppression("The mysql.component table is missing or has an incorre
2020
# Basic test that we can run mysql_upgrde and that it finds the expected
2121
# binaries it uses.
2222
--echo Run mysql_upgrade once
23+
# Filter out ndb_binlog_index to mask differences due to running with or without
24+
# ndb.
25+
--replace_regex /mysql.ndb_binlog_index.*$//
2326
--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
2427

2528
# It should have created a file in the MySQL Servers datadir
@@ -38,6 +41,9 @@ DROP TABLE mysql.component;
3841
--enable_reconnect
3942
--source include/wait_until_connected_again.inc
4043
--echo # running mysql_upgrade
44+
# Filter out ndb_binlog_index to mask differences due to running with or without
45+
# ndb.
46+
--replace_regex /mysql.ndb_binlog_index.*$//
4147
--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
4248
--source include/have_example_component.inc
4349
INSTALL COMPONENT "file://component_example_component1";

mysql-test/t/dd_is_compatibility.test

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ SELECT table_name AS 'table_name'
157157

158158
CREATE VIEW v1 AS SELECT table_name
159159
FROM information_schema.tables
160-
WHERE table_schema LIKE 'information_schema' AND table_name NOT LIKE 'INNODB%'
160+
WHERE table_schema LIKE 'information_schema'
161+
AND table_name NOT LIKE 'INNODB%'
162+
AND table_name NOT LIKE 'ndb%'
161163
ORDER BY table_name COLLATE UTF8_GENERAL_CI;
162164
SELECT * FROM v1;
163165
DROP VIEW v1;

mysql-test/t/information_schema.test

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ show function status where db='test';
179179
select a.ROUTINE_NAME from information_schema.ROUTINES a,
180180
information_schema.SCHEMATA b where
181181
a.ROUTINE_SCHEMA = CONVERT(b.SCHEMA_NAME USING UTF8) AND b.SCHEMA_NAME='test';
182-
--replace_column 3 # 10 #
182+
--replace_column 3 # 10 # 11 #
183183
explain select a.ROUTINE_NAME from information_schema.ROUTINES a,
184184
information_schema.SCHEMATA b where
185185
a.ROUTINE_SCHEMA = CONVERT(b.SCHEMA_NAME USING UTF8);
@@ -222,7 +222,7 @@ show create procedure sel2;
222222
#
223223
create view v0 (c) as select schema_name from information_schema.schemata order by schema_name;
224224
select * from v0;
225-
--replace_column 3 #
225+
--replace_column 3 # 10 # 11 #
226226
explain select * from v0;
227227
create view v1 (c) as select table_name from information_schema.tables
228228
where table_name="v1" order by table_name;
@@ -1946,3 +1946,15 @@ disconnect con1;
19461946
connection default;
19471947
DROP VIEW v1;
19481948
--disable_connect_log
1949+
1950+
1951+
--echo #
1952+
--echo # WL#6599: New Data Dictionary and I_S Integration.
1953+
--echo #
1954+
--echo # Test case to check if ndbinfo schema is listed by I_S when ndbcluster
1955+
--echo # is not running.
1956+
--echo #
1957+
#'ndbinfo' schema should not be listed when ndbcluster is not running.
1958+
SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'ndbinfo';
1959+
# tables of ndbinfo schema should not be listed.
1960+
SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'ndbinfo';

mysql-test/t/roles-upgrade.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
# expected binaries it uses.
77
#
88
--echo Run mysql_upgrade once
9+
# Filter out ndb_binlog_index to mask differences due to running with or without
10+
# ndb.
11+
--replace_regex /mysql.ndb_binlog_index.*$//
912
--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
1013

1114
# It should have created a file in the MySQL Servers datadir
@@ -45,6 +48,9 @@ CREATE ROLE r1;
4548
GRANT SELECT ON *.* TO u1;
4649

4750
--echo # Run mysql_upgrade
51+
# Filter out ndb_binlog_index to mask differences due to running with or without
52+
# ndb.
53+
--replace_regex /mysql.ndb_binlog_index.*$//
4854
--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
4955

5056
SHOW CREATE TABLE mysql.role_edges;

sql/dd/info_schema/stats.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ bool convert_table_name_case(char *db, char *table_name)
164164
if (db && is_infoschema_db(db))
165165
{
166166
my_casedn_str(system_charset_info, db);
167-
if (table_name)
167+
if (table_name && strncmp(table_name, "ndb", 3))
168168
my_caseup_str(system_charset_info, table_name);
169169

170170
return true;

0 commit comments

Comments
 (0)