131 Commits

Author SHA1 Message Date
VilhoRaatikka
44771dbc51 readwritesplit.c:handleError is meant to handle backend errors. Removed one call from mysql_client.c and only send error message to client instead.
Added checks to debug build to ensure that handleError is called before backend DCB is closed.
2014-11-07 17:55:05 +02:00
VilhoRaatikka
9ccbab1899 poll.c:dcb_close Don't call poll_remove_dcb anymore if DCB has already been removed from poll set.
mysql_backend.c, mysql_client.c free error message GWBUF after calling handleError
readconnroute.c:handleError send error message to client before returning.
readwritesplit.c:handleError don't free error message buffer anymore since the caller of handleError frees it.
2014-11-01 20:00:59 +02:00
VilhoRaatikka
b6fe4e620a Fixed another leaking socket. Coverity 72706 2014-11-01 15:28:41 +02:00
VilhoRaatikka
f1c4c1dfb2 Fixed one more socket leak 2014-11-01 00:01:38 +02:00
VilhoRaatikka
8aff04b0e9 Fixed Coverity case 72706 2014-10-31 23:35:29 +02:00
VilhoRaatikka
deffd4a69f Fix to Coverity cases 73417, 73420, 72759, 72639 2014-10-31 23:11:19 +02:00
VilhoRaatikka
a342b453ac Fixed Coverity tasks : 72722, 72706 2014-10-31 15:55:13 +02:00
MassimilianoPinto
970511a275 Update for message errors in DB authentication
Update for message errors in DB authentication
2014-10-24 12:20:50 +02:00
MassimilianoPinto
35996a40cb Reply messages for failed db authentication
Reply messages for failed db authentication
2014-10-23 19:36:25 +02:00
MassimilianoPinto
8dd20a10e6 reload users with db auth failed
reload users with db auth failed
2014-10-22 17:56:40 +02:00
MassimilianoPinto
a1f621da30 MySQL authentication with db name
MySQL authentication with db name
2014-10-21 16:46:52 +02:00
MassimilianoPinto
3cdb1dc2ae Added db names as hashtable
Added db names as hashtable
2014-10-20 19:26:13 +02:00
MassimilianoPinto
b8f590e67f Added database errmsg to change_user
Added database errmsg to change_user
2014-10-17 19:02:19 +02:00
MassimilianoPinto
2dfa01fccc MySQL Auth with dbname check
MySQL Auth with dbname check

Unknown database ‘xxxxx’ is returned to client

Proper error number is still missing and also com_change_user need to
be fixed
2014-10-16 19:17:15 +02:00
MassimilianoPinto
0769deed7f MySQL Authentication with DBname
MySQL Authentication with DBname
2014-10-15 17:26:46 +02:00
MassimilianoPinto
9212effb86 memory leak fixed
memory leak fixed
2014-10-14 12:46:15 +02:00
MassimilianoPinto
273a445045 Code cleanup
Code cleanup
2014-10-13 10:47:27 +02:00
MassimilianoPinto
ee54310a73 Implementation of db auth
Implementation of db auth
2014-10-13 09:50:55 +02:00
VilhoRaatikka
29e53e150a Fix to bug # 565, http://bugs.mariadb.com/show_bug.cgi?id=565
Client flags are now copied to each backend and used in their connections.

log_manager.cc: fixed string allocation where one byte was missing.
mysql_client.c: fixed string allocation where one byte was missing.
2014-10-08 22:27:28 +03:00
VilhoRaatikka
153a1cd385 Fixed the fix: invalid packet test removed. 2014-10-07 18:41:53 +03:00
VilhoRaatikka
07fc5162a0 Fix to bug #562, http://bugs.mariadb.com/show_bug.cgi?id=562
mysql_client.c, added functions create_auth_fail_str, and get_username_from_auth to implement creation of similar error msg with MySQL. There is one difference left, because MaxScale prints IP address instead of hostname in error message.
2014-10-07 18:00:22 +03:00
VilhoRaatikka
aca8596efa mysql_client.c:gw_client_close didn't close client session in cases where session->state == SESSION_STATE_STOPPING. That is a bug and lead to situation where session wasn't closed at all.
Also changed 'authorization failed' to 'access denied'
mysql_common.c: fixed memory leak in gw_receive_backend_auth, and replaced error code '2800' with '28000'.
readconnroute.c:handleError didn't set *succp pointer so uninitialized value was used in caller's context.
makefile.inc: added -lm to linker flags
mysql_backend.c: added a few comments
2014-10-06 11:46:12 +03:00
Markus Makela
c4ca1ddb13 Updated non-source files with new company name. 2014-10-01 15:21:47 +03:00
Markus Makela
b0683d9b4d Updated the licensing year from 2013 to 2013-2014 2014-10-01 14:37:12 +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
Mark Riddoch
5721df5176 Add initial file number
Fix for short binlog file names in rotate

Socket buffering changes
2014-09-19 13:40:38 +01:00
Mark Riddoch
f3d32087d8 Performance improvement or streaming large result sets.
-bash-4.1$ time mysql -h 127.0.0.1 -P4007 -umassi -pmassi information_schema -q -e "select * from engines a, engines b, engines c, engines d, engines e;" > /dev/null

real	1m16.137s
user	0m0.660s
sys	0m0.392s
-bash-4.1$ time mysql -h 127.0.0.1 -P4007 -umassi -pmassi information_schema -q -e "select * from engines a, engines b, engines c, engines d, engines e;" > /dev/null

real	0m0.980s
user	0m0.944s
sys	0m0.027s
2014-09-16 12:37:57 +01:00
VilhoRaatikka
c2847c7ddb Clean up. 2014-09-14 10:17:09 +03:00
VilhoRaatikka
8e5d852dde Merge branch 'release-1.0beta-refresh' of https://github.com/skysql/MaxScale into release-1.0beta-refresh 2014-09-13 21:29:36 +03:00
VilhoRaatikka
2012dfdd35 Fix to bug #541, http://bugs.skysql.com/show_bug.cgi?id=541
Long ~0.5MB queries blocked MaxScale.
mysql_client.c:gw_read_client_event: Fixed packet reading logic. Reading didn't work when packet exceeded read buffer size.
mysql_common.c:gw_MySQL_get_next_packet: number of bytes to be copied to continuous buffer was calculated wrong, thus resulting in broken packet.
readwritesplit.c:disabled creation of canonical query in debug build because it slows down the processing too much with long queries
2014-09-13 21:16:44 +03:00
MassimilianoPinto
7108add6f5 code cleanup localhost_match_wildcard_host
code cleanup for localhost_match_wildcard_host
2014-09-12 17:21:34 +02:00
VilhoRaatikka
5a28a73fcb gwbuf_append's return value wasn't read in gw_read_client_event 2014-09-12 18:10:42 +03:00
MassimilianoPinto
8b5b4a17fe Merge from Z3
Merge from Z3
2014-09-11 12:51:16 +02:00
MassimilianoPinto
7245d1baa1 blr branch merge
blr branch merge
2014-09-11 12:20:42 +02:00
MassimilianoPinto
e74da1c630 Added chmod 0777 for unix sockets
Added chmod 0777 for unix sockets
2014-09-09 10:00:49 +02:00
Mark Riddoch
81e1dd8719 Merge branch 'develop' into blr
Add instrumentation

Remove mutexes

Improve gwbuf_append performance

Conflicts:
	server/core/dcb.c
	server/modules/protocol/mysql_backend.c
2014-08-28 11:41:26 +01:00
VilhoRaatikka
677a44f497 Merge from release-1.0beta to Z2 2014-08-15 18:00:39 +03:00
VilhoRaatikka
902004c1ee Fix to bug #463, http://bugs.skysql.com/show_bug.cgi?id=463
mysql_common.c:gw_MySQL_get_next_packet didn't handle case where an insert command followed by alter table in the same read buffer. It shouldn't been possible without multi-statement being set.
2014-08-14 22:33:57 +03:00
VilhoRaatikka
77e5525436 mysql_client.c:gw_error_client_event & gw_client_hangup_event: added session state check, if session is already closing, don't start redundant call to dcb_close.
mysql_common.c:mysql_protocol_done: added protocol state check. Used not to check it which caused double free of allocated memory.
2014-08-14 15:15:22 +03:00
VilhoRaatikka
d3a79ce7c4 Partial fix to #463, http://bugs.skysql.com/show_bug.cgi?id=463
log_manager.cc: fixed block buffer overflow. Queries are logged to trace log and long queries exceed the bufsize in length. Those were written beyond allocated memory areas.
mysql_client_server_protocol.h: added mysql_protocol_state_t to indicate whether MySQL protocol object is allocated, usable or freed. Freed means that memory allocations made by the protocol are freed. That is, command history etc.
mysql_backend.c: gw_backend_hangup and gw_error_backend_event used to call error handling function although session was already closing. Added check for session state.
mysql_client.c: route_by_statement lost some packets in case where query was sent in multiple packets.
mysql_common.c: gw_MySQL_get_next_packet failed in packet handling with route_by_statement. When multi-packet query was merged into one, packet type wasn't copied.
	protocol_archive_srv_command and mysql_protocol_done didn't have proper locking in place which lead to occasional crashes.
2014-08-14 13:05:05 +03:00
VilhoRaatikka
86a4c3ba90 Fix to #472, http://bugs.skysql.com/show_bug.cgi?id=472
Fix to #473, http://bugs.skysql.com/show_bug.cgi?id=473

Several memory issues. Read the code.
In general one-off hint is only added to gwbuf and freed in gwbuf_free. Stacked hint is copied to stack and to gwbuf. gwbuf is freed after routing but stacked hint is freed either in stop or when session is closed. All this applies to named hint as well except that in addition, it has one more copy in named hint struct which is emptied when session is closed.
2014-08-08 01:28:07 +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
VilhoRaatikka
7558abb6fa 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:execute_sescmd_in_backend: fixed a memory leak - visible only in DEBUG=Y build.
2014-08-05 10:42:13 +03:00
VilhoRaatikka
6b3c7041e3 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:execute_sescmd_in_backend: fixed a memory leak - visible only in DEBUG=Y build.
2014-08-05 09:31:10 +03:00
VilhoRaatikka
ef924cdc00 Added check for session state before calling router->sessionClose 2014-07-30 20:54:43 +03:00
VilhoRaatikka
b3656eba07 Added check for session state before calling route->closeSession 2014-07-30 20:43:43 +03:00
VilhoRaatikka
7a039e1a0b Added check for session state before calling router->closeSession 2014-07-30 20:40:08 +03:00
Mark Riddoch
4af2e58c86 Update plugin status to BETA 2014-07-04 09:23:40 +01:00
VilhoRaatikka
39679447c9 Bugzilla #455, MaxScale crashed due missing buffer type information in multi-buffer responses. 2014-07-03 19:20:45 +03:00