754 Commits

Author SHA1 Message Date
Mark Riddoch
0083e62c41 Merge branch 'blr' into develop 2015-02-03 17:19:06 +00:00
VilhoRaatikka
21bb341c7d Fix to bug #507, http://bugs.mariadb.com/show_bug.cgi?id=507
readwritesplit.c:get_route_target routed query to slave although query type was combined QUERY_TYPE_READ | QUERY_TYPE_MASTER_READ, where the latter is supposed to be routed to master.
2015-01-27 15:21:31 +02:00
VilhoRaatikka
270c0ebf8a Clean up, added comments, removed some dead code. 2015-01-27 10:24:37 +02:00
Markus Makela
566831c9c5 Fix to bug 705: http://bugs.mariadb.com/show_bug.cgi?id=705
changed " to ' in queries so that ANSI_QUOTES works with sql_modes that use it.
2015-01-26 20:17:20 +02:00
Markus Makela
7a55d482a2 Fix to bug 700: http://bugs.mariadb.com/show_bug.cgi?id=700
--version now prints the version string.
2015-01-26 10:19:25 +02:00
VilhoRaatikka
5d1f029260 New fix candidate to bug #698, http://bugs.mariadb.com/show_bug.cgi?id=698
client/test/maxadmin_test.sh: added new cases for testing maxadmin
service.c:dListListeners:fixed NULL-pointer reference
debugcli.h: replaced magic number 80 with constant integer.
cli.c:execute:fixed command buffer overflow
debugcmd.c:convert_arg:restored return value to 0 in case of error
2015-01-19 17:55:02 +02:00
VilhoRaatikka
9c34125a59 Merge branch 'develop' of https://github.com/mariadb-corporation/MaxScale into develop 2015-01-19 00:04:01 +02:00
VilhoRaatikka
fca674b16a modutil.c: added modutil_reply_auth_error
mysql_backend.c:gw_change_user: instead of setting flags directly to replybuffer, set server command to backend's protocol object and reply the message directly to backend where flags are set and it is replied back to client.
2015-01-19 00:01:08 +02:00
Markus Makela
d4d9304dab Removed unused values. 2015-01-18 06:08:38 +02:00
Markus Makela
66db37341d Updates all references to INSTALL_DIR with CMAKE_INSTALL_PREFIX. 2015-01-18 05:55:29 +02:00
VilhoRaatikka
f5d8e2366a modutil.c:modutil_reply_routing_error: Removed GWBUF type flag setting and added flags argument to function prototype so that the caller can set necessary flags and they are then copied to GWBUF which is first created in modutil_reply_rounting_error. 2015-01-17 23:07:06 +02:00
VilhoRaatikka
6d2b38d4b6 Complementary fix to #694,http://bugs.mariadb.com/show_bug.cgi?id=694
RWSplit router handles query processing errors that happened in router by sending parse error reply to client. routeQuery fails only when backend has failed.
2015-01-17 22:40:52 +02:00
Timofey Turenko
885dfb0242 Merge branch 'remove_makefiles' into develop 2015-01-16 18:04:16 +02:00
Markus Makela
88a26f03ab Fix to bug 685: http://bugs.mariadb.com/show_bug.cgi?id=685
Added the missing detection of partial packets in the buffers.
2015-01-15 13:13:09 +02:00
Markus Makela
30d2742294 Fixed garbled data at end of modutil.c 2015-01-15 04:40:33 +02:00
Markus Makela
b635eb1493 Additional debugging info added to tee filter. 2015-01-14 21:13:52 +02:00
Timofey Turenko
06c2d201e0 remove makefiles and other garbage 2015-01-14 19:08:24 +02:00
VilhoRaatikka
b3824a1eaf Clean up bits and pieces, removed some unnecessary checks. 2015-01-14 14:11:19 +02:00
Markus Makela
7f4675cd57 Fix to bug 685: http://bugs.mariadb.com/show_bug.cgi?id=685
Added the missing ERR packet detection to modutil functions.
2015-01-13 21:32:04 +02:00
Markus Makela
d194af0733 Moved result set processing functions to modutil.c from tee.c. 2015-01-13 09:45:58 +02:00
VilhoRaatikka
333f79f4db Commented session id logging. 2015-01-12 14:44:53 +02:00
VilhoRaatikka
6be227f3c4 Added comments, removed non-existing function, cleaned up a bit. 2015-01-12 14:25:37 +02:00
Timofey Turenko
8572a08cab Merge branch 'master' into develop 2015-01-09 11:23:03 +02:00
Markus Makela
7987365bd4 Fix to tee filter tests failing due to the default user not being found in the etc/passwd file. 2015-01-08 20:21:56 +02:00
Markus Makela
2a02b2deba Fixed TestUsers failing due to only adding a single user. 2015-01-08 13:48:29 +02:00
Markus Makela
094dfbd4f7 Fixed tests not having environment variables set. 2015-01-08 13:18:14 +02:00
Mark Riddoch
613ed8bb61 Cleanup some log messages 2015-01-07 17:37:32 +00:00
Markus Makela
cd99849581 Fix #2 to bug 680: http://bugs.mariadb.com/show_bug.cgi?id=680"
When no users are loaded from backends, instead of counting it as a failure the service is started and the next time a client connects an attempt to load the users from the backends is made.
2015-01-05 17:38:45 +02:00
Markus Makela
9717190b4a Added calls to skygw_log_sync_all in the hint, server and user tests before each assertion that might fail. 2015-01-05 15:14:26 +02:00
Markus Makela
2d8375bb12 Fix to bug 579: http://bugs.mariadb.com/show_bug.cgi?id=579
Added a header which contains the locations for the testing directory and its subfolders which enables
the test to write into the right logfiles. Also added a calls to skygw_log_sync_all before assertions
forcing all logs to be written to disk at the time the test might fail.
2015-01-05 15:06:38 +02:00
Markus Makela
b99467cd63 Merge branch 'release-1.0GA' into testing_header 2015-01-05 14:46:34 +02:00
Markus Makela
6adccb3c17 Fix to bug 680: http://bugs.mariadb.com/show_bug.cgi?id=680
service.h:Added the 'serviceStartFailed' function which tries to start services with successfully started routers but no successfully started listeners.
mysql_mon.c:Added a call to ServiceStartFailed when servers come available.
2015-01-05 13:38:39 +02:00
Markus Makela
e27b51392a Changed SIZE_MAX references to values calculated at runtime. 2015-01-05 11:38:54 +02:00
Markus Makela
3bf595673d Added the missing skygw_log_sync_all function to the log_manager.h header and created a header for testing which contains the location of the testing directory. 2015-01-05 06:48:32 +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
Markus Makela
b3d79f7273 Merge branch 'release-1.0GA' into bug_679_fix 2015-01-02 20:57:28 +02:00
Markus Makela
95cd0b93cb Fix to bug 679: http://bugs.mariadb.com/show_bug.cgi?id=679
Added server references to services instead of using a raw pointers to server instances.
Changed all references to service->database to service->dbref.
2015-01-02 20:55:38 +02:00
VilhoRaatikka
6228be4284 Fix to bug #678, http://bugs.skysql.com/show_bug.cgi?id=678
tee.c:routeQuery cloned partial MySQL packets to be routed to child router. Problems were due to the use of gwbuf_clone and modutil_MySQL_query which clone/examine only the first buffer from the buffer list which composes GWBUF.
modutil.c: Added function modutil_MySQL_query_len which calculates MySQL packet length and the missing bytecount
2015-01-02 18:32:57 +02:00
Markus Makela
ce58157901 Added more debugging output.
tee.c: Added details about the freeing of orphaned sessions.
session.: Added missing cases of session state into the session_state function in debug builds.
2015-01-01 13:03:03 +02:00
VilhoRaatikka
2eee4ae4fd Fix to Bug #657, http://bugs.skysql.com/show_bug.cgi?id=657
filter.c:filter_free:if filter parameter is NULL, return.
tee.c:freeSession: if my_session->dummy_filterdef is NULL, don't try to release the memory
2015-01-01 01:20:21 +02:00
VilhoRaatikka
f4f537a3e2 Fix to bug #673, http://bugs.skysql.com/show_bug.cgi?id=673
dcb.c:dcb_hashtable_stats:division by zero
hashtable.c:hashtable_get_stats: NULL-pointer reference
service.c:serviceStartPort:set service->users NULL to avoid referring to freed memory
users.c:dcb_usersPrintf: NULL-pointer reference
debugcmd.c:convert_arg: changed return value to 1 in case of error, 0 (==NULL) is valid but it indicates that there are no users loaded.
	execute_cmd: fixed command handling
2014-12-31 21:06:28 +02:00
Markus Makela
073db0f1e2 Added checks that the query was cloned in clientReply before waiting for a reply. 2014-12-30 23:05:13 +02:00
Markus Makela
e6607dca40 tee.c:
Added clientReply and setUpstream entry points
    Tee filter now waits for the branch session to be replied to and if the reply isn't received in five seconds it closes the branch session.
dcb.h:
    Added the DCBF_REPLIED flag that is currently only set in dcb_null_write
dcb.c:
    The DCBF_REPLIED flag is now set in dcb_null_write
2014-12-30 17:40:47 +02:00
VilhoRaatikka
6b68136377 Fix to bugs #664 and #665
http://bugs.skysql.com/show_bug.cgi?id=664
http://bugs.skysql.com/show_bug.cgi?id=665

Cloned session was freeing the shared 'data' dcb->data/session->data. Now only session_free for the non-clone session is allowed to free the data.
2014-12-30 13:35:59 +02:00
VilhoRaatikka
77bd279a01 Fix to prevent double free of dcb->data/session->data. If authentication fails, call free(dcb->data) only when DCB in question is *not* cloned. 2014-12-30 12:28:36 +02:00
VilhoRaatikka
2c2d6f8b66 Clean up. Removed dead code and added comments. 2014-12-30 10:05:13 +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
beacd524da Fix to bug #662, http://bugs.mariadb.com/show_bug.cgi?id=662
dbusers.c: Added function for setting read, write and connection timeout values. Set default timeouts for getUsers. Defaults are listed in service.c
gateway.c:shutdown_server is called whenever MaxScale is to be shut down. Added call for service_shutdown to shutdown_server.
service.c:service_alloc: replaced malloc with calloc and removed unnecessary zero/NULL initialization statements as a consequence.
	serviceStart: Exit serviceStartPort loop if shutdown flag is set for the service.
	serviceStartAll: Exit serviceStart loop if shutdown flag is set for the service.
service.c: Added service_shutdown which sets shutdown flag for each service found in allServices list.
service.h: Added prototype for service_shutdown
2014-12-29 13:45:24 +02:00
Markus Makela
a1d7ccac2f Commented out a debug assert in dcb.c:917 2014-12-23 17:40:22 +02:00
VilhoRaatikka
ff5fe23ce6 dcb.b:dcb_final_free:replaced ((dcb->flags & DCBF_CLONE)==0) with macro !DCB_IS_CLONE(dcb)
readwritesplit.h:Removed invalid macros which assumed that ROUTER_CLIENT_SES->rses_backend_ref always pointed to valid and used backend reference and thus included potential risk of NULL-pointer refernce.
mysql_backend.c and mysql_client.c:avoid executing CHK_PROTOCOL(p) after original DCB has been released the memory.
readwritesplit.c:Replaced RSES_CLEINT_DCB macro with a function which returns client DCB for a given router client session.
2014-12-23 16:10:27 +02:00