1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-24818 Concurrent use of InnoDB table is impossible until the first transaction is finished

In MDEV-515, we enabled an optimization where an insert into an
empty table will use table-level locking and undo logging.
This may break applications that expect row-level locking.

The SQL statements created by the mysqldump utility will include the
following:

    SET unique_checks=0, foreign_key_checks=0;

We will use these flags to enable the table-level locked and logged
insert. Unless the parameters are set, INSERT will be executed in
the old way, with row-level undo logging and implicit record locks.
This commit is contained in:
Marko Mäkelä
2021-03-11 18:36:09 +02:00
parent 8dd35a2507
commit 92b2a911e5
7 changed files with 12 additions and 4 deletions

View File

@@ -2,6 +2,8 @@
-- connect (con2,localhost,root,,)
-- connection con1
# Enable MDEV-515 table-level undo logging for insert into empty table
SET foreign_key_checks=0, unique_checks=0;
SET autocommit=0;
SELECT * FROM t1 FOR UPDATE;
-- if ($con1_extra_sql_present) {
@@ -9,6 +11,8 @@ SELECT * FROM t1 FOR UPDATE;
-- }
-- connection con2
# Enable MDEV-515 table-level undo logging for insert into empty table
SET foreign_key_checks=0, unique_checks=0;
SET autocommit=0;
SELECT * FROM t2 FOR UPDATE;
-- if ($con2_extra_sql_present) {