http://bugs.skysql.com/show_bug.cgi?id=665http://bugs.skysql.com/show_bug.cgi?id=664http://bugs.skysql.com/show_bug.cgi?id=649
dcb.c:dcb_final_free: (665):set dcb->session->client pointer to NULL so that it won't be read anymore and other threads won't try to close it.
dcb_final_free:(664):don't free dcb->data, it is either freed in session_alloc if session creation fails or in session_free only.
session.c:if session creation fails, free dcb->data and remove links between client DCB and session.
mysql_backend.c:(665):gw_backend_close:check that session->client isn't NULL and that client DCB's state is still polling before calling dcb_close for it.
mysql_client.c:gw_mysql_do_authentication:if anything fails, and session_alloc won't be called, free dcb->data.
mysql_common.c:gw_send_authentication_to_backend:if session is already closing then return with error.
mysql_mon.c: Added back server state logging to Debug build.
query_classifier.cc: removed some extra debug code, cleaned up a bit function documentation.
mysql_client_server_protocol.h, mysql_backend.c, mysql_common.c: changed some variables to signed ones to enable checking of calculations in the code.
skygw_utils.cc: removed erroneous debug assertion.
When MaxScale starts it opens log file of each type and if there exist log files of same types in the same directory, it will try to reuse the file with largest sequence number in it. If there are no existing files, a file name with sequence number 1 will be created. If the file with largest sequence number is not writable, a new log file with larger sequence number will be created.
log_manager.cc:
Log manager handles cases where there are mismatch in user privileges.
Mark log files enabled in the global lm_enabled_logfiles_bitmask after initialization so that it reflects reality in error cases. In general, take into account the possibility that any phase in initialization may fail and read return values.
Replaced file_exists_and_is_writable to check_file_and_path which has a slightly different logic and which detects if file open fails for a few different reasons.
Improved logging (in stderr) in general in error cases.
gateway.c: Also check home directory accessibility in case when it is provided as a command-line argument. Added function check_dir_access to provide that function. Read return value of skysql_logmanager_init and exit (nicely) if it failed.
skygw_utils.cc: initialize mlist with version number 2, which indicates that object is initialized (different than zero) and that there are no active updates on the object (version%2==0).
query_classifier.cc: added function for printing combined query type from a bit field.
query_classifier.h: identify query types SHOW DATABASE, and SHOW TABLES to make log entries more understandable.
mysql_common.c: moved some trace log commands to debug log.
readwritesplit.c: moved some trace logs to debug log, added trace log commands to gather routing, query type and session information to one log entry.
skygw_debug.h: added string macros for several query and hint types.