MDEV-27523 main.delayed fails with wrong error code or timeout when executed after main.deadlock_ftwrl
don't forget to reset mdl_context.m_deadlock_overweight when taking the THD out of the cache - the history of previous connections should not affect the weight in deadlock victim selection (small cleanup of the test to help the correct merge)
This commit is contained in:
parent
e9b38f684f
commit
e46ae59265
@ -1,4 +1,3 @@
|
|||||||
drop table if exists t1;
|
|
||||||
create table t1 (a char(10), tmsp timestamp);
|
create table t1 (a char(10), tmsp timestamp);
|
||||||
insert into t1 set a = 1;
|
insert into t1 set a = 1;
|
||||||
insert delayed into t1 set a = 2;
|
insert delayed into t1 set a = 2;
|
||||||
@ -259,7 +258,6 @@ INSERT DELAYED INTO t1 SET b= b();
|
|||||||
ERROR 42000: FUNCTION test.b does not exist
|
ERROR 42000: FUNCTION test.b does not exist
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
End of 5.0 tests
|
End of 5.0 tests
|
||||||
DROP TABLE IF EXISTS t1,t2;
|
|
||||||
SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
|
SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
|
||||||
CREATE TABLE `t1` (
|
CREATE TABLE `t1` (
|
||||||
`id` int(11) PRIMARY KEY auto_increment,
|
`id` int(11) PRIMARY KEY auto_increment,
|
||||||
@ -293,7 +291,6 @@ set global low_priority_updates = 1;
|
|||||||
select @@global.low_priority_updates;
|
select @@global.low_priority_updates;
|
||||||
@@global.low_priority_updates
|
@@global.low_priority_updates
|
||||||
1
|
1
|
||||||
drop table if exists t1;
|
|
||||||
create table t1 (a int, b int);
|
create table t1 (a int, b int);
|
||||||
insert into t1 values (1,1);
|
insert into t1 values (1,1);
|
||||||
lock table t1 read;
|
lock table t1 read;
|
||||||
@ -322,7 +319,6 @@ set global low_priority_updates = @old_delayed_updates;
|
|||||||
#
|
#
|
||||||
# Bug #47682 strange behaviour of INSERT DELAYED
|
# Bug #47682 strange behaviour of INSERT DELAYED
|
||||||
#
|
#
|
||||||
DROP TABLE IF EXISTS t1, t2;
|
|
||||||
CREATE TABLE t1 (f1 integer);
|
CREATE TABLE t1 (f1 integer);
|
||||||
CREATE TABLE t2 (f1 integer);
|
CREATE TABLE t2 (f1 integer);
|
||||||
FLUSH TABLES WITH READ LOCK;
|
FLUSH TABLES WITH READ LOCK;
|
||||||
@ -335,8 +331,6 @@ End of 5.1 tests
|
|||||||
#
|
#
|
||||||
# Bug #47274 assert in open_table on CREATE TABLE <already existing>
|
# Bug #47274 assert in open_table on CREATE TABLE <already existing>
|
||||||
#
|
#
|
||||||
DROP TABLE IF EXISTS t1;
|
|
||||||
DROP TABLE IF EXISTS t2;
|
|
||||||
CREATE TABLE t1 ( f1 INTEGER AUTO_INCREMENT, PRIMARY KEY (f1));
|
CREATE TABLE t1 ( f1 INTEGER AUTO_INCREMENT, PRIMARY KEY (f1));
|
||||||
# The following CREATE TABLEs before gave an assert.
|
# The following CREATE TABLEs before gave an assert.
|
||||||
INSERT DELAYED t1 VALUES (4);
|
INSERT DELAYED t1 VALUES (4);
|
||||||
@ -352,14 +346,12 @@ CREATE TABLE t2 (f1 INTEGER);
|
|||||||
INSERT DELAYED t1 VALUES (7);
|
INSERT DELAYED t1 VALUES (7);
|
||||||
CREATE TABLE t1 LIKE t2;
|
CREATE TABLE t1 LIKE t2;
|
||||||
ERROR 42S01: Table 't1' already exists
|
ERROR 42S01: Table 't1' already exists
|
||||||
DROP TABLE t2;
|
DROP TABLE t2, t1;
|
||||||
DROP TABLE t1;
|
|
||||||
#
|
#
|
||||||
# Bug#54332 Deadlock with two connections doing LOCK TABLE+INSERT DELAYED
|
# Bug#54332 Deadlock with two connections doing LOCK TABLE+INSERT DELAYED
|
||||||
#
|
#
|
||||||
# This test is not supposed to work under --ps-protocol since
|
# This test is not supposed to work under --ps-protocol since
|
||||||
# INSERT DELAYED doesn't work under LOCK TABLES with this protocol.
|
# INSERT DELAYED doesn't work under LOCK TABLES with this protocol.
|
||||||
DROP TABLE IF EXISTS t1, t2;
|
|
||||||
CREATE TABLE t1 (a INT);
|
CREATE TABLE t1 (a INT);
|
||||||
CREATE TABLE t2 (a INT);
|
CREATE TABLE t2 (a INT);
|
||||||
CREATE TABLE t3 (a INT);
|
CREATE TABLE t3 (a INT);
|
||||||
@ -450,7 +442,6 @@ DROP TABLE t1, t2, t3;
|
|||||||
#
|
#
|
||||||
connect con1,localhost,root,,;
|
connect con1,localhost,root,,;
|
||||||
connection default;
|
connection default;
|
||||||
drop table if exists t1, t2, tm;
|
|
||||||
create table t1(a int);
|
create table t1(a int);
|
||||||
create table t2(a int);
|
create table t2(a int);
|
||||||
create table tm(a int) engine=merge union=(t1, t2);
|
create table tm(a int) engine=merge union=(t1, t2);
|
||||||
|
@ -21,9 +21,6 @@ select @@global.storage_engine in
|
|||||||
("memory","myisam","archive","blackhole") as `TRUE`;
|
("memory","myisam","archive","blackhole") as `TRUE`;
|
||||||
enable_query_log;
|
enable_query_log;
|
||||||
|
|
||||||
--disable_warnings
|
|
||||||
drop table if exists t1;
|
|
||||||
--enable_warnings
|
|
||||||
create table t1 (a char(10), tmsp timestamp);
|
create table t1 (a char(10), tmsp timestamp);
|
||||||
insert into t1 set a = 1;
|
insert into t1 set a = 1;
|
||||||
insert delayed into t1 set a = 2;
|
insert delayed into t1 set a = 2;
|
||||||
@ -276,9 +273,6 @@ DROP TABLE t1;
|
|||||||
#
|
#
|
||||||
# Bug#27358 INSERT DELAYED does not honour SQL_MODE of the client
|
# Bug#27358 INSERT DELAYED does not honour SQL_MODE of the client
|
||||||
#
|
#
|
||||||
--disable_warnings
|
|
||||||
DROP TABLE IF EXISTS t1,t2;
|
|
||||||
--enable_warnings
|
|
||||||
SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
|
SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
|
||||||
CREATE TABLE `t1` (
|
CREATE TABLE `t1` (
|
||||||
`id` int(11) PRIMARY KEY auto_increment,
|
`id` int(11) PRIMARY KEY auto_increment,
|
||||||
@ -315,9 +309,6 @@ set @old_delayed_updates = @@global.low_priority_updates;
|
|||||||
set global low_priority_updates = 1;
|
set global low_priority_updates = 1;
|
||||||
select @@global.low_priority_updates;
|
select @@global.low_priority_updates;
|
||||||
|
|
||||||
--disable_warnings
|
|
||||||
drop table if exists t1;
|
|
||||||
--enable_warnings
|
|
||||||
create table t1 (a int, b int);
|
create table t1 (a int, b int);
|
||||||
insert into t1 values (1,1);
|
insert into t1 values (1,1);
|
||||||
lock table t1 read;
|
lock table t1 read;
|
||||||
@ -351,10 +342,6 @@ set global low_priority_updates = @old_delayed_updates;
|
|||||||
--echo # Bug #47682 strange behaviour of INSERT DELAYED
|
--echo # Bug #47682 strange behaviour of INSERT DELAYED
|
||||||
--echo #
|
--echo #
|
||||||
|
|
||||||
--disable_warnings
|
|
||||||
DROP TABLE IF EXISTS t1, t2;
|
|
||||||
--enable_warnings
|
|
||||||
|
|
||||||
CREATE TABLE t1 (f1 integer);
|
CREATE TABLE t1 (f1 integer);
|
||||||
CREATE TABLE t2 (f1 integer);
|
CREATE TABLE t2 (f1 integer);
|
||||||
|
|
||||||
@ -378,11 +365,6 @@ DROP TABLE t1, t2;
|
|||||||
--echo # Bug #47274 assert in open_table on CREATE TABLE <already existing>
|
--echo # Bug #47274 assert in open_table on CREATE TABLE <already existing>
|
||||||
--echo #
|
--echo #
|
||||||
|
|
||||||
--disable_warnings
|
|
||||||
DROP TABLE IF EXISTS t1;
|
|
||||||
DROP TABLE IF EXISTS t2;
|
|
||||||
--enable_warnings
|
|
||||||
|
|
||||||
CREATE TABLE t1 ( f1 INTEGER AUTO_INCREMENT, PRIMARY KEY (f1));
|
CREATE TABLE t1 ( f1 INTEGER AUTO_INCREMENT, PRIMARY KEY (f1));
|
||||||
|
|
||||||
--echo # The following CREATE TABLEs before gave an assert.
|
--echo # The following CREATE TABLEs before gave an assert.
|
||||||
@ -404,9 +386,7 @@ INSERT DELAYED t1 VALUES (7);
|
|||||||
--error ER_TABLE_EXISTS_ERROR
|
--error ER_TABLE_EXISTS_ERROR
|
||||||
CREATE TABLE t1 LIKE t2;
|
CREATE TABLE t1 LIKE t2;
|
||||||
|
|
||||||
DROP TABLE t2;
|
DROP TABLE t2, t1;
|
||||||
DROP TABLE t1;
|
|
||||||
|
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Bug#54332 Deadlock with two connections doing LOCK TABLE+INSERT DELAYED
|
--echo # Bug#54332 Deadlock with two connections doing LOCK TABLE+INSERT DELAYED
|
||||||
@ -417,10 +397,6 @@ DROP TABLE t1;
|
|||||||
--disable_ps_protocol
|
--disable_ps_protocol
|
||||||
--disable_view_protocol
|
--disable_view_protocol
|
||||||
|
|
||||||
--disable_warnings
|
|
||||||
DROP TABLE IF EXISTS t1, t2;
|
|
||||||
--enable_warnings
|
|
||||||
|
|
||||||
CREATE TABLE t1 (a INT);
|
CREATE TABLE t1 (a INT);
|
||||||
CREATE TABLE t2 (a INT);
|
CREATE TABLE t2 (a INT);
|
||||||
CREATE TABLE t3 (a INT);
|
CREATE TABLE t3 (a INT);
|
||||||
@ -573,9 +549,6 @@ DROP TABLE t1, t2, t3;
|
|||||||
--disable_view_protocol
|
--disable_view_protocol
|
||||||
connect (con1,localhost,root,,);
|
connect (con1,localhost,root,,);
|
||||||
connection default;
|
connection default;
|
||||||
--disable_warnings
|
|
||||||
drop table if exists t1, t2, tm;
|
|
||||||
--enable_warnings
|
|
||||||
create table t1(a int);
|
create table t1(a int);
|
||||||
create table t2(a int);
|
create table t2(a int);
|
||||||
create table tm(a int) engine=merge union=(t1, t2);
|
create table tm(a int) engine=merge union=(t1, t2);
|
||||||
|
@ -919,7 +919,8 @@ public:
|
|||||||
already has received some signal or closed
|
already has received some signal or closed
|
||||||
signal slot.
|
signal slot.
|
||||||
*/
|
*/
|
||||||
void init(MDL_context_owner *arg) { m_owner= arg; }
|
void init(MDL_context_owner *arg) { m_owner= arg; reset(); }
|
||||||
|
void reset() { m_deadlock_overweight= 0; }
|
||||||
|
|
||||||
void set_needs_thr_lock_abort(bool needs_thr_lock_abort)
|
void set_needs_thr_lock_abort(bool needs_thr_lock_abort)
|
||||||
{
|
{
|
||||||
@ -1028,7 +1029,7 @@ private:
|
|||||||
*/
|
*/
|
||||||
MDL_wait_for_subgraph *m_waiting_for;
|
MDL_wait_for_subgraph *m_waiting_for;
|
||||||
LF_PINS *m_pins;
|
LF_PINS *m_pins;
|
||||||
uint m_deadlock_overweight= 0;
|
uint m_deadlock_overweight;
|
||||||
private:
|
private:
|
||||||
MDL_ticket *find_ticket(MDL_request *mdl_req,
|
MDL_ticket *find_ticket(MDL_request *mdl_req,
|
||||||
enum_mdl_duration *duration);
|
enum_mdl_duration *duration);
|
||||||
|
@ -1209,6 +1209,7 @@ const Type_handler *THD::type_handler_for_datetime() const
|
|||||||
void THD::init()
|
void THD::init()
|
||||||
{
|
{
|
||||||
DBUG_ENTER("thd::init");
|
DBUG_ENTER("thd::init");
|
||||||
|
mdl_context.reset();
|
||||||
mysql_mutex_lock(&LOCK_global_system_variables);
|
mysql_mutex_lock(&LOCK_global_system_variables);
|
||||||
plugin_thdvar_init(this);
|
plugin_thdvar_init(this);
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user