Commit a92f07f4 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-27993 Assertion failed in btr_page_reorganize_low()

btr_cur_optimistic_insert(): Disregard DEBUG_DBUG injection to
invoke btr_page_reorganize() if the page (and the table) is empty.
Otherwise, an assertion would fail in btr_page_reorganize_low()
because PAGE_MAX_TRX_ID is 0 in an empty secondary index leaf page.
parent 3fd79a04
...@@ -25,3 +25,10 @@ f1 ...@@ -25,3 +25,10 @@ f1
disconnect con1; disconnect con1;
connection default; connection default;
drop table t1; drop table t1;
#
# MDEV-27993 Assertion failed in btr_page_reorganize_low()
#
CREATE TABLE t1(a INT PRIMARY KEY, b INT UNIQUE) ENGINE=InnoDB;
SET DEBUG_DBUG = '+d,do_page_reorganize';
INSERT INTO t1 VALUES(0,0);
DROP TABLE t1;
...@@ -53,4 +53,12 @@ connection default; ...@@ -53,4 +53,12 @@ connection default;
drop table t1; drop table t1;
--echo #
--echo # MDEV-27993 Assertion failed in btr_page_reorganize_low()
--echo #
CREATE TABLE t1(a INT PRIMARY KEY, b INT UNIQUE) ENGINE=InnoDB;
SET DEBUG_DBUG = '+d,do_page_reorganize';
INSERT INTO t1 VALUES(0,0);
DROP TABLE t1;
--source include/wait_until_count_sessions.inc --source include/wait_until_count_sessions.inc
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc. Copyright (c) 2008, Google Inc.
Copyright (c) 2012, Facebook Inc. Copyright (c) 2012, Facebook Inc.
Copyright (c) 2015, 2021, MariaDB Corporation. Copyright (c) 2015, 2022, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described Google, Inc. Those modifications are gratefully acknowledged and are described
...@@ -3212,6 +3212,7 @@ btr_cur_optimistic_insert( ...@@ -3212,6 +3212,7 @@ btr_cur_optimistic_insert(
<< ib::hex(thr ? thr->graph->trx->id : 0) << ib::hex(thr ? thr->graph->trx->id : 0)
<< ' ' << rec_printer(entry).str()); << ' ' << rec_printer(entry).str());
DBUG_EXECUTE_IF("do_page_reorganize", DBUG_EXECUTE_IF("do_page_reorganize",
if (n_recs)
btr_page_reorganize(page_cursor, index, mtr);); btr_page_reorganize(page_cursor, index, mtr););
/* Now, try the insert */ /* Now, try the insert */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment