110 Commits

Author SHA1 Message Date
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
Markus Makela
f4e591e382 Changed 'SkySQL Gateway' to 'MariaDB Corporation MaxScale' 2014-09-30 13:15:03 +03:00
Markus Makela
c344231f80 Renamed all occurences of SkySQL to MariaDB Corporation 2014-09-30 13:02:10 +03:00
VilhoRaatikka
686d28a1f0 Fix to bug #506, http://bugs.skysql.com/show_bug.cgi?id=506
If debug and/or trace log is stored to shared memory, the absolute path to file is now /dev/shm/<pid>/skygw_[trace1|debug1].log
2014-09-29 13:21:26 +03:00
Markus Makela
3f0de666ac Changed the order of linking to resolve some debug build bugs and added the missing parent directory of the MYSQL_DIR into the included directories. 2014-09-20 19:44:30 +03:00
Markus Makela
cde74cfaa5 added missing -lstdc++ flags 2014-09-17 09:16:23 +03:00
Markus Makela
41226692ac Merge branch 'release-1.0beta-refresh' into cmake_build 2014-09-16 12:11:17 +03:00
Mark Riddoch
c8fc5b712b Merge branch 'hholzgra-hartmut-gitignore' into release-1.0beta-refresh 2014-09-15 13:22:46 +01:00
Markus Makela
1f56db310d Changed variable names to closer match their usage
Changed the default values to the same as in makefiles
Added configured versions of maxscale.conf and maxscale init.d script
2014-09-15 14:12:55 +03:00
VilhoRaatikka
68f8e32f58 Added physical log paths to message which is printed on the start screen. Refers to bug #506, http://bugs.skysql.com/show_bug.cgi?id=506 2014-09-15 13:38:47 +03:00
Markus Makela
b3ce971020 initial implementation of the CMake build system 2014-09-11 18:24:41 +03:00
MassimilianoPinto
8b5b4a17fe Merge from Z3
Merge from Z3
2014-09-11 12:51:16 +02:00
VilhoRaatikka
f74493d922 server/modules/filter/Makefile: Fixed problem which prevented cleaning and compiling hintfilter library.
server/core/config.c: Removed unused if..else block from config_get_valint. Changed it also to return value which indicates whether the operation succeed. Added config_get_valbool similar to config_get_valint.
service.c:Added typelib-like struct and array of valid boolean values. Fixed parameter type test in service_set_param_value. Completed boolean type parameter handling.
hintparser.c:Fixed error message for non-maxscale hints.
readwritesplit.c:Added loading of configuration parameters from service to instance and from instance to each new session. Fixed routing condition in get_route_target. Modified get_route_target so that it takes also rw_read_sesvars_from_slaves and rw_write_sesvars_to_all as parameters.
skygw_types.h: added array size counting macro.
2014-09-08 21:44:23 +03:00
Hartmut Holzgraefe
ee63b042b7 use ISO-8601 format for date part in log message timestamp 2014-09-05 16:51:38 +02:00
Markus Makela
0e53633a37 Merge remote-tracking branch 'origin/Z3' into MAX-237 2014-09-01 13:44:24 +03:00
Markus Makela
164d8b1e32 Fixed various memory leaks
dbuser.c: key.user value was never freed
skygw_utils.cc: replace_literal values were not always freed
2014-09-01 13:40:52 +03:00
VilhoRaatikka
20abbbdf57 query_classifier.cc:skygw_get_canonical: Fixed bug in how strings were passed to replace_literal function. Changed to use item->str_ptr which stores all strings in the same way unlike item->name in which some string values have double quotation.
skygw_utils.cc:Fixed regexp so that it detects literals at the end of line too.
2014-09-01 13:23:04 +03:00
VilhoRaatikka
40416d424e Merge branch 'Z3' of https://github.com/skysql/MaxScale into Z3
Conflicts:
	gcov.diff
	server/core/buffer.c
	server/include/buffer.h
	server/modules/routing/readwritesplit/readwritesplit.c
2014-08-29 18:50:32 +03:00
VilhoRaatikka
69104d7dee skygw_utils.cc:replace_literal: Fixed regular expression which, for example, accepted "200" with needle "2"
query_classifier.cc: fixed invalid argument list in logging command.
input.sql: added a few previously failed cases for canonical query test
2014-08-26 11:08:05 +03:00
VilhoRaatikka
ee52ac64a9 query_classifier.cc:skygw_get_canonical: if the item to be replaced is an empty string "", it is processed differently from the other cases due to difficulties to get wanted result by adding special rule for that to regex.
query_classifier.h: added parsing information structure to query classifier away from buffer.h.
buffer.c:introduced a buffer object which includes object pointer and a clean-up call-back function. Buffer objects form a list which is cleaned up by the last referrer of the buffer, as a part of gwbuf_free. Buffer object list is protected by a spinlock gwbuf_lock.
	Also added identifier type, bufobj_id_t which is enumerated type and currently includes one value only, GWBUF_PARSING_INFO. Added also a bitfield for information about the buffer. It currently has one type only, GWBUF_INFO_PARSED indicating that buffer content is parsed and there is buffer object of type GWBUF_PARSING_INFO.
skygw_utils.cc:replace_literal:changed regexec matching to case insensitive because user-defined literals are sometimes converted to upper-case ones.
2014-08-22 19:01:56 +03:00
VilhoRaatikka
3a5b8ef64c query_classifier.cc: cleaned up and simplified skygw_get_canonical
skygw_util.cc:fixed memory allocation issue where terminating byte wasn't counted. Added some error checks.
2014-08-21 23:08:21 +03:00
VilhoRaatikka
8d1eae6fde Fixed comment. 2014-08-21 22:34:50 +03:00
VilhoRaatikka
fa2189373d query_classifier.cc: query_is_parsed is now global function and can be used to check whether parsing information already exists in the buffer.
skygw_utils.cc: removed replace_str and implemented replace_literal which replaces user-provided literals in query with predefined string "?". Replacing is done one by one, so it is suboptimal ipmlementation since all literals could be passed to replacement function in one call and processed all before returning.
2014-08-21 22:28:23 +03:00
VilhoRaatikka
c501d4d4e1 Changes related to canonical query format implementation.
query_classifier.cc: Now query can be parsed outside query_classifier_get_type by calling function parse_query. It creates parsing_info_t struct which is then added to the GWBUF which also includes the query. Parsing information follows the buffered query and it is freed at the same time with query buffer, in gwbuf_free.
buffer.c: additions of parsing information to gwbuf struct.
modutil.c: added function which returns query from GWBUF in plain text string.
readwritesplit.c:routeQuery now only calls query_classifier_get_type to get the query type instead of extracting plain text query from the GWBUF buffer.
2014-08-20 22:10:36 +03:00
VilhoRaatikka
544e64a301 query_classifier: implemented skygw_get_canonical which returns a copy of original string with given substrings being replaced with questionmarks.
skygw_utils.cc: added string replacement function for use of skygw_get_canonical
2014-08-18 14:19:46 +03:00
Hartmut Holzgraefe
d355e07e2d gitignore cleanup
* ignore typical backup files created by common editors
* move general ignore rules like "*.o" or "depend.mk" to top level gitignore
* ignore executables and test directories in target dir gitignore
  as these are local and there's no general catch-all pattern for them
2014-08-18 09:39:29 +00:00
VilhoRaatikka
b72e80b464 Fix for Bug #466, http://bugs.skysql.com/show_bug.cgi?id=466
hintparser.c:hint_parser:when string token is found, create a copy of the token value instead of copying the its address because token will be freed before the value is used.
	hint_next_token:didn't recognize '=' as TOK_EQUAL, fixed that. Read the code.
hint.c:hint_create_parameter: copy the pointer to parameter name instead of creating copy of it - pname is already copied from token before the call
readwritesplit.c:routeQuery:Hint name was copied when hint value was supposed to be copied, thus resulting invalid value for hinted parameter. Also fixed server type in trace log command.
skygw_debug.h:Added string for Relay server to macro STRSRVSTATUS.
2014-08-06 16:39:22 +03:00
VilhoRaatikka
cf38dad43a Merge branch 'Z2' of https://github.com/skysql/MaxScale into Z2
Conflicts:
	server/core/modutil.c
2014-08-05 18:26:55 +03:00
VilhoRaatikka
08b99c121e Bug #468, http://bugs.skysql.com/show_bug.cgi?id=468, Query classifier accessed freed thread context. If parsing fails thd doesn't need to be freed because it holds correct information about command type.
session.c:session_setup_filters : fixed memory leak
hintparser.c: added token_free for HINT_TOKENs and fixed a few memory leaks.
mysql_client_server_protocol.h: added mysql_protocol_done which frees memory blocks pointed to by protocol members. Those can't be freed in dcb.c because dcb.c doesn't know about protocol's members.
mysql_backend.c:gw_backend_close: fixed memory leak
mysql_client.c: gw_client_close: fixed memory leak
mysql_common.c: added implementation of mysql_protocol_done
        :protocol_archive_srv_command: tried to fix memory leak. Some memory is still leaking according to valgrind. Removed use of uninitialized local variable len.
readwritesplit.c: Fix to bug #469, http://bugs.skysql.com/show_bug.cgi?id=469,  rwsplit counts every connection twice in master - counnection counts leak
	execute_sescmd_in_backend: fixed a memory leak - visible only in DEBUG=Y build.
readwritesplit/test/makefile: added target for hints tests
2014-08-05 18:14:06 +03:00