maria:bb-10.6-MDEV-28621-v3-eliminate-carefully

Last commit made on 2024-03-26
Get this branch:
git clone -b bb-10.6-MDEV-28621-v3-eliminate-carefully https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.6-MDEV-28621-v3-eliminate-carefully
Repository:
lp:maria

Recent commits

8052f6f... by Sergey Petrunia

MDEV-28621: group by optimization incorrectly removing subquery

Try a different approach at removal: remove only "local" subqueries
for which we can't find any other references in the select list.

cfa8268... by Monty <email address hidden>

MDEV-33622 Server crashes when the UPDATE statement (which has duplicate key) is run after setting a low thread_stack

This was caused by wrong allocation of variable on stack.
(Was allocating 4K of data instead of 512 bytes).

No test case as the original MDEV test cases is not usable for mtr.

4ac8c4c... by Marko Mäkelä

MDEV-24167 fixup: Stricter assertion

log_free_check(): Assert that the current thread is not holding
lock_sys.latch in any mode.

This fixes up commit 5f2dcd112b3b052dc20766b055ab63bcc1ff1c33

c3a00df... by Marko Mäkelä

Merge 10.5 into 10.6

b3d507f... by Monty <email address hidden>

Suppressed new warning for rpl_get_lock on amd-freebsd and aarch64-macos

f838b2d... by Monty <email address hidden>

MDEV-33623 Partitioning is broken on big endian architectures

MDEV-33502 Slowdown when running nested statement with many partitions
caused this error as I failed to take into account bigendian architectures.

This patch also introduces bitmap_import() and bitmap_export() to be used
when one wants to store bitmaps in files/logs in a portable way.

Reviewed-by: Kristian Nielsen <email address hidden>

9a132d4... by Monty <email address hidden>

MDEV-33620 Improve times and states in show processlist for replication

This will makes it easier to find out what replication workers are
doing and what they are waiting for.

Things changed in processlist:
- Slave_SQL time was not consistent. Now time for state "Slave has
  read all relay log; waiting for more updates" shows how long it has
  waited for getting the next event.
- Slave_worker threads did often show "Closing tables" for a long
  time. Now the state is reverted to the previous state after
  "Closing tables" is done.
- Commit and Rollback states where not shown for replication (and some
  other threads). Now Commit and Rollback states are always shown and
  the state is reverted to previous state when the Commit/Rollback
  have finished.

Code changes:
- Added thd->set_time_for_next_stage() for parallel replication when
  when starting to wait for prior transactions to commit, group commit,
  and FTWRL and for free space in thread pool.
  Before we reset the time only after the above events.
- Moved THD_STAGE_INFO(stage_rollback) and THD_STAGE_INFO(stage_commit)
  from sql_parse.cc to transaction.cc to ensure this is done for
  all commits and not only 'normal connection queries'.

Test case changes:
- close_thread_tables() reverting stage to previous stage caused the
  counter in performance_schema to be increased. In many case it is
  the 'sql/starting' stage that was effected.
- We only change to "Commit" stage if there is a need for a commit.
  This caused some "Commit" stages to disapper from perfschema reports.

TODO in 11.#:
- Slave_IO always showes "Waiting for master to send event" and the time is
  from SLAVE START. We should in 11.# change this to be the time since
  reading the last event.

afe9632... by mariadb-DebarunBanerjee <email address hidden>

MDEV-33593 Auto increment deadlock error causes ASSERT in subsequent save point

The issue here is ha_innobase::get_auto_increment() could cause a
deadlock involving auto-increment lock and rollback the transaction
implicitly. For such cases, storage engines usually call
thd_mark_transaction_to_rollback() to inform SQL engine about it which
in turn takes appropriate actions and close the transaction. In innodb,
we call it while converting Innodb error code to MySQL.

However, since ::innobase_get_autoinc() returns void, we skip the call
for error code conversion and also miss marking the transaction for
rollback for deadlock error. We assert eventually while releasing a
savepoint as the transaction state is not active.

Since convert_error_code_to_mysql() is handling some generic error
handling part, like invoking the callback when needed, we should call
that function in ha_innobase::get_auto_increment() even if we don't
return the resulting mysql error code back.

0df4651... by Monty <email address hidden>

Fixed some mtr results found in Jenins after MDEV-333582 push

MDEV-33582 Add more warnings to be able to better diagnose network issues

- Disabled "Semisync ack receiver got hangup" warning
  - One could get this warning from semisync if running
    mtr --mysqld=log-warnings=3 rpl.rpl_semi_sync_shutdown_await_ack
- Fixed result file for engines/funcs/rpl_get_lock.test

6e5333f... by THIRUNARAYANAN BALATHANDAYUTHAPANI

MDEV-32445 InnoDB may corrupt its log before upgrading it on startup

Problem:
========
 During upgrade, InnoDB does write the redo log for adjusting
the tablespace size or tablespace flags even before the log
has upgraded to configured format. This could lead to data
inconsistent if any crash happened during upgrade process.

Fix:
===
srv_start(): Write the tablespace flags adjustment, increased
tablespace size redo log only after redo log upgradation.

log_write_low(), log_reserve_and_write_fast(): Check whether
the redo log is in physical format.