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.