Skip to content
Permalink
Browse files
Merge 10.3 into 10.4
  • Loading branch information
dr-m committed Aug 26, 2020
2 parents 88e70f4 + 6a04228 commit 1e08e08
Show file tree
Hide file tree
Showing 22 changed files with 222 additions and 144 deletions.
@@ -621,3 +621,9 @@ a b
1 3
2 4
drop table t1;
#
# MDEV-23467 SIGSEGV in fill_record/fill_record_n_invoke_before_triggers on INSERT DELAYED
#
create table t1 (a int, b int invisible);
insert delayed into t1 values (1);
drop table t1;
@@ -271,3 +271,11 @@ select a,b from t1;

#cleanup
drop table t1;

--echo #
--echo # MDEV-23467 SIGSEGV in fill_record/fill_record_n_invoke_before_triggers on INSERT DELAYED
--echo #
create table t1 (a int, b int invisible);
insert delayed into t1 values (1);
# cleanup
drop table t1;
@@ -2686,6 +2686,37 @@ SELECT * FROM t2;
f
bar
DROP TABLE t1, t2;
#
# MDEV-18335: Assertion `!error || error == 137' failed in subselect_rowid_merge_engine::init
#
CREATE TABLE t1 (i1 int,v1 varchar(1),KEY (v1,i1));
INSERT INTO t1 VALUES
(9,'y'),(4,'q'),(0,null),(0,'p'),(null,'j');
CREATE TABLE t2 (pk int);
INSERT INTO t2 VALUES (1),(2);
CREATE TABLE t3 (v2 varchar(1));
INSERT INTO t3 VALUES
('p'),('j'),('y'),('q');
CREATE TABLE t4 (v2 varchar(1));
INSERT INTO t4 VALUES
('a'),('a'),('b'),('b'),('c'),('c'),
('d'),('d'),('e'),('e'),('f'),('f'),
('g'),('g'),('h'),('h'),('i'),('i'),
('j'),('j'),('k'),('k'),('l'),('l'),
('m'),('m'),('n'),('n'),('o'),('o'),
('p'),('p'),('q'),('q'),('r'),('r'),
('s'),('s'),('t'),('t'),('u'),('u'),('v'),('v'),
('w'),('w'),('x'),('x'), (NULL),(NULL);
SET @save_join_cache_level=@@join_cache_level;
SET join_cache_level=0;
select 1
from t2 join t1 on
('i','w') not in (select t1.v1,t4.v2 from t4,t1,t3 where t3.v2 = t1.v1) LIMIT ROWS EXAMINED 500;
1
Warnings:
Warning 1931 Query execution was interrupted. The query examined at least 3020 rows, which exceeds LIMIT ROWS EXAMINED (500). The query result may be incomplete
SET join_cache_level= @save_join_cache_level;
DROP TABLE t1,t2,t3,t4;
# End of 10.2 tests
#
# MDEV-19134: EXISTS() slower if ORDER BY is defined
@@ -2201,6 +2201,42 @@ SELECT * FROM t2;

DROP TABLE t1, t2;

--echo #
--echo # MDEV-18335: Assertion `!error || error == 137' failed in subselect_rowid_merge_engine::init
--echo #

CREATE TABLE t1 (i1 int,v1 varchar(1),KEY (v1,i1));
INSERT INTO t1 VALUES
(9,'y'),(4,'q'),(0,null),(0,'p'),(null,'j');

CREATE TABLE t2 (pk int);
INSERT INTO t2 VALUES (1),(2);

CREATE TABLE t3 (v2 varchar(1));
INSERT INTO t3 VALUES
('p'),('j'),('y'),('q');

CREATE TABLE t4 (v2 varchar(1));
INSERT INTO t4 VALUES
('a'),('a'),('b'),('b'),('c'),('c'),
('d'),('d'),('e'),('e'),('f'),('f'),
('g'),('g'),('h'),('h'),('i'),('i'),
('j'),('j'),('k'),('k'),('l'),('l'),
('m'),('m'),('n'),('n'),('o'),('o'),
('p'),('p'),('q'),('q'),('r'),('r'),
('s'),('s'),('t'),('t'),('u'),('u'),('v'),('v'),
('w'),('w'),('x'),('x'), (NULL),(NULL);

SET @save_join_cache_level=@@join_cache_level;
SET join_cache_level=0;

select 1
from t2 join t1 on
('i','w') not in (select t1.v1,t4.v2 from t4,t1,t3 where t3.v2 = t1.v1) LIMIT ROWS EXAMINED 500;
SET join_cache_level= @save_join_cache_level;

DROP TABLE t1,t2,t3,t4;

--echo # End of 10.2 tests

--echo #
@@ -5,15 +5,15 @@
--source include/galera_cluster.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc

--let $node_1 = node_1
--let $node_2 = node_2
--source include/auto_increment_offset_save.inc

--let $galera_connection_name = node_1_ctrl
--let $galera_server_number = 1
--source include/galera_connect.inc

#
# Run UPDATE on node_1 and make it block before table locks are taken.
# This should block FTWRL.
@@ -23,10 +23,10 @@ CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 INT);
INSERT INTO t1 VALUES (1, 1);
SET DEBUG_SYNC = "before_lock_tables_takes_lock SIGNAL sync_point_reached WAIT_FOR sync_point_continue";
--send UPDATE t1 SET f2 = 2 WHERE f1 = 1

--connection node_1_ctrl
SET DEBUG_SYNC = "now WAIT_FOR sync_point_reached";

#
# Restart node_2, force SST.
#
@@ -40,19 +40,19 @@ SET DEBUG_SYNC = "now WAIT_FOR sync_point_reached";
# If the bug is present, FTWRL times out on node_1 in couple of
# seconds and node_2 fails to join.
--sleep 10

--connection node_1_ctrl
SET DEBUG_SYNC = "now SIGNAL sync_point_continue";

--connection node_1
--reap
SET DEBUG_SYNC = "RESET";

--connection node_2
--enable_reconnect
--source include/wait_until_connected_again.inc

--connection node_1
DROP TABLE t1;

--source include/auto_increment_offset_restore.inc
@@ -1,2 +1,21 @@
##############################################################################
#
# List the test cases that are to be disabled temporarily.
#
# Separate the test case name and the comment with ':'.
#
# <testcasename> : MDEV-<xxxx> <comment>
#
# Do not use any TAB characters for whitespace.
#
##############################################################################

galera_ipv6_mariabackup : MDEV-23573 Could not open '../galera/include/have_mariabackup.inc'
galera_ipv6_mariabackup_section : MDEV-23574 Could not open '../galera/include/have_mariabackup.inc'
galera_ipv6_mysqldump : MDEV-23576 WSREP_SST: [ERROR] rsync daemon port '16008' has been taken
galera_ipv6_rsyn : MDEV-23581 WSREP_SST: [ERROR] rsync daemon port '16008' has been taken
galera_ipv6_rsync_section : MDEV-23580 WSREP_SST: [ERROR] rsync daemon port '16008' has been taken
galera_ipv6_xtrabackup-v2 : MDEV-23575 WSREP_SST: [ERROR] innobackupex not in path
galera_ist_gcache_rollover : MDEV-23578 WSREP: exception caused by message: {v=0,t=1,ut=255,o=4,s=0,sr=0,as=1,f=6,src=50524cfe,srcvid=view_id(REG,50524cfe,4),insvid=view_id(UNKNOWN,00000000,0),ru=00000000,r=[-1,-1],fs=75,nl=(}
galera_slave_options_do :MDEV-8798
galera_slave_options_ignore : MDEV-8798
@@ -168,7 +168,6 @@ PRIMARY KEY (store_id),
UNIQUE KEY idx_unique_manager (manager_staff_id),
CONSTRAINT fk_store_staff FOREIGN KEY (manager_staff_id) REFERENCES staff (staff_id) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB;
SET FOREIGN_KEY_CHECKS=DEFAULT;
LOCK TABLE staff WRITE;
UNLOCK TABLES;
DROP TABLES staff, store;
@@ -136,7 +136,6 @@ CREATE TABLE store (
UNIQUE KEY idx_unique_manager (manager_staff_id),
CONSTRAINT fk_store_staff FOREIGN KEY (manager_staff_id) REFERENCES staff (staff_id) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB;
SET FOREIGN_KEY_CHECKS=DEFAULT;

LOCK TABLE staff WRITE;
UNLOCK TABLES;
@@ -7,7 +7,7 @@ SET @@session.foreign_key_checks = 1;
SET @@session.foreign_key_checks = DEFAULT;
SELECT @@session.foreign_key_checks;
@@session.foreign_key_checks
0
1
'#---------------------FN_DYNVARS_032_02-------------------------#'
SET foreign_key_checks = 1;
SELECT @@foreign_key_checks;
@@ -7,7 +7,7 @@ SET @@session.unique_checks= 1;
SET @@session.unique_checks= DEFAULT;
SELECT @@session.unique_checks;
@@session.unique_checks
0
1
'#--------------------FN_DYNVARS_005_04-------------------------#'
SET @@session.unique_checks =1;
SELECT @@session.unique_checks;
@@ -1620,9 +1620,8 @@ class ha_partition :public handler
return h;
}

ha_rows part_records(void *_part_elem)
ha_rows part_records(partition_element *part_elem)
{
partition_element *part_elem= reinterpret_cast<partition_element *>(_part_elem);
DBUG_ASSERT(m_part_info);
uint32 sub_factor= m_part_info->num_subparts ? m_part_info->num_subparts : 1;
uint32 part_id= part_elem->id * sub_factor;
@@ -6318,6 +6318,9 @@ subselect_rowid_merge_engine::init(MY_BITMAP *non_null_key_parts,
while (TRUE)
{
error= tmp_table->file->ha_rnd_next(tmp_table->record[0]);

if (error == HA_ERR_ABORTED_BY_USER)
break;
/*
This is a temp table that we fully own, there should be no other
cause to stop the iteration than EOF.
@@ -24,9 +24,6 @@
#include <mysql/plugin.h>
#include <mysql/service_thd_wait.h>
#include <mysql/psi/mysql_stage.h>
#ifdef WITH_WSREP
#include "wsrep_sst.h"
#endif
#ifdef HAVE_PSI_INTERFACE
static PSI_mutex_key key_MDL_wait_LOCK_wait_status;

@@ -2328,26 +2325,18 @@ MDL_context::acquire_lock(MDL_request *mdl_request, double lock_wait_timeout)
wait_status= m_wait.timed_wait(m_owner, &abs_shortwait, FALSE,
mdl_request->key.get_wait_state_name());

THD* thd= m_owner->get_thd();

if (wait_status != MDL_wait::EMPTY)
break;
/* Check if the client is gone while we were waiting. */
if (! thd_is_connected(thd))
if (! thd_is_connected(m_owner->get_thd()))
{
#if defined(WITH_WSREP) && !defined(EMBEDDED_LIBRARY)
// During SST client might not be connected
if (!wsrep_is_sst_progress())
#endif
{
/*
* The client is disconnected. Don't wait forever:
* assume it's the same as a wait timeout, this
* ensures all error handling is correct.
*/
wait_status= MDL_wait::TIMEOUT;
break;
}
/*
* The client is disconnected. Don't wait forever:
* assume it's the same as a wait timeout, this
* ensures all error handling is correct.
*/
wait_status= MDL_wait::TIMEOUT;
break;
}

mysql_prlock_wrlock(&lock->m_rwlock);
@@ -2638,6 +2638,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
if (!(*field= (*org_field)->make_new_field(client_thd->mem_root, copy, 1)))
goto error;
(*field)->unireg_check= (*org_field)->unireg_check;
(*field)->invisible= (*org_field)->invisible;
(*field)->orig_table= copy; // Remove connection
(*field)->move_field_offset(adjust_ptrs); // Point at copy->record[0]
memdup_vcol(client_thd, (*field)->vcol_info);
@@ -1817,13 +1817,16 @@ public:
return false;
}
void session_save_default(THD *thd, set_var *var)
{ var->save_result.ulonglong_value= global_var(ulonglong) & bitmask; }
{
var->save_result.ulonglong_value=
(reverse_semantics == !(global_var(ulonglong) & bitmask));
}
void global_save_default(THD *thd, set_var *var)
{ var->save_result.ulonglong_value= option.def_value; }

uchar *valptr(THD *thd, ulonglong val)
{
thd->sys_var_tmp.my_bool_value= reverse_semantics ^ ((val & bitmask) != 0);
thd->sys_var_tmp.my_bool_value= (reverse_semantics == !(val & bitmask));
return (uchar*) &thd->sys_var_tmp.my_bool_value;
}
uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base)
@@ -1,4 +1,4 @@
/* Copyright 2008-2017 Codership Oy <http://www.codership.com>
/* Copyright 2008-2020 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
@@ -54,7 +54,6 @@ my_bool wsrep_sst_donor_rejects_queries= FALSE;

bool sst_joiner_completed = false;
bool sst_donor_completed = false;
bool sst_needed = false;

struct sst_thread_arg
{
@@ -308,7 +307,6 @@ bool wsrep_before_SE()
&& strcmp (wsrep_sst_method, WSREP_SST_MYSQLDUMP));
}

static bool sst_in_progress = false;
// Signal end of SST
static void wsrep_sst_complete (THD* thd,
int const rcode)
@@ -1627,12 +1625,11 @@ static void* sst_donor_thread (void* a)
wsrep_uuid_t ret_uuid= WSREP_UUID_UNDEFINED;
// seqno of complete SST
wsrep_seqno_t ret_seqno= WSREP_SEQNO_UNDEFINED;
// SST is now in progress
sst_in_progress= true;

wsp::thd thd(FALSE); // we turn off wsrep_on for this THD so that it can
// operate with wsrep_ready == OFF

// We turn off wsrep_on for this THD so that it can
// operate with wsrep_ready == OFF
// We also set this SST thread THD as system thread
wsp::thd thd(FALSE, true);
wsp::process proc(arg->cmd, "r", arg->env);

err= -proc.error();
@@ -1734,10 +1731,7 @@ static void* sst_donor_thread (void* a)
proc.wait();

wsrep_donor_monitor_end();
sst_in_progress= false;


return NULL;
return nullptr;
}

static int sst_donate_other (const char* method,
@@ -1889,8 +1883,3 @@ int wsrep_sst_donate(const std::string& msg,

return (ret >= 0 ? 0 : 1);
}

bool wsrep_is_sst_progress()
{
return (sst_in_progress);
}
@@ -77,7 +77,6 @@ extern void wsrep_SE_init_grab(); /*! grab init critical section */
extern void wsrep_SE_init_wait(); /*! wait for SE init to complete */
extern void wsrep_SE_init_done(); /*! signal that SE init is complte */
extern void wsrep_SE_initialized(); /*! mark SE initialization complete */
extern bool wsrep_is_sst_progress();

/**
Return a string containing the state transfer request string.
@@ -103,6 +102,5 @@ int wsrep_sst_donate(const std::string& request,
#define wsrep_SE_init_grab() do { } while(0)
#define wsrep_SE_init_done() do { } while(0)
#define wsrep_sst_continue() (0)
#define wsrep_is_sst_progress() (0)

#endif /* WSREP_SST_H */

0 comments on commit 1e08e08

Please sign in to comment.