Home - Waterfall Grid T-Grid Console Builders Recent Builds Buildslaves Changesources - JSON API - About

Console View


Categories: connectors experimental galera main
Legend:   Passed Failed Warnings Failed Again Running Exception Offline No data

connectors experimental galera main
Aleksey Midenkov
MDEV-30281 MTR: add --strip-hints to omit crash-report hints

A crash report contains, besides the actual server log and backtrace,
several explanatory "hint" paragraphs - bug-reporting boilerplate,
instructions for producing a better stack trace, "Attempting backtrace",
"Output from gdb follows", etc. They are useful once but noise for
someone who reads these reports all day.

Add --strip-hints (off by default). When given, these hints are omitted
and only the real content is kept.

Three sources are handled:

- The paragraphs the server writes to its error log (via the crash
  signal handler) are dropped from the "Server log from this test"
  excerpt by strip_crash_hints(). Each hint is a paragraph running from
  a recognizable opener line to the next blank line, so trimming is
  robust across server-version wording changes; the surrounding data
  (CURRENT_TEST, the signal line, "Server version", the backtrace,
  thread pointer, ...) is kept.

- My::CoreDump prints its own "Output from gdb/lldb follows ..." header;
  it is suppressed too, leaving just the debugger output.

- mariadb-test-run.pl's own end-of-run boilerplate in mtr_report_stats()
  ("The log files in var/log may give you some hint ..." and the
  MariaDB bug-tracker URL) is skipped as well.

$opt_strip_hints is declared with "our" so My::CoreDump and
mtr_report.pm can read it as $::opt_strip_hints.
Aleksey Midenkov
MDEV-30281 MTR conf: honor standard --defaults-* options

Wire the standard MariaDB defaults options into MTR's own option loading,
mirroring libmariadb's get_defaults_options()/my_load_defaults():

  --no-defaults            do not read any option file
  --defaults-file          read [mtr] from this file only
  --defaults-extra-file    read this file in addition (extra-file slot)
  --defaults-group-suffix  also read [mtr<suffix>]
  --print-defaults        print the [mtr] options and exit

--defaults-file and --defaults-extra-file keep their existing MTR meaning
as the server config *template* too: the two consumers read different
groups of the same file - [mysqld]/[client]/... for the template (via
collect_option), [mtr] here. A command-line --defaults-file /
--defaults-extra-file overrides the MTR_CONFIG / MTR_CONFIG_EXTRA
environment variable; --defaults-group-suffix overrides
MARIADB_GROUP_SUFFIX / MYSQL_GROUP_SUFFIX.

An explicitly named file (--defaults-file or $MTR_CONFIG) that does not
exist is an error, matching libmariadb; a missing file in the standard
search order is still skipped silently.

Order of execution in command_line_setup():

  1. get_defaults_options() runs first (before the main GetOptions). It
    consumes the MTR-only options (--no-defaults, --defaults-group-suffix,
    --print-defaults) out of @ARGV, and *peeks* --defaults-file /
    --defaults-extra-file off a copy of @ARGV so they stay in @ARGV for
    the second consumer.

  2. load_defaults() reads the [mtr] group from the selected files and
    prepends the resulting options into @ARGV, ahead of the
    ---end-of-config--- marker.

  3. My::Debugger::fix_options() adjusts optional-argument options.

  4. The main GetOptions(%options) parses everything - the config options
    (before the marker) and the command line (after it). Command-line
    options come later and therefore take precedence. --defaults-file is
    handed to collect_option for the template. Options still unrecognized
    afterwards are validated in a manual loop that uses the marker to
    report whether a bad option came from the config file or the command
    line.

Getopt::Long is configured "pass_through", so a parse leaves any option it
does not declare in @ARGV instead of erroring. Because pass_through is on,
step 1 skims off only the defaults options without touching the rest, and
step 4 does the real parse; neither errors on options it does not declare.
Aleksey Midenkov
MDEV-30281 MTR: speed up test collection by caching result-dir listings

collect_one_test_case() located each test's .result/.rdiff files with a
per-test glob:

  for (<{$resdirglob}/$tname*.{rdiff,result}>) { ... }

Because of the "$tname*" wildcard, glob had to opendir and read the whole
result directory on every call, and the "{rdiff,result}" brace made it do
so twice (once per extension).  Run once per test, this is O(tests *
dirsize) - the suite's result directory is re-read ~2x for every test in
the suite.  Profiling the collection of all default suites showed this
single line accounting for 8.3s of the 13.1s phase (63%), and the phase
issuing 408k stat() calls (339k of them ENOENT).

Read each result directory once instead, indexing its .result/.rdiff
files by base test name (the leading run of characters before the first
'.' or ','), and look a test's files up in that cache.  The "$tname*"
glob was only a coarse prefilter anyway - the existing regex
"^$tname((?:,combo)*)\.(rdiff|result)$" does the real matching - so
indexing by base name yields exactly the same candidate set.

Stats (collecting all default suites, 6548 tests, warm cache):

  collection time        13.1s  ->  4.5s  (~2.9x)
  directory-open syscalls  23026 ->  5284

The collected test list (result_file, base_result, skip and comment for
every test) is byte-for-byte identical before and after.
Sergei Petrunia
MDEV-39368: Add mtr --replay-server option to test Optimizer Context Replay

Make --replay-server clean up the environment on replay server:
drop created tables, views, etc.
Sergei Petrunia
MDEV-39368: Add mtr --replay-server option to test Optimizer Context Replay

Re-commit the entire feature as one patch.

KEEP THIS AFTER ALL OPTIMIZER CONTEXT REPLAY COMMITS.
Oleksandr Byelkin
MDEV-40173 RPM conflicts on /usr/lib64/security

The move of the install location of pam files in MDEV-37197
(34aac090f2acc1a4b5850810fe41370c19659d55) resulted in different
install locations on different RPM distros.

Correct the RPM packaging to ignore the path of the pam files
(but not the pam files themselves).
Aleksey Midenkov
MDEV-30281 MTR: add --strip-limits to omit the resource-limits table

On a crash the server writes a "Resource Limits" table (read from
/proc/self/limits) to its error log, which MTR echoes in the crash
report. Like the bug-reporting hints it is rarely useful when reading
these reports routinely.

Add --strip-limits (off by default). When given, the table is dropped
from the "Server log from this test" excerpt by strip_resource_limits().

Unlike a hint paragraph the table has no trailing blank line - it runs
straight into the next section ("Core pattern:", ...). So the filter
removes the opener line (matching both "Resource Limits:" and the newer
"Resource Limits (excludes unlimited resources):"), the
"Limit ... Soft Limit ..." header and the "Max ..." rows, and stops at
the first line that is neither, keeping the surrounding data.

This is independent of --strip-hints.
Aleksey Midenkov
MDEV-30281 MTR conf: report config file errors as file:line without croak

Make every wrong setting in a server config file fail with a
human-friendly message and no Perl stack trace or source-code line.

My::Config now treats parse errors as data errors instead of caller
bugs: each parse failure dies with a clean "file:line: reason" message
naming the config file and the offending line number, and without the
"at FILE line N." Perl location. This also delivers the file name and
line number that were previously missing. The internal misuse/invariant
assertions keep using croak, which is the right tool there.

load_defaults() (in mariadb-test-run.pl) catches that die and re-throws
it through mtr_error(), which flushes output, prints the uniform mtr
error format and exits in a controlled way. This replaces the earlier
fragile approach of stripping the location suffix off a croak with a
regexp.

mariadb-test-run.pl: validate the parallel option value before the
numeric comparison, so a non-numeric or negative value reports a clean
error instead of an "Argument isn't numeric" warning with a code line.
This path is shared with the command line, so it is fixed there too.
bsrikanth-mariadb
MDEV-40388: sequence.simple fails on replay

The problem is that, when recording is enabled for the query such as,
explain select * from seq_1_to_10;
it recorded the table context having a DDL definition as: -

CREATE TABLE `seq_1_to_10` (
    ->  `seq` bigint(20) unsigned NOT NULL,
    ->  PRIMARY KEY (`seq`)
    -> ) ENGINE=SEQUENCE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

Now, when that context is replayed, the DDL statement is executed.
But, we cannot create such a table, and instead it errors out saying
ERROR 1050 (42S01): Table 'seq_1_to_10' already exists.

Solution is to use: -
  CREATE TABLE IF NOT EXISTS seq_1_to_10 ...;

=====

Also, there is a different way to use sequences as: -
  Create sequence s1;
  Explain select * from s1;

Here, we should be recording the DDL statement, but no need to store the
stats for it. However, we didn't record the DDL statement earlier.
Moreover, sequence's next value should be the same in the replay environment.

Solution here is to record the DDL for such a sequence as
  CREATE TABLE IF NOT EXISTS s1 ...;
and also set its start value as the recorded environment's previous value using
  SELECT SETVAL(s1, prev_value);
Oleksandr Byelkin
New CC 3.4
Dave Gosselin
MDEV-40573:  Crash on multi-table DELETE with an impossible WHERE

A DELETE containing a single table, an index hint, an impossible WHERE
condition, and a window function will take the multi-delete code path
but never initialize tables for deletion, leading to a crash.  Such
a statement would never delete rows from the target table.  Record in the
multi_delete whether it was ever initialized for execution, and don't
attempt to delete anything if it wasn't initialized.

The index hint forces the single table DELETE to take the multi-table
codepath.  Since this case has an impossible WHERE condition, we set
subq_exit_fl which later causes JOIN::optimize_stage2 to skip the
multi-delete table initialization.  It's not safe to attempt
initialization when trying to find a "tableless" subquery plan, so
defend against this case with the new multi-delete flag added by
this commit.
Oleksandr Byelkin
MDEV-40173 RPM conflicts on /usr/lib64/security

The move of the install location of pam files in MDEV-37197
(34aac090f2acc1a4b5850810fe41370c19659d55) resulted in different
install locations on different RPM distros.

Correct the RPM packaging to ignore the path of the pam files
(but not the pam files themselves).
Sergei Petrunia
Code cleanup in JSON array-of-object reading, add unit tests.
bsrikanth-mariadb
MDEV-40383:innodb_gis.point_basic fails on replay

There are 2 problems: -
1. The REPLACE statement that is recorded doesn't store the
  value of geometry type field correctly.
2. The table definition that got recorded has fields with non-null constraint,
  and no default value is specified.
  Also, the "REPLACE INTO" statement that gets stored in the context,
  doesn't have any value specified for these non-null fields.

Solution is to: -
1. When using REPLACE INTO statement, store all the non-numeric values in HEX,
  whenever conversion from field's charset to output's charset is lossy.
2. Instead of storing only the column values that were projected in the
  query, store all the non-virtual column values into the recorded
  REPLACE INTO statement.

Implementation details: -
1. Introduce a new method is_charset_conversion_lossless() in filesort.cc,
  to check if the output charset to which field's data is being written to,
  results in a lossless conversion. If so, non-numeric values being witten
  using REPLACE INTO statement are stored in string representation,
  else they are converted to HEX.
2. From join_read_const(), and join_read_system() methods in sql_select.cc,
  re-read the const row for all the non-virtual fields in the table.
  After the row is re-read and recorded, restore the table->read_set,
  table->status, and the const row, to the value that was before.
Sergei Golubchik
MDEV-37781 post-fix

move ER_STACK_OVERRUN_NEED_MORE test together with the others.
And remove not_asan/msan/ubsan includes as the fix suggests

followup for 2be9ba2537aa
Georg Richter
Changed the error message back to avoid failing tests
Aleksey Midenkov
MDEV-30281 MTR: add --exec-rr / --exec-gdb to wrap every --exec

New debugger options run every mysqltest '--exec' command line under a
wrapper (rr record, or gdb --args in an xterm), so external tools invoked
by tests (myisampack, myisamchk, ...) can be traced or debugged without
naming them.

My::Debugger: each debugger with an 'exec' template gets an --exec-<dbg>
option auto-registered.  pre_setup() detects the requested one, runs its
one-time 'pre' hook, and exports MYSQLTEST_EXEC_WRAP (plus _RR_TRACE_DIR
for rr, and an xterm wrapper for terminal debuggers like gdb).

do_exec(): when MYSQLTEST_EXEC_WRAP is set it is injected into the command
line, after any leading shell NAME=VALUE assignments (quotes and
backslashes honoured), so the tool - not the assignment word - is what
gets wrapped.  The implicit /bin/sh -c that popen() supplies provides the
shell layer.
forkfun
MDEV-39566 fix status_by_thread crash on live thread-count change

PFS_table_context snapshots the live thread/user/host/account
count at scan start and again on restore (filesort's second
rnd_init). If the count changed between the two, m_map_size
mismatched and the server aborted.

Skip the wasted re-sample on restore, bound each table's scan by
the frozen snapshot instead of the container's live count.
Aleksey Midenkov
MDEV-30281 MTR: test --tail-log / --tail-warnings in suite/mtr

Run a child mariadb-test-run.pl on misc.crash (SIGSEGV) and misc.warn
(system-versioned SYSTEM_TIME LIMIT overflow) and check that the crash and
shutdown-warnings reports are trimmed by --head-log / --tail-log / --strip-log
and --tail-warnings.  Also exercise --list-combinations and --suite negation.

The child's volatile output (pids, timestamps, addresses, an unbounded
backtrace, ...) is reduced to a deterministic skeleton with include/grep.inc
and normalized with --replace_regex: the two anchor backtrace frames
(my_print_stacktrace, main) are kept while the variable middle frames and the
per-line values are cut down to "<...cut...>".  The test is gated behind
--big-test.
Aleksey Midenkov
MDEV-30281 MTR: add --exit-line to stop a test at a given line

--exit-line=N stops a test before the command at line N of the test
file, exactly as if an --exit directive were placed there.  Handy for
bisecting where a test starts to misbehave, and for debugging a test
without extracting a standalone test case: record the run under rr
(--rr), then reverse-replay from the end of the trace straight to the
SQL command of interest.

mariadb-test-run.pl gains --exit-line (-l) and forwards it to mysqltest.
The option is global: it applies to every test in the run, each stopping
at line N of its own test file (so N is per-file).  A test whose file has
fewer than N lines is unaffected and runs to completion.

mysqltest gains the --exit-line (-l) option: after reading each command,
if we are in the top-level test file (cur_file == file_stack) and the
command starts at or past the requested line, it aborts like Q_EXIT.
Gating to the main file keeps line numbers of sourced includes from
triggering it.

suite/mtr/feat exercises it by running a child mtr with --exit-line=5 on
main.1st (line 4 "show databases;", line 5 "show tables in mysql;"): the
run stops before line 5, so the recorded result's tables section is
missing and the test fails with a length mismatch - proving the exit
landed exactly at the requested line.  The child's whole output is kept
(no grep); volatile banner/footer lines are cut by prefix via $NORM_RUN.
Sergei Petrunia
MDEV-39368: Add mtr --replay-server option to test Optimizer Context Replay

Re-commit the entire feature as one patch.

KEEP THIS AFTER ALL OPTIMIZER CONTEXT REPLAY COMMITS.
Oleksandr Byelkin
new CC 3.3
Sergei Golubchik
MDEV-40571 insufficient validation of frm data when opening a table

numerous checks that the frm is valid, no OOB reads,
values make sense (number of keyparts not less than number of keys,
no keys means no keyparts, number of long unique fields is not larger than
number of fields, fields values in the record don't overlap and don't
go over record ends, and so on). most asserts were changed to if()'s.
Aleksey Midenkov
MDEV-30281 MTR: allow excluding suites with --suites=!NAME

Extend the --suite[s] option so a suite name prefixed with '!' excludes
that suite instead of adding it. This makes "run everything except X"
easy and lets a config-file suite list be trimmed on the command line.

Semantics:

  --suites=A,B        run suites A and B (as before)
  --suites=!A        run the default set minus A
  --suites=A,B,!B    run A (a '!' name is removed from the positive names)
  [mtr] suites=A,B
    + --suites=!B      run A (command-line exclusion trims the file set)

Rules:

  - If any plain (positive) names are given, they are the base set;
    otherwise the base is the default suite set.
  - Every '!'-prefixed name is then removed from the base.
  - Names accumulate across the [mtr] config file and the command line,
    so a '!' exclusion on the command line applies to the set configured
    in the file (see below).

To make the cross-source case work, --suites now accumulates its values
into @opt_suites instead of a last-wins scalar: the option handler pushes
each comma-separated value, so the [mtr] config file value and the
command-line value are both collected. The positive/negative resolution
then runs once in main(), producing the final suite list.

Exclusion matching ignores the "-<overlay>" suffix used in the default
list (e.g. "rpl-"), so --suites=!rpl removes "rpl-", and slashes are
preserved (--suites=!compat/oracle works).
Sergei Petrunia
Code cleanup in JSON array-of-object reading, add unit tests.
Aleksey Midenkov
MDEV-30281 MTR: add --combination-select to run one combination

Add --combination-select=N (short alias -c) to run only a single
combination from a .combinations file instead of every one.

N is the position of the combination in the file, counting the []
sections in file order:

  1  first combination      -1  last combination
  2  second combination    -2  last but one
  ...                        ...

So --combination-select=-1 runs only the last combination, -c 2 runs
the second one, etc. N must be a non-zero integer; 0, a non-integer, or
a value outside the range of a given file is an error.

The integer format is validated up front in command_line_setup(), so a
bad value is rejected even for tests that have no .combinations file. The
range and the selection itself are applied in combinations_from_file(),
which is the single point through which every .combinations file is read
(both the suite-level "combinations" file and per-test
"<test>.combinations"), so it always follows the [] section order of the
file. When a test draws combinations from more than one file, N selects
within each file.

It is ignored when --combination is given (that already replaces the
.combinations files with command-line combinations).
Daniel Black
MDEV-37224 Remove UBSAN limitation from MTR tests

There's no good reason why undefined behaviour is
acceptable in our codebase let alone having a test that
triggers this.

The thread_stack_basic test because of compulation
has a different stack size under UBSAN. With replace_results
we can include all values of the default stack size
in this test.

plugins.multiauth was added in 031f11717d9f before
CONC-730 and MDEV-31379 corrected the ref10 implementaiton.
Daniel Black
MDEV-39169 Replace deprecated network functions in resolveip (testfix)

Check there is a ipv4 mapped address.
Aleksey Midenkov
MDEV-30281 MTR: make the debugger terminal configurable

The terminal emulator for interactive debuggers (--gdb, --exec-gdb, ...)
was hard-coded to xterm.  It is now configurable via the --terminal
option or the MTR_TERM environment variable (the option takes
precedence).  The template understands two placeholders, {title} (window
title) and {command} (the debugger invocation, expanded as separate argv
words); the default "xterm -title {title} -e {command}" reproduces the
previous behaviour.

My::Debugger::term_argv() expands the template into an argv list for the
mysqld/client/boot debuggers; the same template drives the --exec-<dbg>
shell-string wrapper, where {command} must be last.

For example, debug the bootstrap server for main.1st under gdb in a
KDE Konsole window:

  mtr --boot-gdb --terminal='konsole -p tabtitle={title} -e {command}' main.1st
Daniel Black
MDEV-39803 RPM dependencies missing from MariaDB-server-galera package

RPM dependencies where not included in cpack build due to incorrect
component name.

Corrects a103be381b38

Becase the wsrep_info plugin installs as a plugin, it overrites the
cpack_rpm server-galera PACKAGE_DEPENDS.

As such make the cmake/plugin.cmake only set the PACKAGE_DEPENDS if
not already set.
Daniel Black
MDEV-39813 ST_GeomFromGeoJSON does not control recursion depth

Using stack_p wasn't a portable concept in 12.3 when JSON
parsing got unlimited depth. To let ST_GeomFromGeoJSON was
already a recursive function, needed because object order of "type"
may be after the "geometries", but with json_engine_t no longer
enforcing the depth, some stack checking was required.

Use the check_stack_depth function to allow excessively deep
GeoJSON objects to error.

As this is cleaned up the gis-json test can be enabled.

The exceeding stack depth is moved to lotofstack.test.
Aleksey Midenkov
MDEV-30281 MTR: fix --server-arg typo in embedded-server comments

Two comments in the embedded-server setup said "--sever-arg=" instead of
"--server-arg=" (the surrounding code uses the correct spelling). Comment
only; no behavior change. The typo is pre-existing (upstream), so it is
fixed here as a separate commit rather than folded into upstream history.
Aleksey Midenkov
MDEV-30281 MTR: add --strip-backtrace and the --strip-log alias

On a crash the server writes its own stack backtrace (my_print_stacktrace)
to the error log, which MTR echoes in the crash report. When a core file
is available the gdb/lldb backtrace from My::CoreDump is more useful, so
this server-side report is often just noise.

Add --strip-backtrace (off by default). When given, it is dropped from
the "Server log from this test" excerpt by strip_backtrace(). The
gdb/lldb backtrace from a core file is a separate thing and is not
affected.

strip_backtrace() treats the backtrace as a bounded block rather than
matching lines everywhere, so a line outside a backtrace that merely ends
in an [0x...] address is kept:

  - a "Thread pointer:" or "Attempting backtrace" line starts a block;
  - inside a block every recognisable backtrace line is dropped: the
    intro prose, the thread pointer, blank lines, a "stack_bottom" or
    "Stack range" header, frame lines (both "...[0x...]" symbol frames
    and the bare "0x..." addresses printed by the frame-pointer walker)
    and the interleaved addr2line / my_addr_resolve diagnostics;
  - the first line that is not recognisable backtrace content ends the
    block and is kept, so pass-through resumes and a later backtrace (or
    the rest of the log) survives.

Because anything unrecognised ends the block rather than being dropped, a
backtrace with no "stack_bottom" line and no bracketed frames - as the
frame-pointer-walker and aborted-backtrace builds produce - does not
swallow the remainder of the log.

Also add --strip-log, a convenience alias that turns on all three of
--strip-hints, --strip-limits and --strip-backtrace at once.

All stripping runs before the --head-log/--tail-log trimming, so those
line counts apply to the already-stripped log.
forkfun
Merge branch '13.0' into 'main'

check_grant_db(), mysqld_show_create_db(), get_schema_privileges_for_show(),
get_check_constraints_record(), and check_grant()'s any_combination_will_do
path (via get_all_tables()) still treated GRANT OPTION alone as a real
privilege, reintroduced by the MDEV-14443 DENY statement refactor. Same
fix as the original MDEV-37951 patch: exclude GRANT_ACL from the group
mask before testing "has any privilege".
Aleksey Midenkov
MDEV-30281 MTR: add --list-combinations to list a test's combinations

Add --list-combinations (alias --lc) which, for the specified test(s),
prints the available combinations in the selectable "test,combination"
form and exits without running anything.

For each collected test it prints a summary line followed by one line
per combination, e.g.:

  $ mtr --list-combinations versioning.foreign
  Combinations for versioning.foreign: timestamp,trx_id
  versioning.foreign,timestamp
  versioning.foreign,trx_id

Each printed line is exactly what you pass back to mtr to run that one
combination (it round-trips). When a test draws combinations from more
than one .combinations file (several dimensions), the lines list the
full product, e.g. "test,dim1_value,dim2_value".
Daniel Black
MDEV-32331: JSON path functions with no charset on path crash server

Across a range of JSON functions taking a path argument
there are SQL expressions that dont' have a character
set. If these expressions don't have a character set
fall back to the character set of the argument of the
json function that represent the document being operated
on. If this doesn't have a character set fall back to
my_charset_utf8mb4_bin.

This covers the 11.4 JSON_KEY_VALUE function also as it
reuses the Json_path_extractor::extract method.

Add nonnull and warn_unused_result to the json path
functions to facilitate compiler and UBSAN catching of the
problem early.

As null values of s_p are incompatible with report_path_error,
jump directly to a null return which is consistent with
the defination of the JSON sql funciton.
Daniel Black
MDEV-39803 RPM dependencies missing from MariaDB-server-galera package

RPM dependencies where not included in cpack build due to incorrect
component name.

Corrects a103be381b38

Becase the wsrep_info plugin installs as a plugin, it overrites the
cpack_rpm server-galera PACKAGE_DEPENDS.

As such make the cmake/plugin.cmake only set the PACKAGE_DEPENDS if
not already set.
Aleksey Midenkov
MDEV-30281 MTR conf: add --mtr-config-only (-M)

--mtr-config-only (-M) makes --defaults-file / --defaults-extra-file be
read for MTR's own [mtr] options only, without also being applied as the
server config template.

Normally those two options serve two consumers of the same file: the
[mtr] group configures MTR itself (load_defaults), while the remaining
groups - [mysqld]/[client]/... - become the test servers' config template
(collect_option). -M opts out of the second use: once load_defaults has
read [mtr], it removes --defaults-file / --defaults-extra-file from @ARGV,
so the main GetOptions/collect_option never turns them into a template.

The switch may be given on the command line, or set inside the [mtr]
section of the config file itself. In the latter case load_defaults
notices mtr-config-only while reading [mtr] and drops the file options on
the fly, so

    [mtr]
    mtr-config-only

turns any file passed via --defaults-file into an MTR-only config.

get_defaults_options() consumes -M out of @ARGV like the other MTR-only
defaults options; it is a directive, not passed through to GetOptions.

-M is only relevant for a command-line --defaults-file /
--defaults-extra-file (the dual-use options). The MTR_CONFIG /
MTR_CONFIG_EXTRA environment variables are read only for [mtr] and never
reach collect_option, so they are mtr-config-only already and -M is a no-op
for them.
Sergei Golubchik
MDEV-40571 insufficient validation of frm data when opening a table

numerous checks that the frm is valid, no OOB reads,
values make sense (number of keyparts not less than number of keys,
no keys means no keyparts, number of long unique fields is not larger than
number of fields, fields values in the record don't overlap and don't
go over record ends, and so on). most asserts were changed to if()'s.