Skip to content

Commit 61806af

Browse files
committed
MDEV-35417 InnoDB crashes under ... AND DISABLE CHECKPOINT
restore pre-11.7 behavior when InnoDB was ignoring the "AND DISABLE CHECKPOINT" clause of FTWGRL. InnoDB isn't ready for it yet
1 parent 8de5b58 commit 61806af

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

mysql-test/main/flush_read_lock.result

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,3 +1854,24 @@ connection con2;
18541854
disconnect con2;
18551855
connection default;
18561856
SET DEBUG_SYNC= 'RESET';
1857+
# End of 10.4 tests
1858+
#
1859+
# MDEV-35417 InnoDB crashes under ... AND DISABLE CHECKPOINT
1860+
#
1861+
set global innodb_stats_persistent=0;
1862+
create table t (a int) engine=innodb;
1863+
set global innodb_stats_persistent=1;
1864+
alter table t add column b int;
1865+
flush tables with read lock and disable checkpoint;
1866+
insert into t values (1,2) ;
1867+
ERROR HY000: Can't execute the query because you have a conflicting read lock
1868+
unlock tables;
1869+
drop table t;
1870+
flush tables with read lock and disable checkpoint;
1871+
create temporary table t(a int) engine=innodb;
1872+
unlock tables;
1873+
drop table t;
1874+
# restart: --innodb-read-only
1875+
flush tables with read lock and disable checkpoint;
1876+
# restart
1877+
# End of 11.7 tests

mysql-test/main/flush_read_lock.test

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,3 +2269,35 @@ reap;
22692269
disconnect con2;
22702270
connection default;
22712271
SET DEBUG_SYNC= 'RESET';
2272+
2273+
--echo # End of 10.4 tests
2274+
2275+
--echo #
2276+
--echo # MDEV-35417 InnoDB crashes under ... AND DISABLE CHECKPOINT
2277+
--echo #
2278+
2279+
# case 1
2280+
set global innodb_stats_persistent=0;
2281+
create table t (a int) engine=innodb;
2282+
set global innodb_stats_persistent=1;
2283+
alter table t add column b int;
2284+
flush tables with read lock and disable checkpoint;
2285+
--error ER_CANT_UPDATE_WITH_READLOCK
2286+
insert into t values (1,2) ;
2287+
unlock tables;
2288+
drop table t;
2289+
2290+
# case 2
2291+
flush tables with read lock and disable checkpoint;
2292+
create temporary table t(a int) engine=innodb;
2293+
unlock tables;
2294+
drop table t;
2295+
2296+
# case 3
2297+
--let $restart_parameters=--innodb-read-only
2298+
--source include/restart_mysqld.inc
2299+
flush tables with read lock and disable checkpoint;
2300+
--let $restart_parameters=
2301+
--source include/restart_mysqld.inc
2302+
2303+
--echo # End of 11.7 tests

storage/innobase/handler/ha_innodb.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,6 +1889,12 @@ static void sst_enable_innodb_writes()
18891889

18901890
static void innodb_disable_internal_writes(bool disable)
18911891
{
1892+
/*
1893+
this works only in the SST donor thread and is not yet fixed
1894+
to work in a normal connection thread
1895+
*/
1896+
if (thd_get_thread_id(current_thd)) // if normal thread
1897+
return;
18921898
if (disable)
18931899
sst_disable_innodb_writes();
18941900
else

0 commit comments

Comments
 (0)