Merge 10.3 into 10.4
This commit is contained in:
commit
1e08e08ccb
@ -621,3 +621,9 @@ a b
|
|||||||
1 3
|
1 3
|
||||||
2 4
|
2 4
|
||||||
drop table t1;
|
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
|
#cleanup
|
||||||
drop table t1;
|
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
|
f
|
||||||
bar
|
bar
|
||||||
DROP TABLE t1, t2;
|
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
|
# End of 10.2 tests
|
||||||
#
|
#
|
||||||
# MDEV-19134: EXISTS() slower if ORDER BY is defined
|
# MDEV-19134: EXISTS() slower if ORDER BY is defined
|
||||||
|
@ -2201,6 +2201,42 @@ SELECT * FROM t2;
|
|||||||
|
|
||||||
DROP TABLE t1, 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 # End of 10.2 tests
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
|
@ -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_do :MDEV-8798
|
||||||
galera_slave_options_ignore : MDEV-8798
|
galera_slave_options_ignore : MDEV-8798
|
||||||
|
@ -168,7 +168,6 @@ PRIMARY KEY (store_id),
|
|||||||
UNIQUE KEY idx_unique_manager (manager_staff_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
|
CONSTRAINT fk_store_staff FOREIGN KEY (manager_staff_id) REFERENCES staff (staff_id) ON DELETE RESTRICT ON UPDATE CASCADE
|
||||||
) ENGINE=InnoDB;
|
) ENGINE=InnoDB;
|
||||||
SET FOREIGN_KEY_CHECKS=DEFAULT;
|
|
||||||
LOCK TABLE staff WRITE;
|
LOCK TABLE staff WRITE;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
DROP TABLES staff, store;
|
DROP TABLES staff, store;
|
||||||
|
@ -136,7 +136,6 @@ CREATE TABLE store (
|
|||||||
UNIQUE KEY idx_unique_manager (manager_staff_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
|
CONSTRAINT fk_store_staff FOREIGN KEY (manager_staff_id) REFERENCES staff (staff_id) ON DELETE RESTRICT ON UPDATE CASCADE
|
||||||
) ENGINE=InnoDB;
|
) ENGINE=InnoDB;
|
||||||
SET FOREIGN_KEY_CHECKS=DEFAULT;
|
|
||||||
|
|
||||||
LOCK TABLE staff WRITE;
|
LOCK TABLE staff WRITE;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
@ -7,7 +7,7 @@ SET @@session.foreign_key_checks = 1;
|
|||||||
SET @@session.foreign_key_checks = DEFAULT;
|
SET @@session.foreign_key_checks = DEFAULT;
|
||||||
SELECT @@session.foreign_key_checks;
|
SELECT @@session.foreign_key_checks;
|
||||||
@@session.foreign_key_checks
|
@@session.foreign_key_checks
|
||||||
0
|
1
|
||||||
'#---------------------FN_DYNVARS_032_02-------------------------#'
|
'#---------------------FN_DYNVARS_032_02-------------------------#'
|
||||||
SET foreign_key_checks = 1;
|
SET foreign_key_checks = 1;
|
||||||
SELECT @@foreign_key_checks;
|
SELECT @@foreign_key_checks;
|
||||||
|
@ -7,7 +7,7 @@ SET @@session.unique_checks= 1;
|
|||||||
SET @@session.unique_checks= DEFAULT;
|
SET @@session.unique_checks= DEFAULT;
|
||||||
SELECT @@session.unique_checks;
|
SELECT @@session.unique_checks;
|
||||||
@@session.unique_checks
|
@@session.unique_checks
|
||||||
0
|
1
|
||||||
'#--------------------FN_DYNVARS_005_04-------------------------#'
|
'#--------------------FN_DYNVARS_005_04-------------------------#'
|
||||||
SET @@session.unique_checks =1;
|
SET @@session.unique_checks =1;
|
||||||
SELECT @@session.unique_checks;
|
SELECT @@session.unique_checks;
|
||||||
|
@ -1620,9 +1620,8 @@ public:
|
|||||||
return h;
|
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);
|
DBUG_ASSERT(m_part_info);
|
||||||
uint32 sub_factor= m_part_info->num_subparts ? m_part_info->num_subparts : 1;
|
uint32 sub_factor= m_part_info->num_subparts ? m_part_info->num_subparts : 1;
|
||||||
uint32 part_id= part_elem->id * sub_factor;
|
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)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
error= tmp_table->file->ha_rnd_next(tmp_table->record[0]);
|
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
|
This is a temp table that we fully own, there should be no other
|
||||||
cause to stop the iteration than EOF.
|
cause to stop the iteration than EOF.
|
||||||
|
27
sql/mdl.cc
27
sql/mdl.cc
@ -24,9 +24,6 @@
|
|||||||
#include <mysql/plugin.h>
|
#include <mysql/plugin.h>
|
||||||
#include <mysql/service_thd_wait.h>
|
#include <mysql/service_thd_wait.h>
|
||||||
#include <mysql/psi/mysql_stage.h>
|
#include <mysql/psi/mysql_stage.h>
|
||||||
#ifdef WITH_WSREP
|
|
||||||
#include "wsrep_sst.h"
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_PSI_INTERFACE
|
#ifdef HAVE_PSI_INTERFACE
|
||||||
static PSI_mutex_key key_MDL_wait_LOCK_wait_status;
|
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,
|
wait_status= m_wait.timed_wait(m_owner, &abs_shortwait, FALSE,
|
||||||
mdl_request->key.get_wait_state_name());
|
mdl_request->key.get_wait_state_name());
|
||||||
|
|
||||||
THD* thd= m_owner->get_thd();
|
|
||||||
|
|
||||||
if (wait_status != MDL_wait::EMPTY)
|
if (wait_status != MDL_wait::EMPTY)
|
||||||
break;
|
break;
|
||||||
/* Check if the client is gone while we were waiting. */
|
/* 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
|
* The client is disconnected. Don't wait forever:
|
||||||
if (!wsrep_is_sst_progress())
|
* assume it's the same as a wait timeout, this
|
||||||
#endif
|
* ensures all error handling is correct.
|
||||||
{
|
*/
|
||||||
/*
|
wait_status= MDL_wait::TIMEOUT;
|
||||||
* The client is disconnected. Don't wait forever:
|
break;
|
||||||
* 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);
|
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)))
|
if (!(*field= (*org_field)->make_new_field(client_thd->mem_root, copy, 1)))
|
||||||
goto error;
|
goto error;
|
||||||
(*field)->unireg_check= (*org_field)->unireg_check;
|
(*field)->unireg_check= (*org_field)->unireg_check;
|
||||||
|
(*field)->invisible= (*org_field)->invisible;
|
||||||
(*field)->orig_table= copy; // Remove connection
|
(*field)->orig_table= copy; // Remove connection
|
||||||
(*field)->move_field_offset(adjust_ptrs); // Point at copy->record[0]
|
(*field)->move_field_offset(adjust_ptrs); // Point at copy->record[0]
|
||||||
memdup_vcol(client_thd, (*field)->vcol_info);
|
memdup_vcol(client_thd, (*field)->vcol_info);
|
||||||
|
@ -1817,13 +1817,16 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
void session_save_default(THD *thd, set_var *var)
|
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)
|
void global_save_default(THD *thd, set_var *var)
|
||||||
{ var->save_result.ulonglong_value= option.def_value; }
|
{ var->save_result.ulonglong_value= option.def_value; }
|
||||||
|
|
||||||
uchar *valptr(THD *thd, ulonglong val)
|
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;
|
return (uchar*) &thd->sys_var_tmp.my_bool_value;
|
||||||
}
|
}
|
||||||
uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base)
|
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
|
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
|
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_joiner_completed = false;
|
||||||
bool sst_donor_completed = false;
|
bool sst_donor_completed = false;
|
||||||
bool sst_needed = false;
|
|
||||||
|
|
||||||
struct sst_thread_arg
|
struct sst_thread_arg
|
||||||
{
|
{
|
||||||
@ -308,7 +307,6 @@ bool wsrep_before_SE()
|
|||||||
&& strcmp (wsrep_sst_method, WSREP_SST_MYSQLDUMP));
|
&& strcmp (wsrep_sst_method, WSREP_SST_MYSQLDUMP));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool sst_in_progress = false;
|
|
||||||
// Signal end of SST
|
// Signal end of SST
|
||||||
static void wsrep_sst_complete (THD* thd,
|
static void wsrep_sst_complete (THD* thd,
|
||||||
int const rcode)
|
int const rcode)
|
||||||
@ -1627,12 +1625,11 @@ static void* sst_donor_thread (void* a)
|
|||||||
wsrep_uuid_t ret_uuid= WSREP_UUID_UNDEFINED;
|
wsrep_uuid_t ret_uuid= WSREP_UUID_UNDEFINED;
|
||||||
// seqno of complete SST
|
// seqno of complete SST
|
||||||
wsrep_seqno_t ret_seqno= WSREP_SEQNO_UNDEFINED;
|
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);
|
wsp::process proc(arg->cmd, "r", arg->env);
|
||||||
|
|
||||||
err= -proc.error();
|
err= -proc.error();
|
||||||
@ -1734,10 +1731,7 @@ wait_signal:
|
|||||||
proc.wait();
|
proc.wait();
|
||||||
|
|
||||||
wsrep_donor_monitor_end();
|
wsrep_donor_monitor_end();
|
||||||
sst_in_progress= false;
|
return nullptr;
|
||||||
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sst_donate_other (const char* method,
|
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);
|
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_wait(); /*! wait for SE init to complete */
|
||||||
extern void wsrep_SE_init_done(); /*! signal that SE init is complte */
|
extern void wsrep_SE_init_done(); /*! signal that SE init is complte */
|
||||||
extern void wsrep_SE_initialized(); /*! mark SE initialization complete */
|
extern void wsrep_SE_initialized(); /*! mark SE initialization complete */
|
||||||
extern bool wsrep_is_sst_progress();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Return a string containing the state transfer request string.
|
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_grab() do { } while(0)
|
||||||
#define wsrep_SE_init_done() do { } while(0)
|
#define wsrep_SE_init_done() do { } while(0)
|
||||||
#define wsrep_sst_continue() (0)
|
#define wsrep_sst_continue() (0)
|
||||||
#define wsrep_is_sst_progress() (0)
|
|
||||||
|
|
||||||
#endif /* WSREP_SST_H */
|
#endif /* WSREP_SST_H */
|
||||||
|
@ -417,7 +417,7 @@ process::wait ()
|
|||||||
return err_;
|
return err_;
|
||||||
}
|
}
|
||||||
|
|
||||||
thd::thd (my_bool won) : init(), ptr(new THD(0))
|
thd::thd (my_bool won, bool system_thread) : init(), ptr(new THD(0))
|
||||||
{
|
{
|
||||||
if (ptr)
|
if (ptr)
|
||||||
{
|
{
|
||||||
@ -426,6 +426,8 @@ thd::thd (my_bool won) : init(), ptr(new THD(0))
|
|||||||
wsrep_store_threadvars(ptr);
|
wsrep_store_threadvars(ptr);
|
||||||
ptr->variables.option_bits&= ~OPTION_BIN_LOG; // disable binlog
|
ptr->variables.option_bits&= ~OPTION_BIN_LOG; // disable binlog
|
||||||
ptr->variables.wsrep_on= won;
|
ptr->variables.wsrep_on= won;
|
||||||
|
if (system_thread)
|
||||||
|
ptr->system_thread= SYSTEM_THREAD_GENERIC;
|
||||||
ptr->security_ctx->master_access= ~(ulong)0;
|
ptr->security_ctx->master_access= ~(ulong)0;
|
||||||
lex_start(ptr);
|
lex_start(ptr);
|
||||||
}
|
}
|
||||||
|
@ -303,7 +303,7 @@ class thd
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
thd(my_bool wsrep_on);
|
thd(my_bool wsrep_on, bool system_thread=false);
|
||||||
~thd();
|
~thd();
|
||||||
THD* const ptr;
|
THD* const ptr;
|
||||||
};
|
};
|
||||||
|
@ -224,24 +224,18 @@ row_upd_index_replace_new_col_vals_index_pos(
|
|||||||
const upd_t* update,
|
const upd_t* update,
|
||||||
mem_heap_t* heap)
|
mem_heap_t* heap)
|
||||||
MY_ATTRIBUTE((nonnull));
|
MY_ATTRIBUTE((nonnull));
|
||||||
/***********************************************************//**
|
/** Replace the new column values stored in the update vector,
|
||||||
Replaces the new column values stored in the update vector to the index entry
|
during trx_undo_prev_version_build().
|
||||||
given. */
|
@param entry clustered index tuple where the values are replaced
|
||||||
void
|
(the clustered index leaf page latch must be held)
|
||||||
row_upd_index_replace_new_col_vals(
|
@param index clustered index
|
||||||
/*===============================*/
|
@param update update vector for the clustered index
|
||||||
dtuple_t* entry, /*!< in/out: index entry where replaced;
|
@param heap memory heap for allocating and copying values
|
||||||
the clustered index record must be
|
@return whether the previous version was built successfully */
|
||||||
covered by a lock or a page latch to
|
bool
|
||||||
prevent deletion (rollback or purge) */
|
row_upd_index_replace_new_col_vals(dtuple_t *entry, const dict_index_t &index,
|
||||||
dict_index_t* index, /*!< in: index; NOTE that this may also be a
|
const upd_t *update, mem_heap_t *heap)
|
||||||
non-clustered index */
|
MY_ATTRIBUTE((nonnull, warn_unused_result));
|
||||||
const upd_t* update, /*!< in: an update vector built for the
|
|
||||||
CLUSTERED index so that the field number in
|
|
||||||
an upd_field is the clustered index position */
|
|
||||||
mem_heap_t* heap) /*!< in: memory heap for allocating and
|
|
||||||
copying the new values */
|
|
||||||
MY_ATTRIBUTE((nonnull));
|
|
||||||
/***********************************************************//**
|
/***********************************************************//**
|
||||||
Replaces the new column values stored in the update vector. */
|
Replaces the new column values stored in the update vector. */
|
||||||
void
|
void
|
||||||
|
@ -1127,7 +1127,9 @@ containing also the reference to the external part
|
|||||||
@param[in,out] len input - length of prefix to
|
@param[in,out] len input - length of prefix to
|
||||||
fetch; output: fetched length of the prefix
|
fetch; output: fetched length of the prefix
|
||||||
@param[in,out] heap heap where to allocate
|
@param[in,out] heap heap where to allocate
|
||||||
@return BLOB prefix */
|
@return BLOB prefix
|
||||||
|
@retval NULL if the record is incomplete (should only happen
|
||||||
|
in row_vers_vc_matches_cluster() executed concurrently with another purge) */
|
||||||
static
|
static
|
||||||
byte*
|
byte*
|
||||||
row_upd_ext_fetch(
|
row_upd_ext_fetch(
|
||||||
@ -1142,10 +1144,7 @@ row_upd_ext_fetch(
|
|||||||
*len = btr_copy_externally_stored_field_prefix(
|
*len = btr_copy_externally_stored_field_prefix(
|
||||||
buf, *len, zip_size, data, local_len);
|
buf, *len, zip_size, data, local_len);
|
||||||
|
|
||||||
/* We should never update records containing a half-deleted BLOB. */
|
return *len ? buf : NULL;
|
||||||
ut_a(*len);
|
|
||||||
|
|
||||||
return(buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Replaces the new column value stored in the update vector in
|
/** Replaces the new column value stored in the update vector in
|
||||||
@ -1156,9 +1155,11 @@ the given index entry field.
|
|||||||
@param[in] uf update field
|
@param[in] uf update field
|
||||||
@param[in,out] heap memory heap for allocating and copying
|
@param[in,out] heap memory heap for allocating and copying
|
||||||
the new value
|
the new value
|
||||||
@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0 */
|
@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0
|
||||||
|
@return whether the previous version was built successfully */
|
||||||
|
MY_ATTRIBUTE((nonnull, warn_unused_result))
|
||||||
static
|
static
|
||||||
void
|
bool
|
||||||
row_upd_index_replace_new_col_val(
|
row_upd_index_replace_new_col_val(
|
||||||
dfield_t* dfield,
|
dfield_t* dfield,
|
||||||
const dict_field_t* field,
|
const dict_field_t* field,
|
||||||
@ -1173,13 +1174,13 @@ row_upd_index_replace_new_col_val(
|
|||||||
dfield_copy_data(dfield, &uf->new_val);
|
dfield_copy_data(dfield, &uf->new_val);
|
||||||
|
|
||||||
if (dfield_is_null(dfield)) {
|
if (dfield_is_null(dfield)) {
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = dfield_get_len(dfield);
|
len = dfield_get_len(dfield);
|
||||||
data = static_cast<const byte*>(dfield_get_data(dfield));
|
data = static_cast<const byte*>(dfield_get_data(dfield));
|
||||||
|
|
||||||
if (field && field->prefix_len > 0) {
|
if (field->prefix_len > 0) {
|
||||||
ibool fetch_ext = dfield_is_ext(dfield)
|
ibool fetch_ext = dfield_is_ext(dfield)
|
||||||
&& len < (ulint) field->prefix_len
|
&& len < (ulint) field->prefix_len
|
||||||
+ BTR_EXTERN_FIELD_REF_SIZE;
|
+ BTR_EXTERN_FIELD_REF_SIZE;
|
||||||
@ -1191,6 +1192,9 @@ row_upd_index_replace_new_col_val(
|
|||||||
|
|
||||||
data = row_upd_ext_fetch(data, l, zip_size,
|
data = row_upd_ext_fetch(data, l, zip_size,
|
||||||
&len, heap);
|
&len, heap);
|
||||||
|
if (UNIV_UNLIKELY(!data)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
len = dtype_get_at_most_n_mbchars(col->prtype,
|
len = dtype_get_at_most_n_mbchars(col->prtype,
|
||||||
@ -1204,7 +1208,7 @@ row_upd_index_replace_new_col_val(
|
|||||||
dfield_dup(dfield, heap);
|
dfield_dup(dfield, heap);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (uf->orig_len) {
|
switch (uf->orig_len) {
|
||||||
@ -1243,6 +1247,8 @@ row_upd_index_replace_new_col_val(
|
|||||||
dfield_set_ext(dfield);
|
dfield_set_ext(dfield);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Apply an update vector to an metadata entry.
|
/** Apply an update vector to an metadata entry.
|
||||||
@ -1289,8 +1295,11 @@ row_upd_index_replace_metadata(
|
|||||||
|
|
||||||
f -= f > first;
|
f -= f > first;
|
||||||
const dict_field_t* field = dict_index_get_nth_field(index, f);
|
const dict_field_t* field = dict_index_get_nth_field(index, f);
|
||||||
row_upd_index_replace_new_col_val(dfield, field, field->col,
|
if (!row_upd_index_replace_new_col_val(dfield, field,
|
||||||
uf, heap, zip_size);
|
field->col,
|
||||||
|
uf, heap, zip_size)) {
|
||||||
|
ut_error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ut_ad(found_mblob);
|
ut_ad(found_mblob);
|
||||||
@ -1341,68 +1350,57 @@ row_upd_index_replace_new_col_vals_index_pos(
|
|||||||
update, i, false);
|
update, i, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uf) {
|
if (uf && UNIV_UNLIKELY(!row_upd_index_replace_new_col_val(
|
||||||
row_upd_index_replace_new_col_val(
|
dtuple_get_nth_field(entry, i),
|
||||||
dtuple_get_nth_field(entry, i),
|
field, col, uf, heap,
|
||||||
field, col, uf, heap, zip_size);
|
zip_size))) {
|
||||||
|
ut_error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************//**
|
/** Replace the new column values stored in the update vector,
|
||||||
Replaces the new column values stored in the update vector to the index entry
|
during trx_undo_prev_version_build().
|
||||||
given. */
|
@param entry clustered index tuple where the values are replaced
|
||||||
void
|
(the clustered index leaf page latch must be held)
|
||||||
row_upd_index_replace_new_col_vals(
|
@param index clustered index
|
||||||
/*===============================*/
|
@param update update vector for the clustered index
|
||||||
dtuple_t* entry, /*!< in/out: index entry where replaced;
|
@param heap memory heap for allocating and copying values
|
||||||
the clustered index record must be
|
@return whether the previous version was built successfully */
|
||||||
covered by a lock or a page latch to
|
bool
|
||||||
prevent deletion (rollback or purge) */
|
row_upd_index_replace_new_col_vals(dtuple_t *entry, const dict_index_t &index,
|
||||||
dict_index_t* index, /*!< in: index; NOTE that this may also be a
|
const upd_t *update, mem_heap_t *heap)
|
||||||
non-clustered index */
|
|
||||||
const upd_t* update, /*!< in: an update vector built for the
|
|
||||||
CLUSTERED index so that the field number in
|
|
||||||
an upd_field is the clustered index position */
|
|
||||||
mem_heap_t* heap) /*!< in: memory heap for allocating and
|
|
||||||
copying the new values */
|
|
||||||
{
|
{
|
||||||
ulint i;
|
ut_ad(index.is_primary());
|
||||||
const dict_index_t* clust_index
|
const ulint zip_size= index.table->space->zip_size();
|
||||||
= dict_table_get_first_index(index->table);
|
|
||||||
const ulint zip_size = index->table->space->zip_size();
|
|
||||||
|
|
||||||
ut_ad(!index->table->skip_alter_undo);
|
ut_ad(!index.table->skip_alter_undo);
|
||||||
|
dtuple_set_info_bits(entry, update->info_bits);
|
||||||
|
|
||||||
dtuple_set_info_bits(entry, update->info_bits);
|
for (ulint i= 0; i < index.n_fields; i++)
|
||||||
|
{
|
||||||
|
const dict_field_t *field= &index.fields[i];
|
||||||
|
const dict_col_t* col= dict_field_get_col(field);
|
||||||
|
const upd_field_t *uf;
|
||||||
|
|
||||||
for (i = 0; i < dict_index_get_n_fields(index); i++) {
|
if (col->is_virtual())
|
||||||
const dict_field_t* field;
|
{
|
||||||
const dict_col_t* col;
|
const dict_v_col_t *vcol= reinterpret_cast<const dict_v_col_t*>(col);
|
||||||
const upd_field_t* uf;
|
uf= upd_get_field_by_field_no(update, vcol->v_pos, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
uf= upd_get_field_by_field_no(update, dict_col_get_clust_pos(col, &index),
|
||||||
|
false);
|
||||||
|
|
||||||
field = dict_index_get_nth_field(index, i);
|
if (!uf)
|
||||||
col = dict_field_get_col(field);
|
continue;
|
||||||
if (col->is_virtual()) {
|
|
||||||
const dict_v_col_t* vcol = reinterpret_cast<
|
|
||||||
const dict_v_col_t*>(
|
|
||||||
col);
|
|
||||||
|
|
||||||
uf = upd_get_field_by_field_no(
|
if (!row_upd_index_replace_new_col_val(dtuple_get_nth_field(entry, i),
|
||||||
update, vcol->v_pos, true);
|
field, col, uf, heap, zip_size))
|
||||||
} else {
|
return false;
|
||||||
uf = upd_get_field_by_field_no(
|
}
|
||||||
update,
|
|
||||||
dict_col_get_clust_pos(col, clust_index),
|
|
||||||
false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (uf) {
|
return true;
|
||||||
row_upd_index_replace_new_col_val(
|
|
||||||
dtuple_get_nth_field(entry, i),
|
|
||||||
field, col, uf, heap, zip_size);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Replaces the virtual column values stored in the update vector.
|
/** Replaces the virtual column values stored in the update vector.
|
||||||
@ -2421,7 +2419,7 @@ row_upd_sec_index_entry(
|
|||||||
#ifdef UNIV_DEBUG
|
#ifdef UNIV_DEBUG
|
||||||
mtr_commit(&mtr);
|
mtr_commit(&mtr);
|
||||||
mtr_start(&mtr);
|
mtr_start(&mtr);
|
||||||
ut_ad(btr_validate_index(index, 0));
|
ut_ad(btr_validate_index(index, 0) == DB_SUCCESS);
|
||||||
ut_ad(0);
|
ut_ad(0);
|
||||||
#endif /* UNIV_DEBUG */
|
#endif /* UNIV_DEBUG */
|
||||||
break;
|
break;
|
||||||
|
@ -2476,7 +2476,11 @@ trx_undo_prev_version_build(
|
|||||||
/* The page containing the clustered index record
|
/* The page containing the clustered index record
|
||||||
corresponding to entry is latched in mtr. Thus the
|
corresponding to entry is latched in mtr. Thus the
|
||||||
following call is safe. */
|
following call is safe. */
|
||||||
row_upd_index_replace_new_col_vals(entry, index, update, heap);
|
if (!row_upd_index_replace_new_col_vals(entry, *index, update,
|
||||||
|
heap)) {
|
||||||
|
ut_a(v_status & TRX_UNDO_PREV_IN_PURGE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/* Get number of externally stored columns in updated record */
|
/* Get number of externally stored columns in updated record */
|
||||||
const ulint n_ext = index->is_primary()
|
const ulint n_ext = index->is_primary()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user