Merge branch '2.1' into 2.2

This commit is contained in:
Markus Mäkelä
2017-12-12 13:23:02 +02:00
97 changed files with 5945 additions and 361 deletions

View File

@ -172,6 +172,19 @@ MYSQL *mxs_mysql_real_connect(MYSQL *con, SERVER *server, const char *user, cons
MY_CHARSET_INFO cs_info;
mysql_get_character_set_info(mysql, &cs_info);
server->charset = cs_info.number;
if (listener && mysql_get_ssl_cipher(con) == NULL)
{
if (server->log_warning.ssl_not_enabled)
{
server->log_warning.ssl_not_enabled = false;
MXS_ERROR("An encrypted connection to '%s' could not be created, "
"ensure that TLS is enabled on the target server.",
server->unique_name);
}
// Don't close the connection as it is closed elsewhere, just set to NULL
mysql = NULL;
}
}
return mysql;

View File

@ -149,6 +149,9 @@ SERVER* server_alloc(const char *name, const char *address, unsigned short port,
server->last_event = SERVER_UP_EVENT;
server->triggered_at = 0;
// Log all warnings once
memset(&server->log_warning, 1, sizeof(server->log_warning));
spinlock_acquire(&server_spin);
server->next = allServers;
allServers = server;

View File

@ -1607,6 +1607,7 @@ service_update(SERVICE *service, char *router, char *user, char *auth)
*/
int service_refresh_users(SERVICE *service)
{
ss_dassert(service);
int ret = 1;
int self = mxs_worker_get_current_id();
ss_dassert(self >= 0);

View File

@ -588,7 +588,9 @@ strip_escape_chars(char* val)
#define BUFFER_GROWTH_RATE 2.0
static pcre2_code* remove_comments_re = NULL;
static const PCRE2_SPTR remove_comments_pattern = (PCRE2_SPTR)
"(?:`[^`]*`\\K)|(\\/[*](?!(M?!)).*?[*]\\/)|(?:#.*|--[[:space:]].*)";
"(?:`[^`]*`\\K)|"
"(\\/[*](?!(M?!)).*?[*]\\/)|"
"([[:space:]](?:#.*|--[[:space:]].*(\\n|\\r\\n)))";
/**
* Remove SQL comments from the end of a string