maria:bb-10.6-ps2-MDEV-31003

Last commit made on 2023-07-21
Get this branch:
git clone -b bb-10.6-ps2-MDEV-31003 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.6-ps2-MDEV-31003
Repository:
lp:maria

Recent commits

7d921f5... by Lena Startseva <email address hidden>

MDEV-31003: Second execution for ps-protocol

Update tests for version 10.6

9411201... by Lena Startseva <email address hidden>

MDEV-31003: Second execution for ps-protocol

Update tests for version 10.5

726c68d... by Lena Startseva <email address hidden>

MDEV-31003: Second execution for ps-protocol

This patch adds for "--ps-protocol" second execution
of queries "SELECT".
Also in this patch it is added ability to disable/enable
(--disable_ps2_protocol/--enable_ps2_protocol) second
execution for "--ps-prototocol" in testcases.

a03ce7b... by Alexey Botchkov

MDEV-31521 bzero wipes more bytes than necessary in set_global_from_ddl_log_entry.

'defaults' made into 'constexpr' variables.

a4e103a... by Monty <email address hidden>

Fixed bug in ddl log

This issue could only be noticed in very extraordinary circumstances
when trying to rename a temporary table that is not in the file system.

The issue was found when I temporarly disabled check_if_frm_exists()
while searching for another bug.

feaeb27... by Sergey Petrunia

MDEV-29152: Assertion failed ... upon TO_CHAR with wrong argument

Item_func_tochar::check_arguments() didn't check if its arguments
each had one column. Failing to make this check and proceeding would
eventually cause either an assertion failure or the execution would
reach "MY_ASSERT_UNREACHABLE();" which would produce a crash with
a misleading stack trace.

* Fixed Item_func_tochar::check_arguments() to do the required check.

* Also fixed MY_ASSERT_UNREACHABLE() to terminate the program. Just
"executing" __builtin_unreachable() used to cause "undefined results",
which in my experience was a crash with corrupted stack trace.

090a843... by Vlad Lesin

MDEV-29311 Server Status Innodb_row_lock_time% is reported in seconds

Before MDEV-24671, the wait time was derived from my_interval_timer() /
1000 (nanoseconds converted to microseconds, and not microseconds to
milliseconds like I must have assumed). The lock_sys.wait_time and
lock_sys.wait_time_max are already in milliseconds; we should not divide
them by 1000.

In MDEV-24738 the millisecond counts lock_sys.wait_time and
lock_sys.wait_time_max were changed to a 32-bit type. That would
overflow in 49.7 days. Keep using a 64-bit type for those millisecond
counters.

Reviewed by: Marko Mäkelä

6ed14bc... by Monty <email address hidden>

Disable view protocol for opt_trace.test

This is because some plan changes because of views

99bd226... by Monty <email address hidden>

MDEV-31558 Add InnoDB engine information to the slow query log

The new statistics is enabled by adding the "engine", "innodb" or "full"
option to --log-slow-verbosity

Example output:

 # Pages_accessed: 184 Pages_read: 95 Pages_updated: 0 Old_rows_read: 1
 # Pages_read_time: 17.0204 Engine_time: 248.1297

Page_read_time is time doing physical reads inside a storage engine.
(Writes cannot be tracked as these are usually done in the background).
Engine_time is the time spent inside the storage engine for the full
duration of the read/write/update calls. It uses the same code as
'analyze statement' for calculating the time spent.

The engine statistics is done with a generic interface that should be
easy for any engine to use. It can also easily be extended to provide
even more statistics.

Currently only InnoDB has counters for Pages_% and Undo_% status.
Engine_time works for all engines.

Implementation details:

class ha_handler_stats holds all engine stats. This class is included
in handler and THD classes.
While a query is running, all statistics is updated in the handler. In
close_thread_tables() the statistics is added to the THD.

handler::handler_stats is a pointer to where statistics should be
collected. This is set to point to handler::active_handler_stats if
stats are requested. If not, it is set to 0.
handler_stats has also an element, 'active' that is 1 if stats are
requested. This is to allow engines to avoid doing any 'if's while
updating the statistics.

Cloned or partition tables have the pointer set to the base table if
status are requested.

There is a small performance impact when using --log-slow-verbosity=engine:
- All engine calls in 'select' will be timed.
- IO calls for InnoDB reads will be timed.
- Incrementation of counters are done on local variables and accesses
  are inline, so these should have very little impact.
- Statistics has to be reset for each statement for the THD and each
  used handler. This is only 40 bytes, which should be neglectable.
- For partition tables we have to loop over all partitions to update
  the handler_status as part of table_init(). Can be optimized in the
  future to only do this is log-slow-verbosity changes. For this to work
  we have to update handler_status for all opened partitions and
  also for all partitions opened in the future.

Other things:
- Added options 'engine' and 'full' to log-slow-verbosity.
- Some of the new files in the test suite comes from Percona server, which
  has similar status information.
- buf_page_optimistic_get(): Do not increment any counter, since we are
  only validating a pointer, not performing any buf_pool.page_hash lookup.
- Added THD argument to save_explain_data_intern().
- Switched arguments for save_explain_.*_data() to have
  always THD first (generates better code as other functions also have THD
  first).

2855bc5... by Marko Mäkelä

Merge 10.5 into 10.6