Bug #53242 several mgmapi functions return 0(success) when no handle or not connected
Submitted: 28 Apr 2010 10:42 Modified: 12 May 2015 13:51
Reporter: Magnus Blåudd Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.1-telco-7.0 OS:Any
Assigned to: Magnus Blåudd CPU Architecture:Any
Tags: 7.0.14

[28 Apr 2010 10:42] Magnus Blåudd
Description:
Several functions in the MgmApi is declared to return a result of type int where 0 means success does return 0 also when the handle is NULL or when the connected check fails. This should be changed so that they return -1 when handle is NULL and -2 when not connected.

The list of functions is  ndb_mgm_allocate_nodeid, ndb_mgm_set_int_parameter, ndb_mgm_set_int64_parameter, ndb_mgm_set_string_parameter, ndb_mgm_purge_stale_sessions, ndb_mgm_check_connection, ndb_mgm_set_connection_int_parameter, ndb_mgm_get_mgmd_nodeid, ndb_mgm_report_event, ndb_mgm_end_session, ndb_mgm_get_session_id, ndb_mgm_get_session, ndb_mgm_set_configuration, ndb_mgm_get_configuration2

How to repeat:
Call the functions with a NULL pointer as handle or a not connected handle and check return code is 0 as in succcess

Suggested fix:
Return -1 for NULL handle and -2 for not connected.