162 Commits

Author SHA1 Message Date
VilhoRaatikka
fd11e6a7f5 Session-specific logging. Added functions
void session_enable_log(SESSION* ses, logfile_id_t id)
and
void session_disable_log(SESSION* ses, logfile_id_t id)

Which switch specific log type on/off if the log type in question is not generally enabled.

Each thread carries a thread-specific struct log_info_t which includes members for current session id and bitfield for enabled log types for the current session. That information is checked before actual log write functions are called.

Each file where session-specific logging is used, must include the following exports:

/** Defined in log_manager.cc */
extern int            lm_enabled_logfiles_bitmask;
extern size_t         log_ses_count[];
extern __thread log_info_t tls_log_info;
2014-11-19 00:08:59 +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
c9b679359f Made RWSplit to use slave selection criteria also during client session. Previously the criteria was use when slaves were selected for use of client session. 2014-11-17 13:40:18 +02:00
VilhoRaatikka
4f136fa4d2 Fixed backend selection logic in get_dcb. If slave is not found write a warning to error log and fall through to master selection. If master has changed or previous master's state has changed, routing fails. 2014-11-15 23:57:09 +02:00
VilhoRaatikka
175711a1bc Fix to #601, http://bugs.skysql.com/show_bug.cgi?id=601
if (func.auth ==)gw_change_user->gw_send_change_user_to_backend is called before backend has its scramble, auth packet is set to backend's delauqueue instead of writing it to backend. When backend_write_delayqueue is called COM_CHANGE_USER packets are rewritten with backend's current data.
2014-11-13 17:55:29 +02:00
VilhoRaatikka
0ea4dd63a9 Merge branch 'develop' of https://github.com/mariadb-corporation/MaxScale into develop 2014-11-11 14:25:49 +02:00
VilhoRaatikka
128d5e3f48 Addition to previous fix 2014-11-11 14:25:34 +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
MassimilianoPinto
49d28bc1f3 MySQL connect: charset flag is stored
MySQL connect: charset flag is stored and passed to backend
2014-11-10 16:09:55 +01:00
Markus Makela
e86b51865c Fixes to Coverity errors 72653, 72685, 72707, 73391, 73393, 73394, 73410 and 73414. 2014-11-10 13:51:21 +02:00
VilhoRaatikka
7615e9c0ac Merge branch 'develop' of https://github.com/mariadb-corporation/MaxScale into develop 2014-10-31 15:28:58 +02:00
VilhoRaatikka
00fded016b Fixes to Coverity tasks : 73267, 72686, 72672
Cleaned up warnings, and added checks to malloc return values and error log writes in case of failures.
2014-10-31 15:25:59 +02:00
MassimilianoPinto
09b3351427 Added mysqld_error.h in dbusers
Added mysqld_error.h in dbusers
2014-10-31 11:22:15 +01:00
VilhoRaatikka
236a72a6b6 Fix to bug #590, http://bugs.mariadb.com/show_bug.cgi?id=590
mysql_common.c:gw_send_change_user_to_backend creates new authentication message which is to be sent to backend. GWBUG type flags were not copied from original GWBUF to new one. Thus the information that this is a session command was lost and it was processed in a wrong way. Especially replies were all routed back to client which caused misbehavior.
2014-10-25 00:19:31 +03:00
MassimilianoPinto
7b5d2df7a6 mysql_send_custom_error returns write operation
mysql_send_custom_error returns write operation
2014-10-24 17:21:07 +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
c54e087d3e Merge from develop
Merge from develop
2014-10-20 09:03:11 +02:00
MassimilianoPinto
319dd4b3e6 Fix for no db in change_user
Fix for no db in change_user
2014-10-20 09:01: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
f2362c3359 Auth error message fix for using password: YES,NO
Auth error message fix for using password: YES,NO
This applies to a “not found user” trying to authenticate with or
without password
2014-10-16 12:50:14 +02:00
MassimilianoPinto
0769deed7f MySQL Authentication with DBname
MySQL Authentication with DBname
2014-10-15 17:26:46 +02:00
MassimilianoPinto
a194c47b07 Updated test_mysql_users
Updated test_mysql_users
2014-10-14 12:33:56 +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
MassimilianoPinto
18ae3e35ef develop branch merged
develop branch merged
2014-10-10 15:30:56 +02:00
VilhoRaatikka
d16bb227e9 Completing fix to bug #565, http://bugs.mariadb.com/show_bug.cgi?id=565
Client's flags are also used when changing the user inside the session.
2014-10-09 16:37:26 +03: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
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
MassimilianoPinto
dbe078f358 MySQL Authentication with wildcards in hosts
MySQL Authentication:

Added support for wildcards in hosts:

a.b.c.%
a.b.%.%
a.%.%.%
2014-10-03 17:26:41 +02:00
MassimilianoPinto
48489234be Merge branch 'develop' into MAX-268 2014-10-03 16:28:38 +02: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
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
MassimilianoPinto
c3dd8d973a Code cleanup
Code cleanup
2014-09-30 13:19:03 +02: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
MassimilianoPinto
5f6d04e7db Match for Class C,B,A in hosts with %
Match for Class C,B,A in hosts with %
2014-09-29 16:50:21 +02:00
MassimilianoPinto
76320c056b Match Class C,B,A addresses
Match Class C,B,A addresses
2014-09-29 12:08:10 +02:00
MassimilianoPinto
1d14129edf Merge branch 'develop' into MAX-268 2014-09-29 09:51:57 +02:00
VilhoRaatikka
5ec1a83f3b Fix to #478, http://bugs.skysql.com/show_bug.cgi?id=478
Execution of session commands failed because session commands and normal sql statements were executed in a wrong order if backend was executing previous session command while new sql stmt was routed to that backend. There was a window where ordering went wrong.
It is possible that one normal sql stmt arrives while previous sescmds are still being executed.

Introduced a new member in backend_ref_t structure, bref_pending_cmd where new sql stmt pointer is stored in that case. When sescmds are executed completely, that command is automatically executed next.
2014-09-26 15:40:32 +03:00
MassimilianoPinto
3fdfc5db8d Code cleanup
Code cleanup
2014-09-25 13:13:52 +02:00
MassimilianoPinto
717f24ce48 Added first support for user@x.y.z.%
Added first support for user@x.y.z.%
2014-09-25 13:08:12 +02: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
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
acdc2968c7 Added LogFile entry for failed match
Added LogFile entry for failed match
2014-09-12 17:34:13 +02:00
MassimilianoPinto
7108add6f5 code cleanup localhost_match_wildcard_host
code cleanup for localhost_match_wildcard_host
2014-09-12 17:21:34 +02:00