Merge branch '2.1' into develop

This commit is contained in:
Markus Mäkelä
2017-03-09 10:02:36 +02:00
19 changed files with 210 additions and 42 deletions

View File

@ -121,6 +121,13 @@ if(${MAXSCALE_VERSION} MATCHES "-stable")
endif()
endif()
# Copy cmake_flags, JENKINS_BUILD_TAG, source and value evironmental variables
# into cmake variables. These are used by the build system to store information
# about the packages being built.
set(MAXSCALE_SOURCE "$ENV{source} $ENV{value}")
set(MAXSCALE_CMAKE_FLAGS "$ENV{cmake_flags}")
set(MAXSCALE_JENKINS_BUILD_TAG "$ENV{BUILD_TAG}")
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/server/include)
configure_file(${CMAKE_SOURCE_DIR}/include/maxscale/version.h.in ${CMAKE_BINARY_DIR}/include/maxscale/version.h @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/include/maxscale/paths.h.in ${CMAKE_BINARY_DIR}/include/maxscale/paths.h @ONLY)

View File

@ -14,8 +14,13 @@
* Named Server Filter now supports wildcards for source option.
* Binlog Server can now be configured to encrypt binlog files.
* New filters, _cache_, _ccrfilter_, _insertstream_, _masking_, and _maxrows_ are introduced.
* GSSAPI based authentication can be used
* Prepared statements are now in the database firewall filtered exactly like non-prepared
statements.
* The firewall filter can now filter based on function usage.
For more details, please refer to:
* [MariaDB MaxScale 2.1.1 Release Notes](Release-Notes/MaxScale-2.1.1-Release-Notes.md)
* [MariaDB MaxScale 2.1.0 Release Notes](Release-Notes/MaxScale-2.1.0-Release-Notes.md)
## MariaDB MaxScale 2.0
@ -29,6 +34,7 @@ For more details, please refer to:
as JSON objects (beta level functionality).
For more details, please refer to:
* [MariaDB MaxScale 2.0.5 Release Notes](Release-Notes/MaxScale-2.0.5-Release-Notes.md)
* [MariaDB MaxScale 2.0.4 Release Notes](Release-Notes/MaxScale-2.0.4-Release-Notes.md)
* [MariaDB MaxScale 2.0.3 Release Notes](Release-Notes/MaxScale-2.0.3-Release-Notes.md)
* [MariaDB MaxScale 2.0.2 Release Notes](Release-Notes/MaxScale-2.0.2-Release-Notes.md)

View File

@ -0,0 +1,47 @@
# MariaDB MaxScale 2.0.5 Release Notes
Release 2.0.5 is a GA release.
This document describes the changes in release 2.0.5, when compared to
release [2.0.4](MaxScale-2.0.4-Release-Notes.md).
If you are upgrading from release 1.4, please also read the following
release notes:
[2.0.4](./MaxScale-2.0.4-Release-Notes.md),
[2.0.3](./MaxScale-2.0.3-Release-Notes.md),
[2.0.2](./MaxScale-2.0.2-Release-Notes.md),
[2.0.1](./MaxScale-2.0.1-Release-Notes.md) and
[2.0.0](./MaxScale-2.0.0-Release-Notes.md).
For any problems you encounter, please submit a bug report at
[Jira](https://jira.mariadb.org).
## Bug fixes
[Here](https://jira.mariadb.org/issues/?jql=project%20%3D%20MXS%20AND%20issuetype%20%3D%20Bug%20AND%20status%20%3D%20Closed%20AND%20fixVersion%20%3D%202.0.5)
is a list of bugs fixed since the release of MaxScale 2.0.4.
* [MXS-1130](https://jira.mariadb.org/browse/MXS-1130): Unexpected length encoding 'ff' encountered
* [MXS-1123](https://jira.mariadb.org/browse/MXS-1123): connect_timeout setting causes frequent disconnects
* [MXS-1081](https://jira.mariadb.org/browse/MXS-1081): Avro data file corruption
* [MXS-1025](https://jira.mariadb.org/browse/MXS-1025): qc_sqlite always reports " Statement was parsed, but not classified"
## Known Issues and Limitations
There are some limitations and known issues within this version of MaxScale.
For more information, please refer to the [Limitations](../About/Limitations.md) document.
## Packaging
RPM and Debian packages are provided for the Linux distributions supported
by MariaDB Enterprise.
Packages can be downloaded [here](https://mariadb.com/resources/downloads).
## Source Code
The source code of MaxScale is tagged at GitHub with a tag, which is derived
from the version of MaxScale. For instance, the tag of version `X.Y.Z` of MaxScale
is `maxscale-X.Y.Z`.
The source code is available [here](https://github.com/mariadb-corporation/MaxScale).

View File

@ -3,7 +3,11 @@
Release 2.1.1 is a Beta release.
This document describes the changes in release 2.1.1, when compared to
release 2.1.0.
release [2.1.0](MaxScale-2.1.0-Release-Notes.md).
If you are upgrading from release 2.0, please also read the following
release notes:
[2.1.0](./MaxScale-2.1.0-Release-Notes.md)
For any problems you encounter, please consider submitting a bug
report at [Jira](https://jira.mariadb.org).
@ -12,9 +16,20 @@ report at [Jira](https://jira.mariadb.org).
### Cache
The cache will now _also_ be used and populated in a transaction that is
* The cache will now _also_ be used and populated in a transaction that is
_not_ explicitly read only, but only until the first statement that modifies
the database is encountered.
* SELECT statements that refer to user or system variables are not cached.
* SELECT statements using functions whose result depend upon the current
user or context are not cached. Examples of such functions are `USER()`,
`RAND()` or `CURRENT_TIME()`.
### Firewall Filter
* Prepared statements are now treated exactly like non-prepared statements.
* Statements can now be accepted/rejected based upon function usage.
*NOTE* Both of these features were available already in _2.1.0_.
## Dropped Features
@ -43,14 +58,28 @@ after a failover has been triggered. This makes it possible for external actors
to recover the failed nodes without having to manually clear the maintenance
mode.
For more information about the failover mode and how it works, read the
For more information about the failover mode and how it works, please read the
[MySQL Monitor](../Monitors/MySQL-Monitor.md) documentation.
### GSSAPI
_GASSAPI_ based authentication can now be used with MaxScale.
For more information, please read the
[GSSAPI Authentication](../Authenticators/GSSAPI-Authenticator.md) documentation.
NOTE This feature was available already in _2.1.0_.
## Bug fixes
[Here is a list of bugs fixed since the release of MaxScale 2.1.0.](https://jira.mariadb.org/issues/?jql=project%20%3D%20MXS%20AND%20issuetype%20%3D%20Bug%20AND%20resolution%20in%20(Fixed%2C%20Done)%20AND%20fixVersion%20%3D%202.1.1%20AND%20fixVersion%20NOT%20IN%20(2.1.0))
*
* [MXS-1165](https://jira.mariadb.org/browse/MXS-1165) MaxInfo eat too much memory when getting list of session and client.
* [MXS-1143](https://jira.mariadb.org/browse/MXS-1143) Add support for new MariaDB 10.2 flags
* [MXS-1130](https://jira.mariadb.org/browse/MXS-1130) Unexpected length encoding 'ff' encountered
* [MXS-1081](https://jira.mariadb.org/browse/MXS-1081) Avro data file corruption
* [MXS-1077](https://jira.mariadb.org/browse/MXS-1077) Resource Leak
* [MXS-759](https://jira.mariadb.org/browse/MXS-759) Starting MaxScale from command line fails on CentOS 7
## Known Issues and Limitations

View File

@ -5,7 +5,7 @@
set(MAXSCALE_VERSION_MAJOR "2" CACHE STRING "Major version")
set(MAXSCALE_VERSION_MINOR "1" CACHE STRING "Minor version")
set(MAXSCALE_VERSION_PATCH "0" CACHE STRING "Patch version")
set(MAXSCALE_VERSION_PATCH "1" CACHE STRING "Patch version")
# This should only be incremented if a package is rebuilt
set(MAXSCALE_BUILD_NUMBER 1 CACHE STRING "Release number")

View File

@ -1,2 +1,5 @@
#define MAXSCALE_VERSION "@MAXSCALE_VERSION@"
#define MAXSCALE_COMMIT "@MAXSCALE_COMMIT@"
#define MAXSCALE_SOURCE "@MAXSCALE_SOURCE@"
#define MAXSCALE_CMAKE_FLAGS "@MAXSCALE_CMAKE_FLAGS@"
#define MAXSCALE_JENKINS_BUILD_TAG "@MAXSCALE_JENKINS_BUILD_TAG@"

View File

@ -16,6 +16,9 @@ include_directories(${CMAKE_BINARY_DIR}/sqlite-bld-3110100/tsrc)
include_directories(${CMAKE_BINARY_DIR}/sqlite-bld-3110100)
include_directories(${MARIADB_CONNECTOR_INCLUDE_DIR})
# GCC thinks there is an array-bounds error in sqlite code.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=array-bounds")
add_library(qc_sqlite SHARED qc_sqlite.c qc_sqlite3.c builtin_functions.c)
add_dependencies(qc_sqlite maxscale_sqlite)
add_definitions(-DMAXSCALE -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT -DSQLITE_OMIT_ATTACH -DSQLITE_OMIT_REINDEX -DSQLITE_OMIT_AUTOVACUUM -DSQLITE_OMIT_PRAGMA)

View File

@ -1778,6 +1778,17 @@ void mxs_sqlite3Update(Parse* pParse, SrcList* pTabList, ExprList* pChanges, Exp
exposed_sqlite3ExprDelete(pParse->db, pWhere);
}
void mxs_sqlite3Savepoint(Parse *pParse, int op, Token *pName)
{
QC_TRACE();
QC_SQLITE_INFO* info = this_thread.info;
ss_dassert(info);
info->status = QC_QUERY_PARSED;
info->type_mask = QUERY_TYPE_WRITE;
}
void maxscaleCollectInfoFromSelect(Parse* pParse, Select* pSelect, int sub_select)
{
QC_SQLITE_INFO* info = this_thread.info;

View File

@ -99,6 +99,7 @@ extern void mxs_sqlite3DropTable(Parse*, SrcList*, int, int, int);
extern void mxs_sqlite3EndTable(Parse*, Token*, Token*, u8, Select*, SrcList*);
extern void mxs_sqlite3Insert(Parse*, SrcList*, Select*, IdList*, int,ExprList*);
extern void mxs_sqlite3RollbackTransaction(Parse*);
extern void mxs_sqlite3Savepoint(Parse *pParse, int op, Token *pName);
extern int mxs_sqlite3Select(Parse*, Select*, SelectDest*);
extern void mxs_sqlite3StartTable(Parse*,Token*,Token*,int,int,int,int);
extern void mxs_sqlite3Update(Parse*, SrcList*, ExprList*, Expr*, int);
@ -312,10 +313,9 @@ cmdx ::= cmd. { sqlite3FinishCoding(pParse); }
//
%ifdef MAXSCALE
id_opt ::= .
id_opt ::= deferred_id.
cmd ::= BEGIN id_opt. {mxs_sqlite3BeginTransaction(pParse, 0);} // BEGIN [WORK]
work_opt ::= WORK.
work_opt ::= .
cmd ::= BEGIN work_opt. {mxs_sqlite3BeginTransaction(pParse, 0);} // BEGIN [WORK]
%endif
%ifndef MAXSCALE
cmd ::= BEGIN transtype(Y) trans_opt. {sqlite3BeginTransaction(pParse, Y);}
@ -329,9 +329,8 @@ transtype(A) ::= IMMEDIATE(X). {A = @X;}
transtype(A) ::= EXCLUSIVE(X). {A = @X;}
%endif
%ifdef MAXSCALE
cmd ::= COMMIT id_opt. {mxs_sqlite3CommitTransaction(pParse);}
cmd ::= END id_opt. {mxs_sqlite3CommitTransaction(pParse);}
cmd ::= ROLLBACK id_opt. {mxs_sqlite3RollbackTransaction(pParse);}
cmd ::= COMMIT work_opt. {mxs_sqlite3CommitTransaction(pParse);}
cmd ::= ROLLBACK work_opt. {mxs_sqlite3RollbackTransaction(pParse);}
%endif
%ifndef MAXSCALE
cmd ::= COMMIT trans_opt. {sqlite3CommitTransaction(pParse);}
@ -339,6 +338,20 @@ cmd ::= END trans_opt. {sqlite3CommitTransaction(pParse);}
cmd ::= ROLLBACK trans_opt. {sqlite3RollbackTransaction(pParse);}
%endif
%ifdef MAXSCALE
savepoint_opt ::= SAVEPOINT.
savepoint_opt ::= .
cmd ::= SAVEPOINT nm(X). {
mxs_sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &X);
}
cmd ::= RELEASE savepoint_opt nm(X). {
mxs_sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &X);
}
cmd ::= ROLLBACK work_opt TO savepoint_opt nm(X). {
mxs_sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &X);
}
%endif
%ifndef MAXSCALE
savepoint_opt ::= SAVEPOINT.
savepoint_opt ::= .
@ -603,6 +616,7 @@ columnid(A) ::= nm(X). {
UNSIGNED
VALUE VIEW /*VIRTUAL*/
/*WITH*/
WORK
%endif
.
%wildcard ANY.

View File

@ -462,6 +462,7 @@ static Keyword aKeywordTable[] = {
{ "WHEN", "TK_WHEN", ALWAYS },
{ "WHERE", "TK_WHERE", ALWAYS },
#ifdef MAXSCALE
{ "WORK", "TK_WORK", ALWAYS },
{ "WRITE", "TK_WRITE", ALWAYS },
#endif
{ "ZEROFILL", "TK_ZEROFILL", ALWAYS },

View File

@ -71,3 +71,9 @@ COMMIT WORK;
ROLLBACK;
ROLLBACK WORK;
SAVEPOINT id;
ROLLBACK WORK TO SAVEPOINT id;
ROLLBACK TO SAVEPOINT id;
ROLLBACK WORK TO id;
ROLLBACK TO id;
RELEASE SAVEPOINT id;

View File

@ -3302,40 +3302,51 @@ bool config_param_is_valid(const MXS_MODULE_PARAM *params, const char *key,
break;
case MXS_MODULE_PARAM_INT:
strtol(value, &endptr, 10);
if (endptr != value && *endptr == '\0')
{
valid = true;
errno = 0;
long int v = strtol(value, &endptr, 10);
(void)v; // error: ignoring return value of 'strtol'
if ((errno == 0) && (endptr != value) && (*endptr == '\0'))
{
valid = true;
}
}
break;
case MXS_MODULE_PARAM_SIZE:
strtoll(value, &endptr, 10);
if (endptr != value)
{
switch (*endptr)
errno = 0;
long long int v = strtoll(value, &endptr, 10);
(void)v; // error: ignoring return value of 'strtoll'
if (errno == 0)
{
case 'T':
case 't':
case 'G':
case 'g':
case 'M':
case 'm':
case 'K':
case 'k':
if (*(endptr + 1) == '\0' ||
((*(endptr + 1) == 'i' || *(endptr + 1) == 'I') && *(endptr + 2) == '\0'))
if (endptr != value)
{
valid = true;
switch (*endptr)
{
case 'T':
case 't':
case 'G':
case 'g':
case 'M':
case 'm':
case 'K':
case 'k':
if (*(endptr + 1) == '\0' ||
((*(endptr + 1) == 'i' || *(endptr + 1) == 'I') && *(endptr + 2) == '\0'))
{
valid = true;
}
break;
case '\0':
valid = true;
break;
default:
break;
}
}
break;
case '\0':
valid = true;
break;
default:
break;
}
}
break;

View File

@ -2708,7 +2708,7 @@ dcb_accept(DCB *listener)
client_dcb->fd = c_sock;
// get client address
if (((struct sockaddr *)&client_conn)->sa_family == AF_UNIX)
if (client_conn.ss_family == AF_UNIX)
{
// client address
client_dcb->remote = MXS_STRDUP_A("localhost_from_socket");

View File

@ -1368,6 +1368,18 @@ int main(int argc, char **argv)
case 'V':
rc = EXIT_SUCCESS;
printf("MaxScale %s - %s\n", MAXSCALE_VERSION, maxscale_commit);
if (strcmp(MAXSCALE_SOURCE, " ") != 0)
{
printf("Source: %s\n", MAXSCALE_SOURCE);
}
if (strcmp(MAXSCALE_CMAKE_FLAGS, "") != 0)
{
printf("CMake flags: %s\n", MAXSCALE_CMAKE_FLAGS);
}
if (strcmp(MAXSCALE_JENKINS_BUILD_TAG, "") != 0)
{
printf("Jenkins build: %s\n", MAXSCALE_JENKINS_BUILD_TAG);
}
goto return_main;
case 'l':

View File

@ -769,6 +769,7 @@ sessionRowCallback(RESULTSET *set, void *data)
SESSIONFILTER *cbdata = (SESSIONFILTER*)data;
RESULT_ROW *row = NULL;
cbdata->current = 0;
dcb_foreach(dcb_iter_cb, cbdata);
if (cbdata->row)

View File

@ -232,6 +232,20 @@ int CacheFilterSession::routeQuery(GWBUF* pPacket)
}
break;
case MYSQL_COM_STMT_PREPARE:
if (log_decisions())
{
MXS_NOTICE("MYSQL_COM_STMT_PREPARE, ignoring.");
}
break;
case MYSQL_COM_STMT_EXECUTE:
if (log_decisions())
{
MXS_NOTICE("MYSQL_COM_STMT_EXECUTE, ignoring.");
}
break;
case MYSQL_COM_QUERY:
if (should_consult_cache(pPacket))
{

View File

@ -122,7 +122,7 @@ AVRO_TABLE* avro_table_alloc(const char* filepath, const char* json_schema, cons
if (access(filepath, F_OK) == 0)
{
rc = avro_file_writer_open(filepath, &table->avro_file);
rc = avro_file_writer_open_bs(filepath, &table->avro_file, block_size);
}
else
{

View File

@ -594,7 +594,8 @@ bool rwsplit_get_dcb(DCB **p_dcb, ROUTER_CLIENT_SES *rses, backend_type_t btype,
* backend and update assign it to new candidate if
* necessary.
*/
else if (SERVER_IS_SLAVE(&server))
else if (SERVER_IS_SLAVE(&server) ||
(rses->rses_config.master_accept_reads && SERVER_IS_MASTER(&server)))
{
if (max_rlag == MAX_RLAG_UNDEFINED ||
(b->server->rlag != MAX_RLAG_NOT_AVAILABLE &&

View File

@ -3313,11 +3313,13 @@ static rses_property_t* mysql_sescmd_get_property(mysql_sescmd_t* scmd)
}
/**
* Return RCAP_TYPE_STMT_INPUT.
* @brief Get router capabilities
*
* @return Always RCAP_TYPE_CONTIGUOUS_INPUT
*/
static uint64_t getCapabilities(MXS_ROUTER* instance)
{
return RCAP_TYPE_STMT_INPUT;
return RCAP_TYPE_CONTIGUOUS_INPUT;
}
/**