Commit Graph

5939 Commits

Author SHA1 Message Date
c36e5f6ba4 C_DEBUG removed and added a check for packetlen < MAXROWS_EOF_PACKET_LEN
C_DEBUG removed.
A check is now made for packetlen < MAXROWS_EOF_PACKET_LEN.
An empty result set, OK, is send in such situation
2016-11-07 16:19:38 +01:00
9f01a4612d EOF flags are now read in case 0xfe
EOF flags are now read in case 0xfe and minor improvements
2016-11-07 10:01:05 +01:00
5b7e5aa36f SERVER_MORE_RESULTS_EXIST is now detected
The filter can detect SERVER_MORE_RESULTS_EXIST which means the server
is sending more result sets: example:

DROP PROCEDURE IF EXISTS multi;
DELIMITER $$
CREATE PROCEDURE multi() BEGIN
  SELECT 1;
  SELECT id FROM t2 limit 40;
  set @a=4;
  SELECT 2;
END$$
DELIMITER ;

MySQL> call multi()
2016-11-04 15:48:14 +01:00
094586adbc Merge branch 'develop' into MXS-930 2016-11-04 15:29:40 +01:00
96547a1c0d Fix failure to exit on configuration error
The check for the success of the configuration file always resulted in a
successful return value even if the loading failed.

In addition to this, a log message referred to the active configuration
when the active configuration was set only after the processing was
complete. Since configuration failures are always fatal, there's no harm
in preemptively setting the active configuration to the one currently
being processed.
2016-11-04 14:53:54 +02:00
f38b510d2b MXS-962: Add nonpositive priority for Galera nodes
If a Galera node has a nonpositive priority, the node will never be chosen
as the master. This gives the user more control over how the master is
chosen.
2016-11-03 22:22:25 +02:00
8778e0c81e Make Users const correct 2016-11-03 09:35:49 +02:00
45f463c438 Require GCC 4.8 for RocksDB
GCC 4.8 is the first GCC version that fully implements C++11
2016-11-03 09:27:58 +02:00
02d28a8d8d Always use format strings in dcb_printf
The luafilter didn't use a format string with dcb_printf which can lead to
unexpected results if the returned string contains printf special
characters.
2016-11-03 09:23:36 +02:00
af65ee0ef9 qc: Ensure type is uint32_t
Some C++ compiler complains about signed being compared with unsigned.
2016-11-03 08:30:45 +02:00
c652f1330a qc: Add qc_get_field_info
This function returns more detailed information about the fields
of a statement. Supersedes qc_get_affected_fields() that will
be deprecated and removed.

Note that this function now introduced new kind of behaviour; the
returned data belongs to the GWBUF and remains valid for as long as
the GWBUF is alive. That means that unnecessary copying need not
be done.
2016-11-02 15:50:21 +02:00
ab487e687f qc: Remove QUERY_IS_TYPE macro
Explicit call to qc_query_is_type() instead.
2016-11-02 15:50:21 +02:00
8a6e3fb49f Merge branch 'develop' into MXS-930 2016-11-02 08:57:40 +01:00
d69025bfa6 Add changes to persistent connections to documentation
The documentation now states that, starting with 2.1, the persistent
connections will reset the MySQL session state when they are taken into
use.
2016-11-01 12:41:43 +02:00
57eb599769 qc_mysqlembedded: Fix missing functionality 2016-11-01 12:11:56 +02:00
f7c3150462 qc_sqlite: Copy preparable statement
Peeking into the token does not always work.
2016-11-01 12:11:56 +02:00
c0e29691e0 qc_mysqlembedded: Return prepare name for EXECUTE 2016-11-01 12:11:56 +02:00
5085b41d20 Reset persistent MySQL connections
When a persistent connection is taken from the pool, the state is reset
with a COM_CHANGE_USER on the next write. This allows reuse of persistent
connections without having to worry about the state of the MySQL session.
2016-11-01 10:50:07 +02:00
e8e2933b56 Add authenticator section to Documentation Contents
The authenticator documents are now linked in the main document.
2016-10-31 22:46:20 +02:00
8662221ec1 qc_mysqlembedded: Add qc_get_prepare_operation 2016-10-31 18:23:43 +02:00
91e36ecaed Make PREPARE operation explicit
The operation of the statement to be prepared is no longer
reported as the operation of the PREPARE statement.

Instead, when the type of the statement is
QUERY_TYPE_PREPARE_NAMED_STMT, the operation can be obtained
using qc_get_prepare_operation().

The qc_mysqlembedded implementation will be provided in a
subsequent commit.
2016-10-31 13:44:48 +02:00
8c20ad5cd0 MXS-304: Support hierarchical reload
'reload config' now also processes all configuration files
of a hierarchy.
2016-10-31 12:48:38 +02:00
60f0c2ecaa MXS-304: Update documentation. 2016-10-31 12:48:38 +02:00
f71f41b0b8 MXS-304: Check duplicate sections across all files 2016-10-31 12:48:38 +02:00
2116c1549c MXS-304: Refactor duplicate section detection
Preparatory work for being able to check duplicate sections across
multiple files. Data needed for the checking is held in a separate
object.
2016-10-31 12:48:38 +02:00
daf6f06138 MXS-304: Support nested configuration files
Given a config file "config.cnf", we look for the directory
"config.cnf.d" and recursively in that hierarhcy load all files
whose suffix is ".cnf"; other files are ignored.

Currently duplicate sections are checked on a file by file basis.
That will be changed so that duplicate sections are not allowed
across all the files.
2016-10-31 12:48:38 +02:00
ab372b291b MXS-304: Minor refactoring of config.c
The loading of a single file refactored out into a separate function.
To be used later when multiple files are loaded and processed.
2016-10-31 12:48:38 +02:00
5a1af968d2 Take contiguous input capability into use in filters
The filters which require contiguous input now return the
RCAP_TYPE_CONTIGUOUS_INPUT capability flag.
2016-10-31 08:38:05 +02:00
282ed9f8c2 Start MaxScale as the maxscale user with systemd
Systemd allows MaxScale to start as the 'maxscale' user and it should be
done to completely prevent root access for the maxscale process.
2016-10-29 11:03:15 +03:00
3c26ea16e2 Add and use FindSQLite.cmake
Added a find_package module for SQLite development libraries.
2016-10-28 12:49:18 +03:00
1be3bb9b8d Minor cleanup of config.[h|c]
- Add const where applicable.
- Cleanup header files.

Fix collateral damage (statistics.c) as well.
2016-10-27 15:55:26 +03:00
bbade8b736 PCRE2_CODE_UNIT_WIDTH must not be defined. 2016-10-27 15:26:41 +03:00
1728e2dc2e Minor cleanup of gateway.c
Pre-parsing of configuration file moved to separate function. To
make it slightly easier to see the forest for the trees.
2016-10-27 14:50:22 +03:00
6c80f2bc0a Cleanup gateway.c include files
- First <maxscale/cdefs.h>
- Then all system, c-runtime, OS include files in alphabetical order.
- Then include files for "3rd-party" software in a loose order of
  importance.
- Then maxscale headers ordered alphabetically.
2016-10-27 14:13:31 +03:00
a390331e42 Feature defines moved to <maxscale/cdefs.h>
Feature defines that affect the available functionality or the
compile time environment should be defined in a common way for
all source.
2016-10-27 14:08:58 +03:00
6cc7a26582 Cache: Add forgotten change 2016-10-27 13:54:22 +03:00
dcfd5b7601 maxrows now handles SHOW statements and SELECT in prepared statements
maxrows now handles SHOW statements and SELECT in prepared statements
2016-10-27 11:34:01 +02:00
0cfb82f146 The MAXROWS_DISCARDING_RESPONSE is handled differently
The MAXROWS_DISCARDING_RESPONSE is handled differently: the OK packet
is sent only after an EOF is seen in a reply even with multiple packet
transmission from the backend
2016-10-27 10:53:07 +02:00
199dd51312 Cache: C_DEBUG removed and debug option extended
The development time C_DEBUG is now removed, and replaced with
a debug option that allows top-level decisions to be logged.
2016-10-27 11:10:36 +03:00
c73c3b390a Addition of MAXROWS_DISCARDING_RESPONSE
Addition of MAXROWS_DISCARDING_RESPONSE

Packets received after sent OK are consumed and not sent
2016-10-27 09:25:08 +02:00
b76cdfd367 qc_sqlite: Pick out prepare name in DEALLOCATE stmt 2016-10-26 21:00:54 +03:00
cbef9b944d qc_sqlite: Pick out the name in an EXECUTE stmt 2016-10-26 20:47:40 +03:00
59b3a1fe36 Handle max_resultset_size in maxrows
Handle max_resultset_size in maxrows
2016-10-26 19:20:25 +02:00
7419ddceca Code review update
Code review update
2016-10-26 19:12:56 +02:00
50db0db316 MXS-934: Set operation of PREPARE statement
The operation of a PREPARE statement will be that of the preparable
statement. That will make it possible to know whether an EXECUTEd
prepared statement e.g. is a SELECT or an UPDATE.
2016-10-26 20:11:26 +03:00
5aa0c32e8f Minor changes
Minor changes
2016-10-26 18:58:07 +02:00
48af3d21b6 max rows filter first implementation
max rows filter first implementation

Resultsets with more than max_resultset_rows

will be skipped and empty result set is returned to client.
Not yet tested with multi_statements
[MaxRows]
type=filter
module=maxrows
max_resultset_rows=10
debug=15
2016-10-26 15:58:06 +02:00
23fdf1776c qc: Pick out the name in a PREPARE statement 2016-10-26 14:42:25 +03:00
7499c1e1bf qc: Add minimal support for qc_get_prepare_name
If the query is a PREPARE or EXECUTE statement, then qc_get_prepare_name
will return the name of the prepared statement.
2016-10-26 14:36:37 +03:00
19e017e499 QC: Documentation cleaned up and moved to header 2016-10-26 14:22:41 +03:00