15 Commits

Author SHA1 Message Date
Johan Wikman
db2cccbd8f Replace getCapabilities() with getCapabilities(void)
The latter means no args, the former means any args.
2016-10-24 11:19:43 +03:00
Johan Wikman
693d8dcbb4 Track session autocommit state
This tracks only what is explicitly set. That is, if autocommit
has been set true then, even if a transaction is started, autocommit
will not be set false.

That is, a user of the session autocommit and transaction states
need to be aware of their semantics. If a transaction is active,
then the state of autocommit is irrelevant.
2016-10-21 13:58:51 +03:00
Markus Makela
3484b34747 Copy client information also for SSL connection
When a MySQL SSL connection is made, the first packet from the client will
contain the SSLRequest packet. This packet is a truncated normal auth
packet and the real auth packet will be sent after SSL has been
established.

The MySQLClient protocol should read the client information for SSL
connections after SSL has been established.
2016-10-21 11:47:27 +03:00
Markus Makela
9ef06c7d2f MXS-650: Use correct package number for error messages
When a client without SSL connected to a listener which requires SSL, the
error message always used the package sequence number 3 even if the
response was the second packet.

Also fixed debug assertions which failed when non-SSL connections were
created to SSL listeners.
2016-10-21 11:24:22 +03:00
Johan Wikman
d397533e7f MXS-983: Update session transaction state
Not final implementation, we may need to track what response
the server returns.
2016-10-20 23:13:55 +03:00
Johan Wikman
6bcb3ce4dc Change capabilities to uint64_t
- Since the capabilities are a bitmask, it is better if an unsigned
  integral type is used.
- Since the function is part of an ABI, it is better if an explicit
  size is used.
- 64-bits so that there also is room for independent filter
  capabilities.
2016-10-20 20:14:59 +03:00
Johan Wikman
e9f94dcd9d mysql_common.c and mysql_client.c astyled 2016-10-19 09:27:15 +03:00
Markus Makela
891ce2d0e7 MXS-862: Move client information extraction to client protocol
The client protocol module now extracts the information that is relevant
for all modules. Currently this information consists of the client
capabilities, character set, username and default database.
2016-10-18 14:23:43 +03:00
Johan Wikman
f0cf391c18 include/maxscale/gw.h removed.
In a subsequent change, the includes of server/core/*.c will be
cleaned up, and if there is a common set of include files, needed
by most, then a server/core/maxscale/core.h that includes those
will be introduced.
2016-10-17 12:17:09 +03:00
Johan Wikman
1333da0712 Remove skygw_utils.h
The general purpose stuff in skygw_utils.h was moved to utils.h
and the corresponding implementation from skygw_utils.cc to utils.c.
Includes updated accordingly.

Skygw_utils.h is now only used by log_manager and by mlist, which
is only used by log_manager. Consequently, skygw_utils.h was moved
to server/maxscale.

Utils.h needs a separate overhaul.
2016-10-14 19:50:54 +03:00
Markus Makela
571919264f MXS-862: Make packet sequence handling automatic
Made the packet sequence number handling automatic so that it always uses
the correct one.

All functions now have documentation in them. Cleaned up code and added
comments to GSSAPI code.
2016-10-14 18:25:38 +03:00
Johan Wikman
3a18b64bdd mysql_client_server_protocol.h moved.
Moved to include/maxscale/protocol/mysql.h
2016-10-13 22:59:39 +03:00
Johan Wikman
e41589be10 Move headers from server/include to include/maxscale
- Headers now to be included as <maxscale/xyz.h>
- First step, no cleanup of headers has been made. Only moving
  from one place to another + necessary modifications.
2016-10-13 16:19:20 +03:00
Markus Makela
5d96faedd8 MXS-862: Move sending of OK packet to mysql_client
Moving the sending of the final OK packet of the authentication process to
the client protocol plugin makes the authentication plugins simpler.

By reading the client's sequence and incrementing that by one, the client
protocol module will always send the correct sequence byte in the final OK
packet.
2016-10-13 15:51:53 +03:00
Markus Makela
cb7c112764 MXS-862: Create common MySQL library
The MySQLCommon library contains functions used by both the protocol and
authenticator modules. The contents of the modutil.c file could also be
moved to this file if the functions in that file are only used by modules
and not the core.
2016-10-13 15:51:52 +03:00