summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-01-31 09:34:34 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2019-01-31 09:34:34 +0100
commit560799ebd8efe11f4c4ae1bb9ed4d39185e03800 (patch)
tree58158a4194a2473679c1848c323bad918542c5c9 /sql
parent6e2af7d084ca1bba79e60f05616aaefb6028ee9d (diff)
parentc2caca02ac39454e18db8de563e7e7c8eaf8b1c7 (diff)
downloadmariadb-git-560799ebd8efe11f4c4ae1bb9ed4d39185e03800.tar.gz
Merge branch '10.0-galera' into 10.1
Diffstat (limited to 'sql')
-rw-r--r--sql/log_event.cc21
-rw-r--r--sql/sys_vars.cc13
-rw-r--r--sql/wsrep_mysqld.cc1
-rw-r--r--sql/wsrep_mysqld.h1
-rw-r--r--sql/wsrep_mysqld_c.h26
5 files changed, 62 insertions, 0 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 4879e9fcecf..a4fc2dd5398 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -4439,6 +4439,22 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi,
else
thd->variables.collation_database= thd->db_charset;
+ {
+ const CHARSET_INFO *cs= thd->charset();
+ /*
+ We cannot ask for parsing a statement using a character set
+ without state_maps (parser internal data).
+ */
+ if (!cs->state_map)
+ {
+ rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+ ER_THD(thd, ER_SLAVE_FATAL_ERROR),
+ "character_set cannot be parsed");
+ thd->is_slave_error= true;
+ goto end;
+ }
+ }
+
/*
Record any GTID in the same transaction, so slave state is
transactionally consistent.
@@ -7943,6 +7959,11 @@ User_var_log_event(const char* buf, uint event_len,
we keep the flags set to UNDEF_F.
*/
uint bytes_read= ((val + val_len) - buf_start);
+ if (bytes_read > event_len)
+ {
+ error= true;
+ goto err;
+ }
if ((data_written - bytes_read) > 0)
{
flags= (uint) *(buf + UV_VAL_IS_NULL + UV_VAL_TYPE_SIZE +
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 16126c471c0..d1db14d7b35 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -4940,6 +4940,19 @@ static Sys_var_mybool Sys_wsrep_certify_nonPK(
GLOBAL_VAR(wsrep_certify_nonPK),
CMD_LINE(OPT_ARG), DEFAULT(TRUE));
+static const char *wsrep_certification_rules_names[]= { "strict", "optimized", NullS };
+static Sys_var_enum Sys_wsrep_certification_rules(
+ "wsrep_certification_rules",
+ "Certification rules to use in the cluster. Possible values are: "
+ "\"strict\": stricter rules that could result in more certification "
+ "failures. "
+ "\"optimized\": relaxed rules that allow more concurrency and "
+ "cause less certification failures.",
+ GLOBAL_VAR(wsrep_certification_rules), CMD_LINE(REQUIRED_ARG),
+ wsrep_certification_rules_names, DEFAULT(WSREP_CERTIFICATION_RULES_STRICT),
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(0));
+
static Sys_var_mybool Sys_wsrep_causal_reads(
"wsrep_causal_reads", "Setting this variable is equivalent "
"to setting wsrep_sync_wait READ flag",
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 47aea6d3824..ee8509e3fa2 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -77,6 +77,7 @@ ulong wsrep_max_ws_size = 1073741824UL;//max ws (RBR buffer) size
ulong wsrep_max_ws_rows = 65536; // max number of rows in ws
int wsrep_to_isolation = 0; // # of active TO isolation threads
my_bool wsrep_certify_nonPK = 1; // certify, even when no primary key
+ulong wsrep_certification_rules = WSREP_CERTIFICATION_RULES_STRICT;
long wsrep_max_protocol_version = 3; // maximum protocol version to use
ulong wsrep_forced_binlog_format = BINLOG_FORMAT_UNSPEC;
my_bool wsrep_recovery = 0; // recovery
diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h
index 2814f4013d8..2b55fbe42ee 100644
--- a/sql/wsrep_mysqld.h
+++ b/sql/wsrep_mysqld.h
@@ -30,6 +30,7 @@ typedef struct st_mysql_show_var SHOW_VAR;
#include "mdl.h"
#include "mysqld.h"
#include "sql_table.h"
+#include "wsrep_mysqld_c.h"
#define WSREP_UNDEFINED_TRX_ID ULONGLONG_MAX
diff --git a/sql/wsrep_mysqld_c.h b/sql/wsrep_mysqld_c.h
new file mode 100644
index 00000000000..15ca0ae2a6d
--- /dev/null
+++ b/sql/wsrep_mysqld_c.h
@@ -0,0 +1,26 @@
+/* Copyright 2018-2018 Codership Oy <http://www.codership.com>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef WSREP_MYSQLD_C_H
+#define WSREP_MYSQLD_C_H
+
+enum enum_wsrep_certification_rules {
+ WSREP_CERTIFICATION_RULES_STRICT,
+ WSREP_CERTIFICATION_RULES_OPTIMIZED
+};
+
+extern ulong wsrep_certification_rules;
+
+#endif /* WSREP_MYSQLD_C_H */