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
Sergei Petrunia
MDEV-39382: Trace replay produces "Impossible WHERE noticed after reading const tables"

Constant table check in make_join_statistics() checks the value of
"table->file->stats.records", not table->used_stat_records. These
two values can be different.

So, make the Optimizer Context save and restore both values.
(used_stat_records was saved already, this patch also saves
table->file->stats.records).
Raghunandan Bhat
MDEV-39271: SIGSEGV in `check_word`|(`extract_date_time`|`extract_oracle_date_time`)

Problem:
  Date and time functions - `STR_TO_DATE` and `TO_DATE` (in Oracle mode)
  both use `check_word` to check if a string token matches a valid
  locale-specific day or month name. Server crashed because of an
  un-initialized typelib member(`type_lengths`) for date locales which
  are not present in `Oracle_date_locale` (e.g: `ar_DZ`).

Fix:
  Initialize `type_lengths` for all supported locales by iterating over
  `my_locales` array instead of `Oracle_date_locale` during server
  startup.
Sergei Petrunia
MDEV-37732: TPROC-H, Query 21 is much slower in 11.4 than in 10.11

The problem was in Duplicate_weedout_picker::check_qep(). It computes
"outer fanout" - number of record combinations left after the strategy
removes the subquery's duplicates. The logic was incorrect. For example:

  select * from t1 where t1.col1 in (select col2 from t2 where corr_cond)

  and the join order of
    t2, full scan rows=1M
    t1, ref access on t1.col1=t2.col2, rows=10

(call this EXAMPLE-1) it would conclude that outer_fanout=10, based
on t1.access_method_rows=10.

Rewrote the "outer fanout" computation logic to use two approaches:

1. Pre-compute subquery's output cardinality, then check how many
  duplicate rows are expected in its output. This gives "subquery
  fanout" which we can use as expected number of duplicates.
  For example, for
    ... IN (SELECT o_customer FROM orders WHERE ...)
  the subquery fanout is average number of orders per one customer.
  In EXAMPLE-1, outer_fanout= (1M * 10) / subquery_fanout.

2. Given a join prefix of inner and outer tables, compute outer tables'
  fanout by ignoring all inner tables.
  If access to an outer table depends on an inner table, use outer
  table's "found records".
  For example, for
    select * from small_table WHERE col IN (SELECT * FROM big_table)
  and a join order of
    big_table, small_table
  we will use small_table->found_records as an estimate of how many
  matches there can be.
  In EXAMPLE-1: outer_fanout=t2.found_records=#records(t2).

Both approaches can give poor estimates in different cases, so we pick
the best one.

The fix is controlled by @@new_mode='FIX_SEMIJOIN_DUPS_WEEDOUT_CHECK'
and is OFF by default in this patch.
Daniel Black
MDEV-34902: debian-start erroneously reports issues

Remove the complexity of check_for_crashed_tables
by removing it all together. When check_for_crashed_tables
was written there was a desire to recover MyISAM tables.

With Aria being default from 10.4 for system tables,
and all non-MyISAM engines being able to do crash
recovery there isn't the need to autocheck as part
of a system service.

With check_for_crashed_tables removed there is no need
for a mailx package recommendation.
Kristian Nielsen
MDEV-39277: Performance regression in 12.3.0 when using legacy binlog

The flags trx->active_commit_ordered and trx->active_prepare got cleared in
trx_init() during the fast part of commit (ie. commit_ordered()). This is
too early, then the values are lost when processing reaches
trx_commit_complete_for_mysql(). This caused the MDEV-232 optimization to be
omitted, adding an extra fsync() at the end of commit when using the legacy
binlog and causing severe performance regression.

The values of trx->active_commit_ordered and trx->active_prepare must
persist to the end of commit procesing, same as trx->is_registered. This is
done in this patch, active_commit_ordered and active_prepare are cleared in
trx_deregister_from_2pc() together with trx->is_registered in
trx_deregister_from_2pc(), and asserted to be cleared when
trx->is_registered is set for a following transaction.

Signed-off-by: Kristian Nielsen <[email protected]>
Thirunarayanan Balathandayuthapani
- Allow purge thread to initialize the autoincrement value.
Sergei Petrunia
MDEV-37732: TPROC-H, Query 21 is much slower in 11.4 than in 10.11

The problem was in Duplicate_weedout_picker::check_qep(). It computes
"outer fanout" - number of record combinations left after the strategy
removes the subquery's duplicates. The logic was incorrect. For example:

  select * from t1 where t1.col1 in (select col2 from t2 where corr_cond)

  and the join order of
    t2, full scan rows=1M
    t1, ref access on t1.col1=t2.col2, rows=10

(call this EXAMPLE-1) it would conclude that outer_fanout=10, based
on t1.access_method_rows=10.

Rewrote the "outer fanout" computation logic to use two approaches:

1. Pre-compute subquery's output cardinality, then check how many
  duplicate rows are expected in its output. This gives "subquery
  fanout" which we can use as expected number of duplicates.
  For example, for
    ... IN (SELECT o_customer FROM orders WHERE ...)
  the subquery fanout is average number of orders per one customer.
  In EXAMPLE-1, outer_fanout= (1M * 10) / subquery_fanout,
    subquery_fanout=#rows(t2) / n_distinct(t2.col2)

2. Given a join prefix of inner and outer tables, compute outer tables'
  fanout by ignoring all inner tables.
  If access to an outer table depends on an inner table, use outer
  table's "found records".
  For example, for
    select * from small_table WHERE col IN (SELECT * FROM big_table)
  and a join order of
    big_table, small_table
  we will use small_table->found_records as an estimate of how many
  matches there can be.
  In EXAMPLE-1: outer_fanout=t1.found_records=#records(t1).

Both approaches can give poor estimates in different cases, so we pick
the best one.

The fix is controlled by @@new_mode='FIX_SEMIJOIN_DUPS_WEEDOUT_CHECK'
and is OFF by default in this patch.
Sergei Petrunia
MDEV-37732: TPROC-H, Query 21 is much slower in 11.4 than in 10.11

The problem was in Duplicate_weedout_picker::check_qep(). It computes
"outer fanout" - number of record combinations left after the strategy
removes the subquery's duplicates. The logic was incorrect. For example:

  select * from t1 where t1.col1 in (select col2 from t2 where corr_cond)

  and the join order of
    t2, full scan rows=1M
    t1, ref access on t1.col1=t2.col2, rows=10

(call this EXAMPLE-1) it would conclude that outer_fanout=10, based
on t1.access_method_rows=10.

Rewrote the "outer fanout" computation logic to use two approaches:

1. Pre-compute subquery's output cardinality, then check how many
  duplicate rows are expected in its output. This gives "subquery
  fanout" which we can use as expected number of duplicates.
  For example, for
    ... IN (SELECT o_customer FROM orders WHERE ...)
  the subquery fanout is average number of orders per one customer.
  In EXAMPLE-1, outer_fanout= (1M * 10) / subquery_fanout.

2. Given a join prefix of inner and outer tables, compute outer tables'
  fanout by ignoring all inner tables.
  If access to an outer table depends on an inner table, use outer
  table's "found records".
  For example, for
    select * from small_table WHERE col IN (SELECT * FROM big_table)
  and a join order of
    big_table, small_table
  we will use small_table->found_records as an estimate of how many
  matches there can be.
  In EXAMPLE-1: outer_fanout=t2.found_records=#records(t2).

Both approaches can give poor estimates in different cases, so we pick
the best one.

The fix is controlled by @@new_mode='FIX_SEMIJOIN_DUPS_WEEDOUT_CHECK'
and is OFF by default in this patch.
Vladislav Vaintroub
Fix merge

New [ERROR] entries can now appear in error log, when dropping a
a non-existent event.
Sergei Petrunia
MDEV-39368: Print warnings for replay EXPLAINs.
SAY-5
fix occured typo in func_str.test

Signed-off-by: SAY-5 <[email protected]>
Sergei Petrunia
MDEV-39368: Do not try to replay EXPLAIN FOR CONNECTION
Raghunandan Bhat
MDEV-34951: InnoDB index corruption when renaming key name with same letter to upper case.

Problem:
  InnoDB index corruption occurs when an index is renamed to a name that
  differs only in case (e.g., 'b' to 'B'). The SQL layer uses
  case-insensitive comparison and fails to recognize the change.

Fix:
  Use case-sensitive comparison when matching index names during
  ALTER TABLE to correctly identify and handle case changes.
Marko Mäkelä
MDEV-39263 innodb_snapshot_isolation fails to prevent lost updates under contention

lock_clust_rec_read_check_and_lock(): Refine the check whether
the transaction that last modified the record is still active.
The only thing that should matter is whether we are allowed to see
the record. If the implicit lock holder transaction was active and
we succeeded in acquiring the lock, this means that the transaction
had been committed. We must return DB_RECORD_CHANGED (ER_CHECKREAD)
in that case. We want to avoid returning it before the lock wait,
in case the other transaction will be rolled back.

Thanks to Vadim Tkachenko of Percona for reporting this bug,
as well as Kyle Kingsbury for the broader testing that led to this
finding. Vadim's test case was simplified by me and the root cause
analyzed with https://rr-project.org and an additional patch that
added std::this_thread::yield() at the start of
trx_t::commit_persist(). An even better spot should have been
right after the call to trx_t::commit_state().

The addition to the test innodb.lock_isolation is based on the work
by Teemu Ollakka, which was essential for refining this fix.

Reviewed by: Thirunarayanan Balathandayuthapani
Marko Mäkelä
MDEV-39162: Remove innodb_log_file_size limit for innodb_log_archive

Let us reserve 8 bytes per checkpoint, so that we can
support the full 64-bit innodb_log_file_size.
Marko Mäkelä
Merge 12.3
Oleksandr Byelkin
MDEV-39389 Memory leaks in _db_set_init

Handle forgotten case of resetting parameters
(free command_line before assigning a new one).
Alexey Botchkov
MDEV-39210 ExtractValue/UpdateXML crash.

XML parser fixed to handle <! and <? correctly.
Marko Mäkelä
fixup! 72fe787ef57e02f53addbf078cf69ebdbd68fc84
Vladislav Vaintroub
Merge branch '11.8' into 12.3
SAY-5
fix occured typo in handler.cc

Signed-off-by: SAY-5 <[email protected]>
Sergei Petrunia
MDEV-37732, post-fix: when computing cardinalities, don't use found_records.

JOIN_TAB::found_records is "number of records to be scanned by the best
access method".
What we're actually interested in is the "number of matching records
in this table".
For this, table->cond_selectivity * table->stat_records() is a tighter
bound.
Alexey Botchkov
MDEV-15479 Empty string is erroneously allowed as a GEOMETRY column value.

Empty string disallowed.
Daniel Black
MDEV-30953: Add MariaDB-server-galera (RPM) fix

The wsrep SST scripts weren't part of the server-galera
component so CPack didn't put them in the MariaDB-server-galera
package.

The previous existing per file component wasn't used so this
was simplified.
Sergei Golubchik
MDEV-39404 Gtid_log_event crash

validate xid.gtrid_length and xid.bqual_length just like XID_EVENT does
Marko Mäkelä
fixup! 8f402eb43a0c8b7997b3830016c84e3fc1f8b7ed
Thirunarayanan Balathandayuthapani
MDEV-39261 MariaDB crash on startup in presence of indexed virtual columns

Problem:
========
Purge threads computing virtual columns could crash due to:
1. Stale TABLE* pointers when tables are flushed/rebuilt during purge
2. open_purge_table() called close_thread_tables() on failure, making
MDL tickets invalid before purge could release them
3. Purge coordinator opened TABLE* but workers accessed it with wrong
TABLE->in_use
4. No retry mechanism when open_purge_table() failed due to concurrent
FLUSH TABLES, BACKUP STAGE, or ALTER TABLE operations

Solution:
========
1. Removed close_thread_tables() from open_purge_table(). Purge
coordinator thread should close explicitly in close_and_reopen()

2. Added retry logic: when open_purge_table() returns NULL due to
table flush/rebuild, set must_wait() flag and retry in
close_and_reopen()

3. Introduced Table_in_use_guard RAII class to temporarily switch
TABLE->in_use from coordinator thread to worker thread during virtual
column computation.
Alexey Botchkov
MDEV-39210 ExtractValue/UpdateXML crash.

test and a comment fixed.
Alexandru Diaconu
MDEV-38792: TO_DATE: Inconsistent treatment of separators

Before this fix, TO_DATE() returned NULL when the date string
contained extra non-alphanumeric separators that were not present
in the format string. For example:

  TO_DATE('2002 - AD', 'YYYY AD')  -- returned NULL
  TO_DATE('2024---01---01', 'YYYYMMDD')  -- returned NULL

Oracle handles these cases flexibly by ignoring extra separators.

Fix: skip non-alphanumeric separators in the date string before
matching each format token. A '-' or '+' sign is preserved when
the format is SYYYY, to allow signed year parsing.

Reported-by: Elena Stepanova <[email protected]>
Signed-off-by: Alexandru Diaconu <[email protected]>
Sergei Petrunia
Remove garbage comment
Dave Gosselin
MDEV-32290: Server crashes in sub_select_cache

A query inside UNION marked uncacheable could crash during a
subsequent execution on an assertion in sub_select_cache (like when a
derived table is materialized again inside a recursive CTE) or in
join_read_first because the cleanup at the end of one execution freed
state the next execution relies on.

The cleanup decision in JOIN::join_free looked only at an individual
SELECT_LEX's uncacheable flag.  That flag does not propagate down from
the enclosing unit to sibling branches, so a UNION "branch" would be
cleaned up as if it were the only query even when the containing UNION
is certain to run it again.  Change the cleanup check to Consider the
unit's uncacheable flag (and not only the SELECT_LEX's) to keep
preserve state required on subsequent executions.
Marko Mäkelä
Fix GCC-16 -Wmaybe-uninitialized
Daniel Black
MDEV-37197 RPM: Install PAM modules and systemd units in /usr/lib (not /lib)

Since Fedora 17 and about 2012, the directory
/lib{,64} has been a symlink to /usr/lib{,64}.

This has been verified on RHEL8, 9, 10, Fedora
, OpenEuler.

SLES1507, OpenSUSE 1506 and earlier (there is no
OpenSUSE 1507) had the old location for pam but
since their 1600 version they are now standardised.

References:
- https://fedoraproject.org/wiki/Features/UsrMove
- https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/
Sergei Petrunia
MDEV-37732: TPROC-H, Query 21 is much slower in 11.4 than in 10.11

The problem was in Duplicate_weedout_picker::check_qep(). It computes
"outer fanout" - number of record combinations left after the strategy
removes the subquery's duplicates. The logic was incorrect. For example:

  select * from t1 where t1.col1 in (select col2 from t2 where corr_cond)

  and the join order of
    t2, full scan rows=1M
    t1, ref access on t1.col1=t2.col2, rows=10

(call this EXAMPLE-1) it would conclude that outer_fanout=10, based
on t1.access_method_rows=10.

Rewrote the "outer fanout" computation logic to use two approaches:

1. Pre-compute subquery's output cardinality, then check how many
  duplicate rows are expected in its output. This gives "subquery
  fanout" which we can use as expected number of duplicates.
  For example, for
    ... IN (SELECT o_customer FROM orders WHERE ...)
  the subquery fanout is average number of orders per one customer.
  In EXAMPLE-1, outer_fanout= (1M * 10) / subquery_fanout,
    subquery_fanout=#rows(t2) / n_distinct(t2.col2)
  When n_distinct is not known, subquery_fanout=1.

2. Given a join prefix of inner and outer tables, compute outer tables'
  fanout by ignoring all inner tables.
  If access to an outer table depends on an inner table, use outer
  table's "found records".
  For example, for
    select * from small_table WHERE col IN (SELECT * FROM big_table)
  and a join order of
    big_table, small_table
  we will use small_table->found_records as an estimate of how many
  matches there can be.
  In EXAMPLE-1: outer_fanout=t1.found_records=#records(t1).

Both approaches can give poor estimates in different cases, so we pick
the best one.

The fix is controlled by @@new_mode='FIX_SEMIJOIN_DUPS_WEEDOUT_CHECK'
and is OFF by default in this patch.
SAY-5
fix occured typo in sql_path.h

Signed-off-by: SAY-5 <[email protected]>
Daniel Black
MDEV-39292 Debian build compiles Columnstore aarch64

But doesn't package it. The devel-6 branch of columnstore
is in a low maintaince state. We can't readd aarch64.

To prevent our CI resources building aarch64 columnstore
on the 10.6 and 10.11 branches we adjust our autobake-deb.sh
to keep the disable there.

The version check to 10 is so that when this is merged to
11.4 it becomes no longer impacting.
Sergei Golubchik
CONC-819 mysql_real_escape_string incorrectly handles big5

use (uchar) cast for big5, just like for any other charset.

also, fix gbk unit test to use the full test string length
Otto Kekäläinen
MDEV-37197 Deb: Install PAM modules and systemd units in /usr/lib (not /lib)

Since Fedora 17 and about 2012, the directory /lib has been a symlink to
/usr/lib. Debian started a similar migration in 2019. Nowadays all major
Linux distributions have a merged /usr, and the canonical location for
files should be /usr/lib instead of just /lib.

The location of PAM modules and systemd files is the last remaining
`*_DEB` variables should fully complete the usr merge migration.

Additionally re-applied `debputy reformat --style=black` to get files
sorted in a standardized order.

References:
- https://fedoraproject.org/wiki/Features/UsrMove
- https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.en.html#a-merged-usr-is-now-required
- https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/
Alexey Yurchenko
MDEV-38787 wsrep_slave_fk_checks=OFF results in inconsistency
Since ATM wsrep does not replicate any cascaded changes (because they are
not binlogged in the upstream code) we have to rely on foreign checks on
replicas to reproduce the cascade. Thus setting wsrep_slave_fk_checks=OFF
will result in inconsistency in any setup where there are cascading relations.
Mark this option as deprecated and make it a NOOP.
Aleksey Midenkov
MDEV-36362 MariaDB crashes when parsing fuzzer generated PARTITION

Function calls in INTERVAL expression of DDL have little
sense. SETVAL() fails because sequences require opened tables and
vers_set_interval() is called at earlier stage.

The fix throws ER_SUBQUERIES_NOT_SUPPORTED for sequence functions
SETVAL(), NEXTVAL(), LASTVAL() when the context does not allow
subselect (determined by clause_that_disallows_subselect).