Bug #50926 ndbinfo table memoryusage has inaccurate column name
Submitted: 4 Feb 2010 18:23 Modified: 12 Feb 2010 7:00
Reporter: Matthew Montgomery Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:ndb-7.1.1 OS:Any
Assigned to: jack andrews CPU Architecture:Any

[4 Feb 2010 18:23] Matthew Montgomery
Description:
The column "DATA_MEMORY" of ndbinfo.memoryusage table is named oddly.

This column shows which of the two memory allocations for INDEX_MEMORY or DATA_MEMORY is being described.  It should be named more accurately "allocation_type" or "memory_type" and should also have the same letter case as all the other columns in that table.

How to repeat:
Eh!?

mysql> select * from memoryusage where DATA_MEMORY='INDEX_MEMORY'; 
+---------+--------------+------+------+
| node_id | DATA_MEMORY  | used | max  |
+---------+--------------+------+------+
|       2 | INDEX_MEMORY |   18 | 2336 | 
|       3 | INDEX_MEMORY |   18 | 2336 | 
+---------+--------------+------+------+
2 rows in set (0.28 sec)

Suggested fix:
=== modified file 'storage/ndb/tools/ndbinfo_sql.cpp'
--- storage/ndb/tools/ndbinfo_sql.cpp	2010-01-19 23:33:05 +0000
+++ storage/ndb/tools/ndbinfo_sql.cpp	2010-02-04 18:20:47 +0000
@@ -142,7 +142,7 @@
     "FROM <NDBINFO_DB>.<TABLE_PREFIX>nodes"
    },
   { "memoryusage",
-    "SELECT node_id, \"DATA_MEMORY\", "
+    "SELECT node_id, \"DATA_MEMORY\" as 'memory_type', "
     "used, max "
     "FROM <NDBINFO_DB>.<TABLE_PREFIX>resources "
     "WHERE resource_id = 3 "
[9 Feb 2010 9:18] jack andrews
is matthew's patch ok to push?
[10 Feb 2010 7:10] jack andrews
matthew advised patch is incomplete
[10 Feb 2010 18:07] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/99866

3410 Matthew Montgomery	2010-02-10
      Bug #50926 ndbinfo table memoryusage has inaccurate column name "DATA_MEMORY".
[12 Feb 2010 4:09] MySQL Verification Team
Pushed to 7.1.2
[12 Feb 2010 6:42] Jon Stephens
Bugs in Documenting status don't get reassigned -- 'assignee' is the person who fixed the bug, and that doesn't change regardless of who documented the fix.
[12 Feb 2010 7:00] Jon Stephens
Documented change in the NDB-7.1.2 changelog as follows:

      The DATA_MEMORY column of the ndbinfo.memoryusage table was renamed to
      memory_type.

Also updated ndbinfo.memoryusage description.

Closed.