Skip to content

Commit

Permalink
Merge 10.6 into 10.7
Browse files Browse the repository at this point in the history
  • Loading branch information
nayuta-yanagisawa committed Sep 8, 2022
2 parents 0c0b697 + 7002173 commit 3133435
Show file tree
Hide file tree
Showing 21 changed files with 274 additions and 180 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PROJECT(MySQL)
# in RPM's:

#set(CPACK_RPM_SPEC_MORE_DEFINE "%define __spec_install_post /bin/true")
FOREACH(p CMP0022 CMP0046 CMP0040 CMP0048 CMP0054 CMP0075 CMP0069)
FOREACH(p CMP0022 CMP0046 CMP0040 CMP0048 CMP0054 CMP0075 CMP0069 CMP0135)
IF(POLICY ${p})
CMAKE_POLICY(SET ${p} NEW)
ENDIF()
Expand Down
2 changes: 1 addition & 1 deletion debian/autobake-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ case "${LSBNAME}" in
replace_uring_with_aio
disable_libfmt
;&
impish|jammy)
impish|jammy|kinetic)
# mariadb-plugin-rocksdb s390x not supported by us (yet)
# ubuntu doesn't support mips64el yet, so keep this just
# in case something changes.
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/main/range_innodb.result
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ drop table t0,t1,t2;
create table t1 (
pk int, a int, b int,
primary key (pk), index idx1(b), index idx2(b)
) engine=innodb;
) engine=innodb STATS_AUTO_RECALC=0;
Warnings:
Note 1831 Duplicate index `idx2`. This is deprecated and will be disallowed in a future release
insert into t1 values (1,6,0),(2,1,0),(3,5,2),(4,8,0);
create table t2 (c int) engine=innodb;
create table t2 (c int) engine=innodb STATS_AUTO_RECALC=0;
insert into t2 values (1),(2);
create table t3 (d int) engine=innodb;
create table t3 (d int) engine=innodb STATS_AUTO_RECALC=0;
insert into t3 values (3),(-1),(4);
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='extended_keys=on';
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/main/range_innodb.test
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ drop table t0,t1,t2;
create table t1 (
pk int, a int, b int,
primary key (pk), index idx1(b), index idx2(b)
) engine=innodb;
) engine=innodb STATS_AUTO_RECALC=0;
insert into t1 values (1,6,0),(2,1,0),(3,5,2),(4,8,0);
create table t2 (c int) engine=innodb;
create table t2 (c int) engine=innodb STATS_AUTO_RECALC=0;
insert into t2 values (1),(2);
create table t3 (d int) engine=innodb;
create table t3 (d int) engine=innodb STATS_AUTO_RECALC=0;
insert into t3 values (3),(-1),(4);

set @save_optimizer_switch=@@optimizer_switch;
Expand Down
22 changes: 21 additions & 1 deletion mysql-test/suite/innodb/r/instant_alter_crash.result
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,25 @@ t3 CREATE TABLE `t3` (
PRIMARY KEY (`id`),
UNIQUE KEY `v2` (`v2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1,t2,t3;
DROP TABLE t2,t3;
#
# MDEV-29440 InnoDB instant ALTER TABLE recovery wrongly uses
# READ COMMITTED isolation level instead of READ UNCOMMITTED
#
CREATE TABLE t2(a INT UNSIGNED PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1),(2),(3),(4),(5),(6);
connect ddl, localhost, root;
SET DEBUG_SYNC='innodb_alter_inplace_before_commit SIGNAL ddl WAIT_FOR ever';
ALTER TABLE t2 ADD COLUMN b TINYINT UNSIGNED NOT NULL DEFAULT 42 FIRST;
connection default;
SET DEBUG_SYNC='now WAIT_FOR ddl';
SET GLOBAL innodb_flush_log_at_trx_commit=1;
DELETE FROM t1;
# Kill the server
disconnect ddl;
# restart
CHECK TABLE t2;
Table Op Msg_type Msg_text
test.t2 check status OK
DROP TABLE t1,t2;
db.opt
4 changes: 3 additions & 1 deletion mysql-test/suite/innodb/r/lock_delete_updated.result
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t VALUES (3);
BEGIN;
connection default;
UPDATE t SET a = 2;
connect con1,localhost,root;
SET DEBUG_SYNC="lock_wait_start SIGNAL del_locked";
DELETE FROM t;
connection default;
SET DEBUG_SYNC="now WAIT_FOR del_locked";
UPDATE t SET a = 1;
COMMIT;
connection con1;
Expand All @@ -17,4 +18,5 @@ connection default;
SELECT count(*) FROM t;
count(*)
1
SET DEBUG_SYNC="reset";
DROP TABLE t;
26 changes: 25 additions & 1 deletion mysql-test/suite/innodb/t/instant_alter_crash.test
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,30 @@ disconnect ddl;
SHOW CREATE TABLE t1;
SHOW CREATE TABLE t2;
SHOW CREATE TABLE t3;
DROP TABLE t1,t2,t3;
DROP TABLE t2,t3;

--echo #
--echo # MDEV-29440 InnoDB instant ALTER TABLE recovery wrongly uses
--echo # READ COMMITTED isolation level instead of READ UNCOMMITTED
--echo #
CREATE TABLE t2(a INT UNSIGNED PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1),(2),(3),(4),(5),(6);

connect ddl, localhost, root;
SET DEBUG_SYNC='innodb_alter_inplace_before_commit SIGNAL ddl WAIT_FOR ever';
--send
ALTER TABLE t2 ADD COLUMN b TINYINT UNSIGNED NOT NULL DEFAULT 42 FIRST;

connection default;
SET DEBUG_SYNC='now WAIT_FOR ddl';
SET GLOBAL innodb_flush_log_at_trx_commit=1;
DELETE FROM t1;

--source include/kill_mysqld.inc
disconnect ddl;
--source include/start_mysqld.inc

CHECK TABLE t2;
DROP TABLE t1,t2;

--list_files $MYSQLD_DATADIR/test
12 changes: 5 additions & 7 deletions mysql-test/suite/innodb/t/lock_delete_updated.test
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
--source include/have_innodb.inc
--source include/count_sessions.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc

CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t VALUES (3);

BEGIN;

connection default;
UPDATE t SET a = 2;

connect con1,localhost,root;
SET DEBUG_SYNC="lock_wait_start SIGNAL del_locked";
send DELETE FROM t;

connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Updating" and info = "DELETE FROM t";
--source include/wait_condition.inc

SET DEBUG_SYNC="now WAIT_FOR del_locked";
UPDATE t SET a = 1;
COMMIT;

Expand All @@ -30,5 +27,6 @@ connection default;
--echo # The above DELETE must delete all the rows in the table, so the
--echo # following SELECT must show 0 rows.
SELECT count(*) FROM t;
SET DEBUG_SYNC="reset";
DROP TABLE t;
--source include/wait_until_count_sessions.inc
8 changes: 4 additions & 4 deletions mysql-test/suite/innodb_fts/r/misc_debug2.result
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ DROP TABLE mdev21563;
#
CREATE TABLE t1(f1 CHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB;
INSERT INTO t1 VALUES('mysql'), ('innodb');
set debug_dbug="+d,fts_instrument_sync_debug";
set debug_dbug="+d,fts_instrument_sync_request";
INSERT INTO t1 VALUES('test');
set debug_dbug="-d,fts_instrument_sync_debug";
set debug_dbug="-d,fts_instrument_sync_request";
INSERT INTO t1 VALUES('This is a fts issue');
# restart
set debug_dbug="+d,fts_instrument_sync_debug";
set debug_dbug="+d,fts_instrument_sync_request";
UPDATE t1 SET f1="mariadb";
set debug_dbug="-d,fts_instrument_sync_debug";
set debug_dbug="-d,fts_instrument_sync_request";
DROP TABLE t1;
8 changes: 4 additions & 4 deletions mysql-test/suite/innodb_fts/t/misc_debug2.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ DROP TABLE mdev21563;
--echo #
CREATE TABLE t1(f1 CHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB;
INSERT INTO t1 VALUES('mysql'), ('innodb');
set debug_dbug="+d,fts_instrument_sync_debug";
set debug_dbug="+d,fts_instrument_sync_request";
INSERT INTO t1 VALUES('test');
set debug_dbug="-d,fts_instrument_sync_debug";
set debug_dbug="-d,fts_instrument_sync_request";
INSERT INTO t1 VALUES('This is a fts issue');
--source include/restart_mysqld.inc
set debug_dbug="+d,fts_instrument_sync_debug";
set debug_dbug="+d,fts_instrument_sync_request";
UPDATE t1 SET f1="mariadb";
set debug_dbug="-d,fts_instrument_sync_debug";
set debug_dbug="-d,fts_instrument_sync_request";
DROP TABLE t1;
14 changes: 6 additions & 8 deletions sql/sql_connect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,12 @@ static int check_connection(THD *thd)

void setup_connection_thread_globals(THD *thd)
{
DBUG_EXECUTE_IF("CONNECT_wait", {
extern Dynamic_array<MYSQL_SOCKET> listen_sockets;
DBUG_ASSERT(listen_sockets.size());
while (listen_sockets.size())
my_sleep(1000);
});
thd->store_globals();
}

Expand Down Expand Up @@ -1359,14 +1365,6 @@ void do_handle_one_connection(CONNECT *connect, bool put_in_cache)
return;
}

DBUG_EXECUTE_IF("CONNECT_wait",
{
extern Dynamic_array<MYSQL_SOCKET> listen_sockets;
DBUG_ASSERT(listen_sockets.size());
while (listen_sockets.size())
my_sleep(1000);
});

/*
If a thread was created to handle this connection:
increment slow_launch_threads counter if it took more than
Expand Down
8 changes: 0 additions & 8 deletions sql/threadpool_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,6 @@ static THD *threadpool_add_connection(CONNECT *connect, TP_connection *c)
{
THD *thd= NULL;

DBUG_EXECUTE_IF("CONNECT_wait",
{
extern Dynamic_array<MYSQL_SOCKET> listen_sockets;
DBUG_ASSERT(listen_sockets.size());
while (listen_sockets.size())
my_sleep(1000);
});

/*
Create a new connection context: mysys_thread_var and PSI thread
Store them in THD.
Expand Down
Loading

0 comments on commit 3133435

Please sign in to comment.