138 Commits

Author SHA1 Message Date
counterpoint
492918c72c Use common code for atomic_add(). 2015-05-12 16:50:37 +01:00
Markus Makela
cf23baaa6b Fixed cyclic dependencies of log_manager and utils. 2015-05-09 11:10:27 +03:00
Markus Makela
fc7072786b Fixed null pointer dereferences in maxkeys and maxpasswd. 2015-05-06 16:32:49 +03:00
Markus Makela
3bd03fbe09 Merge branch 'logmanager_stdout' into develop 2015-05-04 11:03:24 +03:00
Markus Makela
d545150ceb Fix to MXS-70: https://mariadb.atlassian.net/browse/MXS-70
Added assert information to error log.
2015-05-02 05:51:25 +03:00
Markus Makela
e0feeac9e6 Added missing SESSION_STATE_ROUTER_READY to STRSESSIONSTATE macro. 2015-04-30 21:41:57 +03:00
Markus Makela
7c988c4fd5 Removed stdout specific functions in skygw_utils and moved the logic to log_manager instead. 2015-04-30 04:26:48 +03:00
Markus Makela
47e5b12eb8 Added a function that frees the skygw_file_t memory but doesn't close it. 2015-04-29 18:25:35 +03:00
Markus Makela
9ce225c2cb Added log manager initialization flag that prints all logs to stdout. 2015-04-29 11:20:40 +03:00
Markus Makela
1b3af7d61f Fixes to Coverity defects. 2015-04-16 19:41:49 +03:00
Markus Makela
051d891680 Added utility functions to skygw_utils and cleaned up tee filter. 2015-04-15 12:42:28 +03:00
Markus Makela
282f66f9fd Merge branch 'develop' into MAX-324
Conflicts:
	utils/skygw_utils.cc
2015-03-06 17:07:39 +02:00
Markus Makela
8c3409cf32 Fix to MXS-3: https://mariadb.atlassian.net/browse/MXS-3
Added the GNU specific code to skygw_utils.cc. This is a temporary fix and should be revisited at some point.
2015-03-06 12:39:42 +02:00
Markus Makela
880adca73e Merge branch 'develop' into MAX-324 2015-03-05 10:45:48 +02:00
Markus Makela
9ec31d029e Changed gettimeofday to time(NULL) in low precision logging. 2015-03-02 10:32:20 +02:00
Markus Makela
ad49c5f402 Added optional millisecond precision to logfiles and created the changelog document. 2015-02-24 18:10:16 +02:00
Markus Makela
fc969acc73 Added optional stripping of escape characters from database names when laoding users. 2015-02-20 21:07:12 +02:00
Markus Makela
ea55572ab8 Merge branch 'develop' into MAX-324 2015-02-20 04:45:48 +02:00
Markus Makela
3924f70d6b Fixed log manager sometimes not writing the last character in a log message.
This was caused by type conversions from int to size_t and the usage of the MAX macro.
2015-02-20 04:42:02 +02:00
Markus Makela
db1ea422a0 Merge branch 'develop' into MAX-324
Conflicts:
	server/core/modutil.c
2015-01-20 04:25:40 +02:00
Timofey Turenko
06c2d201e0 remove makefiles and other garbage 2015-01-14 19:08:24 +02:00
Markus Makela
fed828eb29 Merge branch 'release-1.0GA' into MAX-324
Conflicts:
	server/MaxScale_template.cnf
	server/core/service.c
2015-01-06 04:45:30 +02:00
Markus Makela
ba009e5fd3 Fixes to Coverity defects 85010 84878 72752 72742 72719 and 73418.
skygw_utils.cc: Added function is_valid_posix_path that checks if a path is POSIX-compliant.
2015-01-05 06:05:56 +02:00
VilhoRaatikka
635fcf708f Fix to bugs #665, and #664. Potentially to #649.
http://bugs.skysql.com/show_bug.cgi?id=665
http://bugs.skysql.com/show_bug.cgi?id=664
http://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.
2014-12-29 20:19:01 +02:00
VilhoRaatikka
726f221113 Added debug log to session closing and related functions 2014-12-19 12:18:25 +02:00
VilhoRaatikka
cf40cbfbf0 Aadded some of the code from routeQuery to its own function, change_current_db, which extracts db name, tests if the name can be found among cached database names (hashtable) and if it does, change the db. Otherwise create an error message and add it to poll eventqueue like it was sent from some of the backends. 2014-12-08 23:37:21 +02:00
VilhoRaatikka
01b1b0a304 Fixes to Coverity issues 84388, 84386, 84385
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.
2014-12-05 23:39:14 +02:00
VilhoRaatikka
f2c2e4f81c Fix to bug #617, http://bugs.skysql.com/show_bug.cgi?id=617
When filewriter_init failed due to full disk, error branch freed messages twice. Removed unnecessary free command.
2014-12-02 23:58:28 +02:00
VilhoRaatikka
3e18e091c1 Fixed unreported bug in log_manager where a terminating character was added in the middle of log message. 2014-11-27 16:53:50 +02:00
VilhoRaatikka
155e795830 Fix to #622, http://bugs.skysql.com/show_bug.cgi?id=622
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.
2014-11-21 13:44:12 +02:00
VilhoRaatikka
70eef7aaa8 Fix to bug #513, http://bugs.skysql.com/show_bug.cgi?id=513 2014-11-17 15:33:13 +02:00
VilhoRaatikka
780733f870 MAX-325, Log rotation functionality. When skygw_log_rotate is called, corresponding logfile's rotate flag (lf_rotateflag) is set and log writer thread is woken up. Writer opens a new log file and closes the old one. 2014-11-12 14:48:17 +02:00
VilhoRaatikka
061fa62d29 Fixes to Coverity issues 77197 (mysql_common.c, dcb.c, mysql_client.c, skygw_debug.h), 72654 (poll.c), 72756 (mysql_backend.c), 72744 (mysql_backend.c), 77197 (mysql_common.c), 72746 (mysql_common.c), 72676 (mysql_common.c), 72705 (readwritesplit.c), 72697 (readwritesplit.c), 72652 (skygw_debug.h) 2014-11-11 14:10:06 +02:00
VilhoRaatikka
d1772e300e Addition to fix to bug #613, http://bugs.skysql.com/show_bug.cgi?id=613
Added new declaration of skygw_file_write and modification to the function which returns errno instead of boolean.
2014-11-10 13:59:55 +02:00
VilhoRaatikka
f44ed2f3b4 Fixes to Coverity issues 72736 & 72735 2014-11-06 08:45:46 +02:00
VilhoRaatikka
0a306b2eeb Fix bug #611, http://bugs.mariadb.com/show_bug.cgi?id=611
Fixes to Coverity issues 72703, 72713, 72718, 72721
2014-11-05 18:37:11 +02:00
VilhoRaatikka
9728502522 Fix to Coverity issue 72769 2014-11-05 17:50:07 +02:00
VilhoRaatikka
86cd6ec0e9 Fix to Coverity issue 72726 2014-11-05 17:27:37 +02:00
VilhoRaatikka
848c7aa0b8 Fixes to Coverity cases 72678 (retry), 72693 2014-10-31 11:38:57 +02:00
VilhoRaatikka
7048270062 Coverity : 72678, 72687, 72689
Fixed memory leaks and use of freed memory
2014-10-30 18:19:41 +02:00
VilhoRaatikka
726ab87f4b Fix to #575, http://bugs.mariadb.com/show_bug.cgi?id=575
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).
2014-10-14 13:22:16 +03:00
counterpoint
57ad30f105 Fuller message in asserts. 2014-10-07 09:08:49 +01:00
counterpoint
32d66e6f84 Minor modifications for testing. 2014-10-03 17:24:46 +01:00
VilhoRaatikka
cd0c17676e get_decimal_len wasn't declared in C portion of the code and the symbol was mangled. 2014-10-01 22:17:43 +03:00
Markus Makela
856448500e Merge branch 'develop' of https://github.com/mariadb-corporation/MaxScale into develop 2014-10-01 14:38:15 +03:00
Markus Makela
b0683d9b4d Updated the licensing year from 2013 to 2013-2014 2014-10-01 14:37:12 +03:00
VilhoRaatikka
b38324acb6 Fix to bug #514, http://bugs.mariadb.com/show_bug.cgi?id=514
Excluded unused functions from build with #if defined(NOT_USED) .. #endif macros
2014-10-01 14:12:26 +03:00
Markus Makela
0acb8fe05d Renaming missed SkySQL references. 2014-10-01 13:48:00 +03:00
Markus Makela
52c0d0c768 Merge remote-tracking branch 'origin/develop' into header_rename 2014-10-01 05:24:02 +03:00
VilhoRaatikka
ca7ae0bb64 Fix to bug #557, http://bugs.mariadb.com/show_bug.cgi?id=557
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.
2014-09-30 16:31:30 +03:00