19 Commits

Author SHA1 Message Date
Johan Wikman
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
Markus Mäkelä
8721c9117a
Expose function for checking MYSQL connection errors
If a query done via the connector fails, the return value can be inspected
with the function. This helps separate fatal problems from transient ones.
2018-06-16 23:29:39 +03:00
Markus Mäkelä
2181c9d240
Include MariaDB Connector-C headers first
The MariaDB Connector-C headers that are built by MaxScale must be
included before any system headers.

Fixed code that explicitly included the <mysql.h> header to use the
<maxscale/protocol/mysql.h> wrapper instead.
2018-02-07 16:07:17 +02:00
Johan Wikman
90fdbf8860 MXS-1652 Add possibility to log SQL statements
With the flag --debug=enable-statement-logging it is now possible
to instruct MaxScale to log all SQL statements it sends to the
servers.

The format of the logged string looks like:

    notice : SQL(127.0.0.1): 0, "SELECT ..."

First the fixed string "SQL", followed by the server address in
parenthesis followed by the actual return value of mysql_query(),
followed by the statement itself.

The "SQL" string makes the lines easy to grep for and having the
return value before the statement makes it easier to spot since
the length of the return value string does not wary much, but the
length of the statements do wary a lot.
2018-02-06 14:30:29 +02:00
Markus Mäkelä
0bc439641a Add helper function for reading values by field name
The helper function provides map-like access to row values. This is used
to retrieve the values for all MariaDB 10.0+ versions as there are
differences in the returned results between 10.1 and 10.2.
2017-10-27 15:31:46 +03:00
Markus Mäkelä
bd39284f9c Merge branch '2.1' into 2.2 2017-10-03 14:30:06 +03:00
Markus Mäkelä
f1f8a4b5b2 MXS-1367: Retry interrupted queries
The new `query_retries` parameter controls how many times an interrupted
query is retried. This retrying of interrupted queries will reduce the
rate of false positives that MaxScale monitors detect.
2017-10-03 10:57:10 +03:00
Johan Wikman
4e73aecdef MXS-1249: Modifications after rebase on develop 2017-06-21 13:28:59 +03:00
Johan Wikman
d927f1d3c6 MXS-1249: Add utility function for setting the server version
Add utility function for setting the server version from a
MySQL handle.
2017-06-21 13:28:59 +03:00
Johan Wikman
f546a17e77 Update change date of 2.2 2017-06-01 10:24:20 +03:00
Johan Wikman
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
Johan Wikman
18008dec6d Rename mxs_mysql_account_to_pcre
The function is not capable of doing the right thing for an entire
account string, but only separately for user and host names, so the
function name should reflect that.
2016-12-29 11:47:08 +02:00
Johan Wikman
997bec868f Move transforming function to common place
Move function for converting a MySQL account string to an
equivalent PCRE one, from Cache's rules.cc to mysql_utils.
2016-12-29 11:09:06 +02:00
Johan Wikman
c6e155cf2b Move quote triming function to common place
Function for removing MySQL quote characters surrounding a
string moved from Cache's rules.cc to common place and renamed.

The function was now moved to mysql_utils.[h|c], which is in
maxscale-common, and not to the perhaps more appropriate place
protocol/mysql.h, as the latter would have implied that MySQLCommon
would have to be linked to, which actually might be the right thing
to do. However, that has to wait until protocol/mysql.h gets an
overhaul.
2016-12-29 11:09:06 +02:00
Johan Wikman
b40872e600 Prefix le[int|str]-functions with "mxs_" 2016-12-29 10:10:11 +02:00
Johan Wikman
c008d794c7 Add const correctness to mysql_util.h 2016-12-27 15:52:55 +02:00
Johan Wikman
d7ce3ad75b Replace include guards with #pragma once 2016-10-26 08:23:15 +03:00
Johan Wikman
1a978be6b6 Cleanup header files
- All now include maxscale/cdefs.h as the very first file.
- MXS_[BEGIN|END]_DECLS added to all C-headers.
  Strictly speaking not necessary for private headers, but
  does not hurt either.
- Include guards moved to the very top of the file.
- #pragma once added.
2016-10-14 11:54:37 +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