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
Michal Schorm
MDEV-5479 Prevent stealing Unix socket of running instance

When mysqld starts up and the configured Unix socket path is
already in use by another process, network_init()
unconditionally unlink()s the active socket file. This
silently breaks the other process's ability to accept local
connections. The typical scenario is two MariaDB instances
configured with the same socket path but different TCP ports,
but any process listening on that path is affected.

Root cause: the call (void) unlink(mysqld_unix_port) in
network_init() removes an existing socket file without
checking whether another process is actively listening on it.
Notably, the bind() error handler immediately following the
unlink already warns about another running server -- but this
message could never trigger because the unconditional
unlink() removed the socket before bind() had a chance to
fail.

Fix: add unlink_socket_or_abort() that, before unlinking an
existing socket file, attempts to connect() to it:
- If socket() fails, abort startup (system resource issue).
- If connect() succeeds, another process is actively using
  the socket. Abort startup with an error message.
- If connect() fails with ECONNREFUSED or ENOENT, the
  socket is stale from a previous unclean shutdown. Proceed
  with unlink() as before.
- Any other connect() errno aborts startup to fail safe.
- If the file exists but is not a socket (S_ISSOCK check),
  remove it to preserve previous behavior.

connect() was chosen over flock()-based advisory locking
because flock() requires managing a separate lock file
alongside the socket (creation, cleanup, and handling of
orphaned lock files), and does not work reliably on network
filesystems. connect() probes the socket directly with no
extra files and no NFS dependency. This is the same approach
PostgreSQL uses for socket conflict prevention.

Co-Authored-By: Claude AI <[email protected]>
Monty
Introduce Field_blob_key for handling keys on blobs for temporary tables

Field_blob_key is a new blob variant stored as [4-byte
length][data pointer] that can be used as a sort/distinct key in
optimizer temporary tables. Previously, plain Field_blob was used in
GROUP_CONCAT and UNION DISTINCT contexts, which could not be
properly compared as a key.

Field_blob_key allows removing of blob key re-packing in heap
introduced by HEAP GROUP BY / DISTINCT on TEXT/BLOB columns

Implementation:

Pass a new Tmp_field_param argument through all make_new_field() and
create_tmp_field() overrides so that field creation can know whether
the resulting field will be part of a unique/distinct key. This
partly replaces the earlier overloading of TABLE::group_concat.

Other things:
- Fix Field_blob_compressed::make_new_field() to correctly handle two
  distinct cases:
  - When part of a unique/distinct key: substitute with Field_blob_key so
  key comparisons work correctly.
  - When placed in any optimizer tmp table (e.g. GROUP_CONCAT with ORDER
  BY): substitute with a plain uncompressed Field_blob, fixing wrong
  results caused by the compressed field's internal value buffer being
  overwritten across rows.
- Fix UNIQUE_KEY_FLAG in the client protocol so it is also set for
  columns that are part of a UNION DISTINCT, not only for columns from
  unique indexes.
- Mark internal temporary tables created by create_tmp_table /
  Create_tmp_table with type RESULT_TMP_TABLE instead of
  INTERNAL_TMP_TABLE. This makes it easier to differentiate between
  temporary tables created as placeholder for normal tables, like
  in CREATE .. SELECT and ALTER TABLE, derived tables.
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]>
Sergei Golubchik
MDEV-39131 Wrong Results in Identical Queries Involving Grouping and Bitwise NOT (~)

Item_copy_string::val_int() should take into account item's
unsignedness
Alexandru Diaconu
MDEV-38853 Guard VALIDITY_ASSERT in Json_writer for NDEBUG builds

Guard VALIDITY_ASSERT in Json_writer::add_unquoted_str() and
Json_writer::add_str() with !defined(NDEBUG) || defined(JSON_WRITER_UNIT_TEST)
to avoid references to debug-only symbols in release builds.

Reported-by: Bjarne D Mathiesen
Original-patch-by: Bjarne D Mathiesen
(from JIRA / MacPorts PR28680).
Raghunandan Bhat
MDEV-39356: Server crashes when executing `UPDATE ... FOR PORTION OF` with a normal table

Problem:
  Executing an `UPDATE ... FOR PORTION OF` statement on a table without
  a defined period results in assertion failure. The code in
  `SELECT_LEX::period_setup_conds` attempts to compare a NULL
  period name identifier using `streq()`, which triggers the assertion
  in `strnncoll` funtion.

Fix:
  Replace `streq` with `streq_safe` in `SELECT_LEX::period_setup_conds`
  to handle NULL pointers safely via an early-exit.
Daniel Black
MDEV-38771 RPM conflicts between MariaDB-common and mysql-common

mysql-common and MariaDB-common don't install the same files.
mysql-common (in MySQL 8.0) installs character set files
(/usr/share/mysql/charsets/*) and /usr/lib64/mysql (directory only).

MariaDB common installs character set files in /usr/share/mariadb
and the same /usr/lib64/mysql directory along with client plugins
in /usr/lib64/mysql/plugin. The RPM rules of conflict
only will cause troubles on directories if they are installed with
different metatadata (selinux, ownership, permissions) which isn't
the case.

As the character sets are at a different location MariaDB-common
isn't obsoleting mysql-common in a way that provides compatibilty
with mysql-common, for mysql-libs or otherwise, so its just creating
an install conflict.

Users installing perl-DBD-MySQL notice this because its mysql-libs
dependency pulls mysql-common, which conflicts with MariaDB-common.

We correct by removing the conflict and the provides of MariaDB-common
with resepect to mysql-common.
Sergei Golubchik
MDEV-39112 The query returns incorrect results when using LPAD

LPAD was modifying its first argument, even if it was a const string
Monty
Removed duplicate versions of Field::row_pack_length()
Monty
Introduce Field_blob_key for handling keys on blobs for temporary tables

Field_blob_key is a new blob variant stored as [4-byte
length][data pointer] that can be used as a sort/distinct key in
optimizer temporary tables. Previously, plain Field_blob was used in
GROUP_CONCAT and UNION DISTINCT contexts, which could not be
properly compared as a key.

Field_blob_key allows removing of blob key re-packing in heap
introduced by HEAP GROUP BY / DISTINCT on TEXT/BLOB columns

Implementation:

Pass a new Tmp_field_param argument through all make_new_field() and
create_tmp_field() overrides so that field creation can know whether
the resulting field will be part of a unique/distinct key. This
partly replaces the earlier overloading of TABLE::group_concat.

Other things:
- Fix Field_blob_compressed::make_new_field() to correctly handle two
  distinct cases:
  - When part of a unique/distinct key: substitute with Field_blob_key so
  key comparisons work correctly.
  - When placed in any optimizer tmp table (e.g. GROUP_CONCAT with ORDER
  BY): substitute with a plain uncompressed Field_blob, fixing wrong
  results caused by the compressed field's internal value buffer being
  overwritten across rows.
- Fix UNIQUE_KEY_FLAG in the client protocol so it is also set for
  columns that are part of a UNION DISTINCT, not only for columns from
  unique indexes.
- Mark internal temporary tables created by create_tmp_table /
  Create_tmp_table with type RESULT_TMP_TABLE instead of
  INTERNAL_TMP_TABLE. This makes it easier to differentiate between
  temporary tables created as placeholder for normal tables, like
  in CREATE .. SELECT and ALTER TABLE, derived tables.
Monty
Removed duplicate versions of Field::row_pack_length()
Sergei Golubchik
MDEV-39154 wrong OOM handling in collect_grouping_fields()

correct (and document) the return values for collect_grouping_fields()
Sergei Golubchik
MDEV-17256 Decimal field multiplication bug

Fix multiplication correctly - by truncating long factors before
multiplication. Not both equally, but in a way that minimizes the
error.

Add more multiplication tests to verify that now multiplication
works correctly.
Sergei Golubchik
MDEV-39111 The query returns an incorrect value when using LPAD and REPLACE

REPLACE() tries to modify its first argument in-place, provided it's
not a constant (like in REPLACE("foo", "bar"))

When the first argument was Item_cache_str, it was not marked as
a constant, thus REPLACE modified it in-place, and result of the
previous row leaked into the next one.
Sergei Golubchik
MDEV-39154 wrong OOM handling in collect_grouping_fields()

correct (and document) the return values for collect_grouping_fields()
Marko Mäkelä
Try to avoid a sharing violation on Windows
Monty
Fixed that Field_blob_compressed can be used in internal temporary tables

group_concat need special code in store() for storing the result
in table->blob_storage. This was implemented in Field_blob::store()
but not in Field_blob_compressed::store. This was temporarly solved
by not using Field_blob_compressed table->s->is_optimizer_tmp_table()
would be set. This this however disable Field_blob_compressed for
temporary tables that did not need a key for the blob field.

Fixed by ensuring that Field_blob::store and Field_blob_compressed::store
handles group_concat identically. As this handling is only done for
internal temporary tables, we store the data uncompressed for faster
usage by group_concat()
Sergei Golubchik
cleanup: make_dist.cmake.in

remove broken code duplication that
* explicitly listed every submodule that had its own submodules
* blindly executed `${GIT_EXECUTABLE}` after every `(SET GIT_EXECUTABLE)`
Alexey Botchkov
MDEV-39210 ExtractValue/UpdateXML crash.

XML parser fixed to handle <! and <? correctly.
Tony Chen
MDEV-34210 Improve auto-inc upgrade check message

In commit 0381921e, logic was added to fix bogus values of PAGE_ROOT_AUTO_INC
when upgrading from MySQL or versions of MariaDB < 10.2.10. As part of this
change, if a table's frm version was less than 10.2.10 and the server was in a
read-only state (preventing the frm version from being updated), a message was
introduced during the execution of CHECK TABLE FOR UPGRADE informing users that
the auto_increment check would be performed on each open of the table.

However, this message didn't mention the fact that the server being in a
read-only state would prevent the frm version from being updated thus causing
confusion as the message would not go away even after running CHECK TABLE FOR
UPGRADE.

The message is now improved for clarity.

Additionally, we remove a redundant check in ha_innobase::check. A small
simplification is made to ha_innobase::check() by removing redundant checks for
`check_for_upgrade()` and handler_flags.  ha_innobase::handler_flags is only
set by `check_for_upgrade()`.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
Monty
Fixed that Field_blob_compressed can be used in internal temporary tables

group_concat need special code in store() for storing the result
in table->blob_storage. This was implemented in Field_blob::store()
but not in Field_blob_compressed::store. This was temporarly solved
by not using Field_blob_compressed table->s->is_optimizer_tmp_table()
would be set. This this however disable Field_blob_compressed for
temporary tables that did not need a key for the blob field.

Fixed by ensuring that Field_blob::store and Field_blob_compressed::store
handles group_concat identically. As this handling is only done for
internal temporary tables, we store the data uncompressed for faster
usage by group_concat()
Sergei Golubchik
MDEV-23507 Wrong duplicate key value printed in ER_DUP_ENTRY

repair_by_sort() does not use table->record[0]
but print_keydup_error() expects to see the conflicting row there.
Sergei Golubchik
MDEV-30255 0 changed to 0.0 caused by DISTINCT and UNION ALL

Revert "MDEV-17256 Decimal field multiplication bug." (57898316b6fb)

It removes zero truncation from decimal_mul() and fixes
reported symptoms.

But reintroduces multiplication bug.
Sergei Golubchik
MDEV-39111 The query returns an incorrect value when using LPAD and REPLACE

REPLACE() tries to modify its first argument in-place, provided it's
not a constant (like in REPLACE("foo", "bar"))

When the first argument was Item_cache_str, it was not marked as
a constant, thus REPLACE modified it in-place, and result of the
previous row leaked into the next one.
Sergei Golubchik
MDEV-39112 The query returns incorrect results when using LPAD

LPAD was modifying its first argument, even if it was a const string
Sergei Golubchik
MDEV-39292 Debian build compiles Columnstore aarch64

only enable ColumnStore for architectures it supports
PranavKTiwari
MDEV-39245- Added different test cases to validate the non-ascii changes.
Alexey Botchkov
MDEV-39210 ExtractValue/UpdateXML crash.

XML parser fixed to handle <! and <? correctly.
Monty
Fixed that Field_blob_compressed can be used in internal temporary tables

group_concat need special code in store() for storing the result
in table->blob_storage. This was implemented in Field_blob::store()
but not in Field_blob_compressed::store. This was temporarly solved
by not using Field_blob_compressed table->s->is_optimizer_tmp_table()
would be set. This this however disable Field_blob_compressed for
temporary tables that did not need a key for the blob field.

Fixed by ensuring that Field_blob::store and Field_blob_compressed::store
handles group_concat identically. As this handling is only done for
internal temporary tables, we store the data uncompressed for faster
usage by group_concat()
Ahmad
MDEV-35821: Add vector index size to INDEX_LENGTH in SHOW TABLE STATUS

Vector indexes are stored in a separate internal table (hlindex).
The main table's storage engine knows nothing about it, INDEX_LENGTH
was always reported as 0 for tables with vector indexes.

the fix: after calling info() on the main table handler in sql_show.cc,
check if the table has an hlindex, open it if needed, and add its data_file_length to
index_file_length before writing to the information schema record.
Alexey Botchkov
MDEV-39210 ExtractValue/UpdateXML crash.

XML parser fixed to handle <! and <? correctly.
Sergei Golubchik
MDEV-23507 Wrong duplicate key value printed in ER_DUP_ENTRY

repair_by_sort() does not use table->record[0]
but print_keydup_error() expects to see the conflicting row there.
Sergei Golubchik
MDEV-30255 0 changed to 0.0 caused by DISTINCT and UNION ALL

Revert "MDEV-17256 Decimal field multiplication bug." (57898316b6fb)

It removes zero truncation from decimal_mul() and fixes
reported symptoms.

But reintroduces multiplication bug.
Monty
Removed duplicate versions of Field::row_pack_length()
Sergei Golubchik
MDEV-30255 0 changed to 0.0 caused by DISTINCT and UNION ALL

Revert "MDEV-17256 Decimal field multiplication bug" (57898316b6fb)
This removes zero truncation from decimal_mul() and fixes
the reported symptom.

Fix multiplication correctly - by truncating long factors before
multiplication. Not both equally, but in a way that minimizes the
error.

Add more multiplication tests to verify that now multiplication
works correctly.
Sergei Golubchik
cleanup: make_dist.cmake.in

remove broken code duplication that
* explicitly listed every submodule with listed submodules
* blidnly executed `${GIT_EXECUTABLE}` after every `(SET GIT_EXECUTABLE)`
Monty
Introduce Field_blob_key for handling keys on blobs for temporary tables

Field_blob_key is a new blob variant stored as [4-byte
length][data pointer] that can be used as a sort/distinct key in
optimizer temporary tables. Previously, plain Field_blob was used in
GROUP_CONCAT and UNION DISTINCT contexts, which could not be
properly compared as a key.

Field_blob_key allows removing of blob key re-packing in heap
introduced by HEAP GROUP BY / DISTINCT on TEXT/BLOB columns

Implementation:

Pass a new Tmp_field_param argument through all make_new_field() and
create_tmp_field() overrides so that field creation can know whether
the resulting field will be part of a unique/distinct key. This
partly replaces the earlier overloading of TABLE::group_concat.

Other things:
- Fix Field_blob_compressed::make_new_field() to correctly handle two
  distinct cases:
  - When part of a unique/distinct key: substitute with Field_blob_key so
  key comparisons work correctly.
  - When placed in any optimizer tmp table (e.g. GROUP_CONCAT with ORDER
  BY): substitute with a plain uncompressed Field_blob, fixing wrong
  results caused by the compressed field's internal value buffer being
  overwritten across rows.
- Fix UNIQUE_KEY_FLAG in the client protocol so it is also set for
  columns that are part of a UNION DISTINCT, not only for columns from
  unique indexes.
- Mark internal temporary tables created by create_tmp_table /
  Create_tmp_table with type RESULT_TMP_TABLE instead of
  INTERNAL_TMP_TABLE. This makes it easier to differentiate between
  temporary tables created as placeholder for normal tables, like
  in CREATE .. SELECT and ALTER TABLE, derived tables.
Sergei Golubchik
MDEV-17256 Decimal field multiplication bug

Fix multiplication correctly - by truncating long factors before
multiplication. Not both equally, but in a way that minimizes the
error.

Add more multiplication tests to verify that now multiplication
works correctly.
Sergei Golubchik
MDEV-39131 Wrong Results in Identical Queries Involving Grouping and Bitwise NOT (~)

Item_copy_string::val_int() should take into account item's
unsignedness