Develop Merge
Develop Merge
This commit is contained in:
@ -165,6 +165,10 @@ matched. The symbolic comparison operators (`<`, `>`, `>=` etc.) are also
|
|||||||
considered functions whereas the text versions (`NOT`, `IS`, `IS NOT` etc.) are
|
considered functions whereas the text versions (`NOT`, `IS`, `IS NOT` etc.) are
|
||||||
not considered functions.
|
not considered functions.
|
||||||
|
|
||||||
|
When the filter is in whitelist mode (`action=allow`) the function rule
|
||||||
|
will match any query that does not use a function. This means that queries
|
||||||
|
that do not use functions will be allowed through a function type rule.
|
||||||
|
|
||||||
##### Example
|
##### Example
|
||||||
|
|
||||||
Deny SUM and COUNT functions:
|
Deny SUM and COUNT functions:
|
||||||
|
@ -54,6 +54,12 @@ The `match` and `exclude` parameters were changed to use PCRE2 syntax for the
|
|||||||
regular expressions. The regular expression should be enclosed by slashes
|
regular expressions. The regular expression should be enclosed by slashes
|
||||||
e.g. `match=/select.*from.*test/`.
|
e.g. `match=/select.*from.*test/`.
|
||||||
|
|
||||||
|
### Dbfwfilter
|
||||||
|
|
||||||
|
The `function` type rule will now match a query that does not use a function
|
||||||
|
when the filter is in whitelist mode (`action=allow`). This means that queries
|
||||||
|
that don't use functions are allowed though in whitelist mode.
|
||||||
|
|
||||||
## Dropped Features
|
## Dropped Features
|
||||||
|
|
||||||
### MaxAdmin
|
### MaxAdmin
|
||||||
|
@ -174,7 +174,11 @@ data block. The default value is 1000 row events.
|
|||||||
#### `block_size`
|
#### `block_size`
|
||||||
|
|
||||||
The Avro data block size in bytes. The default is 16 kilobytes. Increase this
|
The Avro data block size in bytes. The default is 16 kilobytes. Increase this
|
||||||
value if individual events in the binary logs are very large.
|
value if individual events in the binary logs are very large. The value is a
|
||||||
|
size type parameter which means that it can also be defined with an SI
|
||||||
|
suffix. Refer to the
|
||||||
|
[Configuration Guide](../Getting-Started/Configuration-Guide.md) for more
|
||||||
|
details about size type parameters and how to use them.
|
||||||
|
|
||||||
## Module commands
|
## Module commands
|
||||||
|
|
||||||
|
@ -246,12 +246,17 @@ bool maxavro_read_float(MAXAVRO_FILE* file, float *dest)
|
|||||||
{
|
{
|
||||||
bool rval = false;
|
bool rval = false;
|
||||||
|
|
||||||
if (file->buffer_ptr + sizeof(*dest) < file->buffer_end)
|
if (file->buffer_ptr + sizeof(*dest) <= file->buffer_end)
|
||||||
{
|
{
|
||||||
memcpy(dest, file->buffer_ptr, sizeof(*dest));
|
memcpy(dest, file->buffer_ptr, sizeof(*dest));
|
||||||
file->buffer_ptr += sizeof(*dest);
|
file->buffer_ptr += sizeof(*dest);
|
||||||
rval = true;
|
rval = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ss_dassert(!true);
|
||||||
|
MXS_ERROR("Block cannot hold a value of type float");
|
||||||
|
}
|
||||||
|
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
@ -280,12 +285,17 @@ bool maxavro_read_double(MAXAVRO_FILE* file, double *dest)
|
|||||||
{
|
{
|
||||||
bool rval = false;
|
bool rval = false;
|
||||||
|
|
||||||
if (file->buffer_ptr + sizeof(*dest) < file->buffer_end)
|
if (file->buffer_ptr + sizeof(*dest) <= file->buffer_end)
|
||||||
{
|
{
|
||||||
memcpy(dest, file->buffer_ptr, sizeof(*dest));
|
memcpy(dest, file->buffer_ptr, sizeof(*dest));
|
||||||
file->buffer_ptr += sizeof(*dest);
|
file->buffer_ptr += sizeof(*dest);
|
||||||
rval = true;
|
rval = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ss_dassert(!true);
|
||||||
|
MXS_ERROR("Block cannot hold a value of type double");
|
||||||
|
}
|
||||||
|
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
./non_native_setup insertstream
|
||||||
./mysqltest_driver.sh insertstream insertstream 4006
|
./mysqltest_driver.sh insertstream insertstream 4006
|
||||||
|
@ -36,6 +36,10 @@ fi
|
|||||||
|
|
||||||
echo $source copied to $target
|
echo $source copied to $target
|
||||||
|
|
||||||
|
test_dir=`pwd`
|
||||||
|
|
||||||
|
$test_dir/non_native_setup $1
|
||||||
|
|
||||||
password=
|
password=
|
||||||
if [ $# -ge 3 ]
|
if [ $# -ge 3 ]
|
||||||
then
|
then
|
||||||
|
@ -36,8 +36,6 @@ fi
|
|||||||
test_dir=`pwd`
|
test_dir=`pwd`
|
||||||
port=$3
|
port=$3
|
||||||
|
|
||||||
$test_dir/non_native_setup $1
|
|
||||||
|
|
||||||
cd $2 || exit 1
|
cd $2 || exit 1
|
||||||
|
|
||||||
res=0
|
res=0
|
||||||
|
@ -58,7 +58,7 @@ int atomic_load_int32(const int *variable)
|
|||||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||||
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
||||||
#else
|
#else
|
||||||
return __sync_fetch_and_or(variable, 0);
|
return __sync_fetch_and_or((volatile int *)variable, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ int64_t atomic_load_int64(const int64_t *variable)
|
|||||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||||
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
||||||
#else
|
#else
|
||||||
return __sync_fetch_and_or(variable, 0);
|
return __sync_fetch_and_or((volatile int *)variable, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ uint64_t atomic_load_uint64(const uint64_t *variable)
|
|||||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||||
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
||||||
#else
|
#else
|
||||||
return __sync_fetch_and_or(variable, 0);
|
return __sync_fetch_and_or((volatile int *)variable, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ void* atomic_load_ptr(void * const *variable)
|
|||||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||||
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
return __atomic_load_n(variable, __ATOMIC_SEQ_CST);
|
||||||
#else
|
#else
|
||||||
return __sync_fetch_and_or(variable, 0);
|
return __sync_fetch_and_or((void **)variable, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +56,11 @@
|
|||||||
#include "maxscale/queuemanager.h"
|
#include "maxscale/queuemanager.h"
|
||||||
#include "maxscale/service.h"
|
#include "maxscale/service.h"
|
||||||
|
|
||||||
|
/** This define is needed in CentOS 6 systems */
|
||||||
|
#if !defined(UINT64_MAX)
|
||||||
|
#define UINT64_MAX (18446744073709551615UL)
|
||||||
|
#endif
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::set;
|
using std::set;
|
||||||
|
|
||||||
|
@ -2082,12 +2082,18 @@ void match_column(RULE_BOOK *rulebook, GWBUF *queue, bool *matches, char **msg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void match_function(RULE_BOOK *rulebook, GWBUF *queue, bool *matches, char **msg)
|
void match_function(RULE_BOOK *rulebook, GWBUF *queue, enum fw_actions mode,
|
||||||
|
bool *matches, char **msg)
|
||||||
{
|
{
|
||||||
const QC_FUNCTION_INFO* infos;
|
const QC_FUNCTION_INFO* infos;
|
||||||
size_t n_infos;
|
size_t n_infos;
|
||||||
qc_get_function_info(queue, &infos, &n_infos);
|
qc_get_function_info(queue, &infos, &n_infos);
|
||||||
|
|
||||||
|
if (n_infos == 0 && mode == FW_ACTION_ALLOW)
|
||||||
|
{
|
||||||
|
*matches = true;
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < n_infos; ++i)
|
for (size_t i = 0; i < n_infos; ++i)
|
||||||
{
|
{
|
||||||
const char* tok = infos[i].name;
|
const char* tok = infos[i].name;
|
||||||
@ -2219,7 +2225,7 @@ bool rule_matches(FW_INSTANCE* my_instance,
|
|||||||
case RT_FUNCTION:
|
case RT_FUNCTION:
|
||||||
if (is_sql)
|
if (is_sql)
|
||||||
{
|
{
|
||||||
match_function(rulebook, queue, &matches, &msg);
|
match_function(rulebook, queue, my_instance->action, &matches, &msg);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -700,14 +700,13 @@ gw_read_do_authentication(DCB *dcb, GWBUF *read_buffer, int nbytes_read)
|
|||||||
MXS_SESSION *session =
|
MXS_SESSION *session =
|
||||||
session_alloc_with_id(dcb->service, dcb, protocol->thread_id);
|
session_alloc_with_id(dcb->service, dcb, protocol->thread_id);
|
||||||
|
|
||||||
// For the time being only the sql_mode is stored in MXS_SESSION::client_protocol_data.
|
|
||||||
session->client_protocol_data = QC_SQL_MODE_DEFAULT;
|
|
||||||
|
|
||||||
if (session != NULL)
|
if (session != NULL)
|
||||||
{
|
{
|
||||||
CHK_SESSION(session);
|
CHK_SESSION(session);
|
||||||
ss_dassert(session->state != SESSION_STATE_ALLOC &&
|
ss_dassert(session->state != SESSION_STATE_ALLOC &&
|
||||||
session->state != SESSION_STATE_DUMMY);
|
session->state != SESSION_STATE_DUMMY);
|
||||||
|
// For the time being only the sql_mode is stored in MXS_SESSION::client_protocol_data.
|
||||||
|
session->client_protocol_data = QC_SQL_MODE_DEFAULT;
|
||||||
protocol->protocol_auth_state = MXS_AUTH_STATE_COMPLETE;
|
protocol->protocol_auth_state = MXS_AUTH_STATE_COMPLETE;
|
||||||
ss_debug(bool check = ) mxs_worker_register_session(session);
|
ss_debug(bool check = ) mxs_worker_register_session(session);
|
||||||
ss_dassert(check);
|
ss_dassert(check);
|
||||||
|
@ -201,7 +201,7 @@ MXS_MODULE* MXS_CREATE_MODULE()
|
|||||||
{"group_rows", MXS_MODULE_PARAM_COUNT, "1000"},
|
{"group_rows", MXS_MODULE_PARAM_COUNT, "1000"},
|
||||||
{"group_trx", MXS_MODULE_PARAM_COUNT, "1"},
|
{"group_trx", MXS_MODULE_PARAM_COUNT, "1"},
|
||||||
{"start_index", MXS_MODULE_PARAM_COUNT, "1"},
|
{"start_index", MXS_MODULE_PARAM_COUNT, "1"},
|
||||||
{"block_size", MXS_MODULE_PARAM_COUNT, "0"},
|
{"block_size", MXS_MODULE_PARAM_SIZE, "0"},
|
||||||
{"codec", MXS_MODULE_PARAM_ENUM, "null", MXS_MODULE_OPT_ENUM_UNIQUE, codec_values},
|
{"codec", MXS_MODULE_PARAM_ENUM, "null", MXS_MODULE_OPT_ENUM_UNIQUE, codec_values},
|
||||||
{MXS_END_MODULE_PARAMS}
|
{MXS_END_MODULE_PARAMS}
|
||||||
}
|
}
|
||||||
@ -425,7 +425,7 @@ createInstance(SERVICE *service, char **options)
|
|||||||
inst->trx_target = config_get_integer(params, "group_trx");
|
inst->trx_target = config_get_integer(params, "group_trx");
|
||||||
inst->codec = config_get_enum(params, "codec", codec_values);
|
inst->codec = config_get_enum(params, "codec", codec_values);
|
||||||
int first_file = config_get_integer(params, "start_index");
|
int first_file = config_get_integer(params, "start_index");
|
||||||
inst->block_size = config_get_integer(params, "block_size");
|
inst->block_size = config_get_size(params, "block_size");
|
||||||
|
|
||||||
MXS_CONFIG_PARAMETER *param = config_get_param(params, "source");
|
MXS_CONFIG_PARAMETER *param = config_get_param(params, "source");
|
||||||
inst->gtid.domain = 0;
|
inst->gtid.domain = 0;
|
||||||
|
@ -490,17 +490,20 @@ blr_file_add_magic(int fd)
|
|||||||
* @return Non-zero if the fie creation succeeded
|
* @return Non-zero if the fie creation succeeded
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
blr_file_create(ROUTER_INSTANCE *router, char *file)
|
blr_file_create(ROUTER_INSTANCE *router, char *orig_file)
|
||||||
{
|
{
|
||||||
if (strlen(file) > BINLOG_FNAMELEN)
|
if (strlen(orig_file) > BINLOG_FNAMELEN)
|
||||||
{
|
{
|
||||||
MXS_ERROR("The binlog filename %s is longer than "
|
MXS_ERROR("The binlog filename %s is longer than "
|
||||||
"the maximum allowed length %d.",
|
"the maximum allowed length %d.",
|
||||||
file,
|
orig_file,
|
||||||
BINLOG_FNAMELEN);
|
BINLOG_FNAMELEN);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char file[strlen(orig_file) + 1];
|
||||||
|
strcpy(file, orig_file);
|
||||||
|
|
||||||
int created = 0;
|
int created = 0;
|
||||||
char err_msg[MXS_STRERROR_BUFLEN];
|
char err_msg[MXS_STRERROR_BUFLEN];
|
||||||
|
|
||||||
|
@ -948,7 +948,8 @@ struct subcommand pingoptions[] =
|
|||||||
"Ping Workers",
|
"Ping Workers",
|
||||||
"Ping Workers",
|
"Ping Workers",
|
||||||
{ARG_TYPE_NONE}
|
{ARG_TYPE_NONE}
|
||||||
}
|
},
|
||||||
|
{EMPTY_OPTION}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user