Commit 560799eb authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

Merge branch '10.0-galera' into 10.1

parents 6e2af7d0 c2caca02
......@@ -26,7 +26,7 @@ ENDIF()
OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ${with_wsrep_default})
# Set the patch version
SET(WSREP_PATCH_VERSION "23")
SET(WSREP_PATCH_VERSION "24")
# Obtain wsrep API version
FILE(STRINGS "${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h" WSREP_API_VERSION
......
......@@ -139,8 +139,6 @@ my $opt_start_exit;
my $start_only;
my $file_wsrep_provider;
our @global_suppressions;
END {
if ( defined $opt_tmpdir_pid and $opt_tmpdir_pid == $$ )
{
......@@ -195,8 +193,6 @@ my @DEFAULT_SUITES= qw(
sys_vars-
unit-
vcol-
wsrep-
galera-
);
my $opt_suites;
......@@ -357,7 +353,6 @@ my $opt_max_test_fail= env_or_val(MTR_MAX_TEST_FAIL => 10);
my $opt_core_on_failure= 0;
my $opt_parallel= $ENV{MTR_PARALLEL} || 1;
my $opt_port_group_size = $ENV{MTR_PORT_GROUP_SIZE} || 20;
# lock file to stop tests
my $opt_stop_file= $ENV{MTR_STOP_FILE};
......@@ -1118,7 +1113,6 @@ sub command_line_setup {
# Specify ports
'build-thread|mtr-build-thread=i' => \$opt_build_thread,
'port-base|mtr-port-base=i' => \$opt_port_base,
'port-group-size=s' => \$opt_port_group_size,
# Test case authoring
'record' => \$opt_record,
......@@ -1824,16 +1818,16 @@ sub set_build_thread_ports($) {
$ENV{MTR_BUILD_THREAD}= $build_thread;
# Calculate baseport
$baseport= $build_thread * $opt_port_group_size + 10000;
if ( $baseport < 5001 or $baseport + $opt_port_group_size >= 32767 )
$baseport= $build_thread * 20 + 10000;
if ( $baseport < 5001 or $baseport + 19 >= 32767 )
{
mtr_error("MTR_BUILD_THREAD number results in a port",
"outside 5001 - 32767",
"($baseport - $baseport + $opt_port_group_size)");
"($baseport - $baseport + 19)");
}
mtr_report("Using MTR_BUILD_THREAD $build_thread,",
"with reserved ports $baseport..".($baseport+($opt_port_group_size-1)));
"with reserved ports $baseport..".($baseport+19));
}
......@@ -2994,8 +2988,8 @@ sub kill_leftovers ($) {
sub check_ports_free ($)
{
my $bthread= shift;
my $portbase = $bthread * $opt_port_group_size + 10000;
for ($portbase..$portbase+($opt_port_group_size-1)){
my $portbase = $bthread * 10 + 10000;
for ($portbase..$portbase+9){
if (mtr_ping_port($_)){
mtr_report(" - 'localhost:$_' was not free");
return 0; # One port was not free
......@@ -4407,7 +4401,6 @@ sub extract_warning_lines ($$) {
# Perl code.
my @antipatterns =
(
@global_suppressions,
qr/error .*connecting to master/,
qr/InnoDB: Error: in ALTER TABLE `test`.`t[12]`/,
qr/InnoDB: Error: table `test`.`t[12]` .*does not exist in the InnoDB internal/,
......@@ -6117,8 +6110,6 @@ Options that specify ports
build-thread=# Can be set in environment variable MTR_BUILD_THREAD.
Set MTR_BUILD_THREAD="auto" to automatically aquire
a build thread id that is unique to current host
port-group-size=N Reserve groups of TCP ports of size N for each MTR thread
Options for test case authoring
......
This diff is collapsed.
This diff is collapsed.
#
# Specific tests for case sensitive file systems
# i.e. lower_case_filesystem=OFF
#
-- source include/have_case_sensitive_file_system.inc
-- source include/not_embedded.inc
connect (master,localhost,root,,);
connection master;
create database d1;
grant all on d1.* to 'sample'@'localhost' identified by 'password';
flush privileges;
connect (sample,localhost,sample,password,d1);
connection sample;
select database();
--error ER_DBACCESS_DENIED_ERROR
create database d2;
--error ER_DBACCESS_DENIED_ERROR
create database D1;
disconnect sample;
--source include/wait_until_disconnected.inc
connection master;
drop user 'sample'@'localhost';
drop database if exists d1;
disconnect master;
--source include/wait_until_disconnected.inc
connection default;
# End of 4.1 tests
#
# Bug#41049 does syntax "grant" case insensitive?
#
CREATE DATABASE d1;
USE d1;
CREATE TABLE T1(f1 INT);
CREATE TABLE t1(f1 INT);
GRANT SELECT ON T1 to user_1@localhost;
connect (con1,localhost,user_1,,d1);
--error ER_TABLEACCESS_DENIED_ERROR
select * from t1;
select * from T1;
connection default;
GRANT SELECT ON t1 to user_1@localhost;
connection con1;
select * from information_schema.table_privileges;
connection default;
disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
DROP USER user_1@localhost;
DROP DATABASE d1;
USE test;
CREATE DATABASE db1;
USE db1;
CREATE PROCEDURE p1() BEGIN END;
CREATE FUNCTION f1(i INT) RETURNS INT RETURN i+1;
GRANT USAGE ON db1.* to user_1@localhost;
GRANT EXECUTE ON PROCEDURE db1.P1 to user_1@localhost;
GRANT EXECUTE ON FUNCTION db1.f1 to user_1@localhost;
GRANT UPDATE ON db1.* to USER_1@localhost;
connect (con1,localhost,user_1,,db1);
call p1();
call P1();
select f1(1);
connect (con2,localhost,USER_1,,db1);
--error ER_PROCACCESS_DENIED_ERROR
call p1();
--error ER_PROCACCESS_DENIED_ERROR
call P1();
--error ER_PROCACCESS_DENIED_ERROR
select f1(1);
connection default;
disconnect con1;
disconnect con2;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM USER_1@localhost;
DROP FUNCTION f1;
DROP PROCEDURE p1;
DROP USER user_1@localhost;
DROP USER USER_1@localhost;
DROP DATABASE db1;
use test;
# End of 5.0 tests
--echo #
--echo # Extra test coverage for Bug#56595 RENAME TABLE causes assert on OS X
--echo #
CREATE TABLE t1(a INT);
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a= 1;
RENAME TABLE t1 TO T1;
ALTER TABLE T1 RENAME t1;
DROP TABLE t1;
#
# MDEV-13912 mysql_upgrade: case (in)sensitivity for stored procedures
#
create database TEST;
create procedure TEST.pr() begin end;
create procedure test.pr() begin end;
--exec $MYSQL_UPGRADE --force 2>&1
drop procedure test.pr;
drop database TEST;
# End of 5.5 tests
#
# MDEV-9014 SHOW TRIGGERS not case sensitive
#
create table t1 (a int);
create trigger t1_bi before insert on t1 for each row set new.a= 1;
show triggers like '%T1%';
drop table t1;
This diff is collapsed.
This diff is collapsed.
......@@ -10,5 +10,6 @@ there should be *no* long test name listed below:
select distinct variable_name as `there should be *no* variables listed below:` from t2
left join t1 on variable_name=test_name where test_name is null;
there should be *no* variables listed below:
wsrep_certification_rules
drop table t1;
drop table t2;
......@@ -29,6 +29,20 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME WSREP_CERTIFICATION_RULES
SESSION_VALUE NULL
GLOBAL_VALUE strict
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE strict
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE ENUM
VARIABLE_COMMENT 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.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST strict,optimized
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME WSREP_CERTIFY_NONPK
SESSION_VALUE NULL
GLOBAL_VALUE ON
......
......@@ -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 +
......
......@@ -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",
......
......@@ -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
......
......@@ -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
......
/* 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 */
This diff is collapsed.
......@@ -26,6 +26,10 @@ this program; if not, write to the Free Software Foundation, Inc.,
#include "dict0stats.h"
#ifdef WITH_WSREP
#include "../../../wsrep/wsrep_api.h"
#endif /* WITH_WSREP */
/* Structure defines translation table between mysql index and innodb
index structures */
struct innodb_idx_translate_t {
......@@ -115,7 +119,7 @@ class ha_innobase: public handler
dict_index_t* innobase_get_index(uint keynr);
#ifdef WITH_WSREP
int wsrep_append_keys(THD *thd, bool shared,
int wsrep_append_keys(THD *thd, wsrep_key_type key_type,
const uchar* record0, const uchar* record1);
#endif
/* Init values for the class: */
......
This diff is collapsed.
This diff is collapsed.
......@@ -26,6 +26,10 @@ this program; if not, write to the Free Software Foundation, Inc.,
#include "dict0stats.h"
#ifdef WITH_WSREP
#include "../../../wsrep/wsrep_api.h"
#endif /* WITH_WSREP */
/* Structure defines translation table between mysql index and innodb
index structures */
struct innodb_idx_translate_t {
......@@ -115,7 +119,7 @@ class ha_innobase: public handler
dict_index_t* innobase_get_index(uint keynr);
#ifdef WITH_WSREP
int wsrep_append_keys(THD *thd, bool shared,
int wsrep_append_keys(THD *thd, wsrep_key_type key_type,
const uchar* record0, const uchar* record1);
#endif
/* Init values for the class: */
......
This diff is collapsed.
......@@ -116,7 +116,6 @@ if(NOT MINGW)
win32/zlib1.rc # If present will override custom build rule below.
)
endif()
# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
......@@ -145,4 +144,4 @@ elseif(UNIX)
if(NOT APPLE)
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
endif()
endif()
endif()
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment