maria:bb-10.7-MDEV-26843

Last commit made on 2022-01-22
Get this branch:
git clone -b bb-10.7-MDEV-26843 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.7-MDEV-26843
Repository:
lp:maria

Recent commits

5e04903... by Rucha Deodhar <email address hidden>

MDEV-26843: Inconsistent behavior of ROW_NUMBER upon resignalling from
function

Analysis: m_current_row_for_warning is reset to 0 earlier so new value '0'
of the counter gets recorded for error condition.
Fix: reset m_current_row_for_warning after other error conditions.

5e6fd4e... by Marko Mäkelä

Merge 10.6 into 10.7

21778b8... by Marko Mäkelä

Merge 10.5 into 10.6

6646591... by Marko Mäkelä

MDEV-27550: Disable galera.MW-328D

764ca7e... by Marko Mäkelä

MDEV-27499 fixup: Add a wait to buf_flush_sync()

The test innodb.log_file_size would occasionally fail with
an assertion failure !buf_pool.any_io_pending(). Let us wait
for the page cleaner thread to become idle already in
srv_prepare_to_delete_redo_log_file(), like we used to.

7259b29... by Sergey Petrunia

MDEV-27382: OFFSET is ignored when combined with DISTINCT

A query in form

  SELECT DISTINCT expr_that_is_inferred_to_be_const LIMIT 0 OFFSET n

produces one row when it should produce none. The issue was in
JOIN_TAB::remove_duplicates() in the piece of logic that tried to
avoid duplicate removal for such cases but didn't account for possible
"LIMIT 0".

Fixed by making Select_limit_counters::set_limit() change OFFSET to 0
when LIMIT is 0.

965c0d2... by Marko Mäkelä

MDEV-27025: Null merge 10.5 into 10.6

be81138... by Vlad Lesin

MDEV-27025 insert-intention lock conflicts with waiting ORDINARY lock

The code was backported from 10.6 bd03c0e51629e1c3969a171137712a6bb854c232
commit. See that commit message for details.

Apart from the above commit trx_lock_t::wait_trx was also backported from
MDEV-24738. trx_lock_t::wait_trx is protected with lock_sys.wait_mutex
in 10.6, but that mutex was implemented only in MDEV-24789. As there is no
need to backport MDEV-24789 for MDEV-27025,
trx_lock_t::wait_trx is protected with the same mutexes as
trx_lock_t::wait_lock.

This fix should not break innodb-lock-schedule-algorithm=VATS. This
algorithm uses an Eldest-Transaction-First (ETF) heuristic, which prefers
older transactions over new ones. In this fix we just insert granted lock
just before the last granted lock of the same transaction, what does not
change transactions execution order.

The changes in lock_rec_create_low() should not break Galera Cluster,
there is a big "if" branch for WSREP. This branch is necessary to provide
the correct transactions execution order, and should not be changed for
the current bug fix.

bd03c0e... by Vlad Lesin

MDEV-27025 insert-intention lock conflicts with waiting ORDINARY lock

When lock is checked for conflict, ignore other locks on the record if
they wait for the requesting transaction.

lock_rec_has_to_wait_in_queue() iterates not all locks for
the page, but only the locks located before the waiting lock in the
queue. So there is some invariant - any lock in the queue can wait only
lock which is located before the waiting lock in the queue.

In the case when conflicting lock waits for the transaction of
requesting lock, we need to place the requesting lock before the waiting
lock in the queue to preserve the invariant. That is why we are looking
for the first waiting for requesting transation lock and place the new
lock just after the last granted requesting transaction lock before the
first waiting for requesting transaction lock.

Example:

trx1 waiting lock, trx1 granted lock, ..., trx2 lock - waiting for trx1
place new lock here -----------------^

There are also implicit locks which are lazily converted to explicit
ones, and we need to place the newly created explicit lock to the correct
place in a queue. All explicit locks converted from implicit ones are
placed just after the last non-waiting lock of the same transaction before
the first waiting for the transaction lock.

Code review and cleanup was made by Marko Mäkelä.

b099858... by Marko Mäkelä

Merge 10.6 into 10.7