Skip to content

Commit ea1ed46

Browse files
committed
Bug #24383742 NDB : NDB_SHOW_TABLES MISSING TYPE NAME TEXT FOR SOME TYPES
Problem: -------- Type column entries for HashMap missing from ndb_show_tables output Fix: ---- Added missing case for HashMap in ndb_show_tables. Also added the missing mapping of the HashMap table type from DictTabInfo to NdbDictionary
1 parent a597230 commit ea1ed46

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,21 @@ Please specify database name using the -d option. Use option --help for more det
3939
NDBT_ProgramExit: 1 - Failed
4040

4141
DROP DATABASE TEST_DB;
42+
create temporary table if not exists ndb_show_tables_results (
43+
id int,
44+
type varchar(20),
45+
state varchar(20),
46+
logging varchar(20),
47+
_database varchar(255),
48+
_schema varchar(20),
49+
name varchar(255)
50+
);
51+
52+
ndb_show_tables completed.....
53+
54+
select type from ndb_show_tables_results
55+
where type like '%HashMap%'
56+
limit 1;
57+
type
58+
'HashMap'
59+
drop table ndb_show_tables_results;

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,24 @@ DROP TABLE TEST_DB.t1;
3838
--error 1
3939
--exec $NDB_SHOW_TABLES --no-defaults t1
4040
DROP DATABASE TEST_DB;
41+
42+
# BUG #24383742 NDB : NDB_SHOW_TABLES MISSING TYPE NAME TEXT FOR SOME TYPES
43+
# Create temporary table to store ndb_show_tables result
44+
create temporary table if not exists ndb_show_tables_results (
45+
id int,
46+
type varchar(20),
47+
state varchar(20),
48+
logging varchar(20),
49+
_database varchar(255),
50+
_schema varchar(20),
51+
name varchar(255)
52+
);
53+
54+
--source ndb_show_tables_result.inc
55+
56+
# Check type of HashMap
57+
select type from ndb_show_tables_results
58+
where type like '%HashMap%'
59+
limit 1;
60+
61+
drop table ndb_show_tables_results;

storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2805,6 +2805,7 @@ objectTypeMapping[] = {
28052805
{ DictTabInfo::ForeignKey, NdbDictionary::Object::ForeignKey },
28062806
{ DictTabInfo::FKParentTrigger, NdbDictionary::Object::FKParentTrigger },
28072807
{ DictTabInfo::FKChildTrigger, NdbDictionary::Object::FKChildTrigger },
2808+
{ DictTabInfo::HashMap, NdbDictionary::Object::HashMap },
28082809
{ -1, -1 }
28092810
};
28102811

storage/ndb/tools/listTables.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -158,6 +158,9 @@ list(const char * tabname,
158158
case NdbDictionary::Object::FKChildTrigger:
159159
strcpy(type, "FKChildTrigger");
160160
break;
161+
case NdbDictionary::Object::HashMap:
162+
strcpy(type, "HashMap");
163+
break;
161164
default:
162165
sprintf(type, "%d", (int)elt.type);
163166
break;

0 commit comments

Comments
 (0)