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-39368: Trace replay: add --extra-server support, part 1.
Michael Widenius
MDEV-32745 Add a simple MySQL to MariaDB upgrade helper

The tool is named mariadb-migrate-config-file.
The main purpose of the tool is to change MySQL option
files to work both for MySQL and MariaDB.
There are options to do the changes in the options file inline,
or at-end-of-file. One can also remove or comment unknown options.

The list of supported options is generated compile time from
mariadbd --help. All server options, including compiled plugins, are
supported.

The bulk of the code comes from Väinö.
Monty has updated it with a lot of extra options.
Wlad helped with cmake integration

Other things:
- Fixed a memory leak in sql_plugin.cc
- plugin-load will now in case of errors try to load all given plugins
  before aborted
- If silent-startup is used, plugin-load will not give errors for
  plugins it cannot load or warnings about plugin marturity level.
- my_rm_tree() will now delete symlinks, not the actual file, if
  MY_NOSYMLINK flag is used.
- my_stat() will now give data for symlink if MY_NOSYMLINKS is used.
- Added 'number of lines' option to mysqltest --cat_file

@Authors: Väinö Mäkelä <[email protected]>,[email protected]
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-37491: Assertion `(mem_root->flags & 4) == 0` failed in `void *alloc_root(MEM_ROOT *, size_t)`

Problem:
  Server crashes when a procedure with default parameter is executed and
  default value for the parameter is evaluated after the procedure's
  first execution. For example:

  CREATE PROCEDURE p(x INT DEFAULT (SELECT 1)) ...
  CALL p(1); -- first exec, marks mem_root read-only
  CALL p(); -- tries to allocate on locked when executing DEFAULT

Fix:
  Temporarily clear the read-only flag on the statement memory root to
  allow the allocation. Also adds a debug hook to verify allocation
  happens not more than once per prepared statement and per internal
  table added to the list.
Raghunandan Bhat
MDEV-37243: SP memory root protection disappears after a metadata change

Problem:
  When a stored routine involes a cursor and metadata of table on which
  the cursor is defined changes, the SP instruction has to be reparsed.
  For ex:
  CREATE OR REPLACE TABLE t1 (a INT);

  CREATE OR REPLACE FUNCTION f1() RETURNS INT
  BEGIN
    DECLARE vc INT DEFAULT 0;
    DECLARE cur CURSOR FOR SELECT a FROM t1;
    OPEN cur;
    FETCH cur INTO vc;
    CLOSE cur;
    RETURN vc;
  END;

  SELECT f1(); - first execution, sp-mem_root marked read-only on exec
  SELECT f1(); - read-only sp-mem_root
  ALTER TABLE t1 MODIFY a TEXT; - metadta change
  SELECT f1(); - reparse, rerun instr and mark new mem_root read-only

  sp_lex_instr is re-parsed after the metadata change, which sets up a
  new mem_root for reparsing. Once the instruction is re-parsed and
  re-executed(via reset_lex_and_exec_core), the new memory root assigned
  to the instruction being reparsed remains writable. This violates the
  invariant of SP memory root protection.

Fix:
  Mark the new memory root created for reparsing with read-only flag,
  after the first execution of the SP instruction.
Marko Mäkelä
MDEV-39264: Improve the documentation of ER_CHECKREAD

Similar to ER_LOCK_DEADLOCK and ER_LOCK_WAIT_TIMEOUT, let the ER_CHECKREAD
message suggest that the transaction needs to be restarted. When this error
is reported by InnoDB (only if innodb_snapshot_isolation=ON),
the transaction will be rolled back.
PranavKTiwari
MDEV-39245- Check that plugin name is pure ASCII
Fixed - __attribute__ not supported on Windows MSVC
Sergei Petrunia
MDEV-39368: Make --replay-server[-manual] save the output of last EXPLAIN in the replay.

The last command is set "optimizer_replay_context=null"...
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.
Abhishek Bansal
MDEV-38474: ASAN heap-use-after-free in st_select_lex_unit::cleanup

cleanup_stranded_units() was added at the start of
st_select_lex_unit::cleanup() by 34a8209d6657. This causes a
use-after-free when nested subqueries are merged into their parent
unit. With nested subqueries like:

  SELECT * FROM t1
  WHERE a IN (SELECT b FROM t2
              WHERE a IN (SELECT c FROM t3 WHERE FALSE HAVING c < 0));

the stranded_clean_list chains the units as: Unit1 -> Unit2 -> Unit3.
Because cleanup_stranded_units() was called first, Unit1->cleanup()
would recursively trigger Unit2->cleanup(), which in turn would
trigger Unit3->cleanup(). Unit3's cleanup frees its heap-allocated
join structures. But since Unit3 was merged into Unit2, Unit2 still
holds references to Unit3's structures (e.g., st_join_table). When
control returns to Unit2 for its own local cleanup, it accesses
already-freed memory.

Fix: move cleanup_stranded_units() to the end of cleanup(). This way,
each unit completes its own local cleanup first—clearing its
references to any child structures—before triggering cleanup of its
stranded (child) units. This enforces a parent-first cleanup order.
Sergei Petrunia
MDEV-39368: Add --replay-server-manual.
PranavKTiwari
MDEV-39245: Validate plugin names are pure ASCII before registration

Previously, valid plugins were left in INACTIVE state in the internal
hash when a subsequent plugin in the same .so had a non-ASCII name.

Fixed by adding a pre-validation loop before registration that checks
all plugin names using my_string_repertoire(). If any name is non-ASCII,
the .so is rejected via plugin_dl_del() before any plugin is registered.
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
Thirunarayanan Balathandayuthapani
MDEV-38842 Server fails to drop .ibd file when vector table creation fails

Problem:
========
When creating tables with vector indexes, if the secondary table
creation fails after the main table is successfully created,
the server was not properly cleaning up the main table's .ibd file.
Stale file exists because create_table_impl() always called
ddl_log_complete() on any error, which disables DDL log entries
instead of executing them for cleanup. The main table would be
left behind even though the overall CREATE TABLE operation failed.

Solution:
=========
Add ha_create_status enum to distinguish between different table
creation failure scenarios in ha_create_table():

- HA_CREATE_SUCCESS: Table created successfully
- HA_CREATE_FAILED_EARLY: Failure before storage engine file creation
- HA_CREATE_FAILED_SECONDARY: Failure during secondary table creation

This enum is being used in create_table_impl():

When HA_CREATE_FAILED_SECONDARY is returned, it indicates that the
main table files were successfully created but secondary table
creation failed. In this case, create_table_impl() calls
ddl_log_revert() to execute DDL log entries and clean up the
partially created main table files.

When HA_CREATE_FAILED_EARLY is returned, it indicates failure before
any files were created. In this case, create_table_impl() calls
ddl_log_complete() to disable the DDL log entries since there's
nothing to clean up.
Sergei Petrunia
MDEV-39368: Run set optimizer_replay_context='' for cleanup.
Abhishek Bansal
MDEV-38474: ASAN heap-use-after-free in st_select_lex_unit::cleanup

cleanup_stranded_units() was added at the start of
st_select_lex_unit::cleanup() by 34a8209d6657. This causes a
use-after-free when nested subqueries are merged into their parent
unit. With nested subqueries like:

  SELECT * FROM t1
  WHERE a IN (SELECT b FROM t2
              WHERE a IN (SELECT c FROM t3 WHERE FALSE HAVING c < 0));

the stranded_clean_list chains the units as: Unit1 -> Unit2 -> Unit3.
Because cleanup_stranded_units() was called first, Unit1->cleanup()
would recursively trigger Unit2->cleanup(), which in turn would
trigger Unit3->cleanup(). Unit3's cleanup frees its heap-allocated
join structures. But since Unit3 was merged into Unit2, Unit2 still
holds references to Unit3's structures (e.g., st_join_table). When
control returns to Unit2 for its own local cleanup, it accesses
already-freed memory.

Fix: move cleanup_stranded_units() to the end of cleanup(). This way,
each unit completes its own local cleanup first—clearing its
references to any child structures—before triggering cleanup of its
stranded (child) units. This enforces a parent-first cleanup order.
PranavKTiwari
MDEV-39184- Rework MDL enum constants values.
Reverted enum_mdl_namespace code changes, as it doesn not add any value.
add vlaue.
Alexey Botchkov
MDEV-39210 ExtractValue/UpdateXML crash.

XML parser fixed to handle <! and <? correctly.
Raghunandan Bhat
MDEV-39118: `test_if_hard_path` crashes on recursively resolving `$HOME`

Problem:
  When `$HOME` is set to `~/` (or any string starting with `~/`), the
  `home_dir` is initialized to that value. When `test_if_hard_path` is
  called on a path starting with `~/`, it replaces the `~/` prefix by
  recursively calling `test_if_hard_path(home_dir)` leading to infinite
  recursion and a crash.

Fix:
  Add a check in `test_if_hard_path` to see if `home_dir` itself begins
  with `~/`. If it does, skip the recursive call to prevent the
  infinite loop.
Aleksey Midenkov
MDEV-39184 TABLE_LIST C++-friendly initialization refactoring

The problem with the current initialization is that TABLE_LIST ctors
as well as init_one_table*() functions call reset() that byte-zeroes
the object after encapsulated objects were initialized by their
constructors. That specifically creates the wrong value for
mdl_request.type which must be MDL_NOT_INITIALIZED (-1) by default and
bzero() reverts it to MDL_INTENTION_EXCLUSIVE (0). And these constant
values is not easy (if not possible) to change.

The fix introduces utility base class Byte_zero which moves bzero()
call before the encapsulated ctors (as parent classes' ctors are
called first). So now encapsulated ctors are not called redundantly
and no double initialization is needed.

All the C++-constructed objects call init_one_table*() as before, only
without reset(). The C-alloced objects call init_one_tab*_r() versions
that call reset(). These will be replaced back to no-reset() versions
after their allocation is refactored to C++ version.
Sergei Petrunia
MDEV-39368: Make mtr write queries into log/replay_queries.log
Dave Gosselin
MDEV-39209: use iterative cleanup for merged units to avoid stack overflow

Query optimization can merge derived tables (VIEWs being a type of derived
table) into outer queries, leaving behind stranded  st_select_lex_unit objects
("stranded units") for post-query cleanup.

Previously, these were cleaned up recursively. For queries with many merged
derived tables, the deep recursion over the list of stranded units could
exhaust the stack. This change replaces the recursive cleanup with an
iterative loop to prevent stack overflows.
Marko Mäkelä
Protect backup by log_sys.latch.wr_lock(), and make Windows happy
Dave Gosselin
MDEV-39209: use iterative cleanup for merged units to avoid stack overflow

Query optimization can merge derived tables (VIEWs being a type of derived
table) into outer queries, leaving behind stranded  st_select_lex_unit objects
("stranded units") for post-query cleanup.

Previously, these were cleaned up recursively. For queries with many merged
derived tables, the deep recursion over the list of stranded units could
exhaust the stack. This change replaces the recursive cleanup with an
iterative loop to prevent stack overflows.
PranavKTiwari
MDEV-39245- Check that plugin name is pure ASCII
Added plugin names in mariadb-test install under debian.
Alexey Botchkov
MDEV-39124 XMLTYPE: allow only well-formed XML.

Necessary checks added to the XMLTYPE.
Marko Mäkelä
Merge 10.6 into 10.11
Marko Mäkelä
Protect backup by log_sys.latch.wr_lock(), and make Windows happy
Raghunandan Bhat
MDEV-39118: `test_if_hard_path` crashes on recursively resolving `$HOME`

Problem:
  When `$HOME` is set to `~/` (or any string starting with `~/`), the
  `home_dir` is initialized to that value. When `test_if_hard_path` is
  called on a path starting with `~/`, it replaces the `~/` prefix by
  recursively calling `test_if_hard_path(home_dir)` leading to infinite
  recursion and a crash.

Fix:
  Add a check in `test_if_hard_path` to see if `home_dir` itself begins
  with `~/`. If it does, skip the recursive call to prevent the
  infinite loop.
Alexey Botchkov
MDEV-38767 XML datatype to be reported as format in extended metadata in protocol.

add respective Send_field metadata for UDT.
Marko Mäkelä
MDEV-39264: Improve the documentation of ER_CHECKREAD

Simlar to ER_LOCK_DEADLOCK and ER_LOCK_WAIT_TIMEOUT, let the ER_CHECKREAD
message suggest that the transaction needs to be restarted. When this error
is reported by InnoDB (only if innodb_snapshot_isolation=ON),
the transaction will be rolled back.
Marko Mäkelä
Fix GCC-16 -Wmaybe-uninitialized
Alexey Botchkov
MDEV-39210 ExtractValue/UpdateXML crash.

test and a comment fixed.
Michael Widenius
MDEV-32745 Add a simple MySQL to MariaDB upgrade helper

The tool is named mariadb-migrate-config-file.
The main purpose of the tool is to change MySQL option
files to work both for MySQL and MariaDB.
There are options to do the changes in the options file inline,
or at-end-of-file. One can also remove or comment unknown options.

The list of supported options is generated compile time from
mariadbd --help. All server options, including compiled plugins, are
supported.

The bulk of the code comes from Väinö.
Monty has updated it with a lot of extra options.
Wlad helped with cmake integration

Other things:
- Fixed a memory leak in sql_plugin.cc
- plugin-load will now in case of errors try to load all given plugins
  before aborted
- If silent-startup is used, plugin-load will not give errors for
  plugins it cannot load or warnings about plugin marturity level.
- my_rm_tree() will now delete symlinks, not the actual file, if
  MY_NOSYMLINK flag is used.
- my_stat() will now give data for symlink if MY_NOSYMLINKS is used.
- Added 'number of lines' option to mysqltest --cat_file

@Authors: Väinö Mäkelä <[email protected]>,[email protected]
Aleksey Midenkov
MDEV-39184 Cleanup for MDL_NOT_INITIALIZED

As C++ style initialization of TABLE_LIST now works correctly after
Byte_zero refactoring. We may remove MDL_NOT_INITIALIZED double
initialiation.
Marko Mäkelä
MDEV-39264: Improve the documentation of ER_CHECKREAD

Similar to ER_LOCK_DEADLOCK and ER_LOCK_WAIT_TIMEOUT, let the ER_CHECKREAD
message suggest that the transaction needs to be restarted. When this error
is reported by InnoDB (only if innodb_snapshot_isolation=ON),
the transaction will be rolled back.
Raghunandan Bhat
MDEV-37243: SP memory root protection disappears after a metadata change

Problem:
  When a stored routine involes a cursor and metadata of table on which
  the cursor is defined changes, the SP instruction has to be reparsed.
  For ex:
  CREATE OR REPLACE TABLE t1 (a INT);

  CREATE OR REPLACE FUNCTION f1() RETURNS INT
  BEGIN
    DECLARE vc INT DEFAULT 0;
    DECLARE cur CURSOR FOR SELECT a FROM t1;
    OPEN cur;
    FETCH cur INTO vc;
    CLOSE cur;
    RETURN vc;
  END;

  SELECT f1(); - first execution, sp-mem_root marked read-only on exec
  SELECT f1(); - read-only sp-mem_root
  ALTER TABLE t1 MODIFY a TEXT; - metadta change
  SELECT f1(); - reparse, rerun instr and mark new mem_root read-only

  sp_lex_instr is re-parsed after the metadata change, which sets up a
  new mem_root for reparsing. Once the instruction is re-parsed and
  re-executed(via reset_lex_and_exec_core), the new memory root assigned
  to the instruction being reparsed remains writable. This violates the
  invariant of SP memory root protection.

Fix:
  Mark the new memory root created for reparsing with read-only flag,
  after the first execution of the SP instruction.
PranavKTiwari
MDEV-39245: Validate plugin names are pure ASCII before registration

Previously, valid plugins were left in INACTIVE state in the internal
hash when a subsequent plugin in the same .so had a non-ASCII name.

Fixed by adding a pre-validation loop before registration that checks
all plugin names using my_string_repertoire(). If any name is non-ASCII,
the .so is rejected via plugin_dl_del() before any plugin is registered.
Alexey Botchkov
MDEV-39124 XMLTYPE: allow only well-formed XML.

Necessary checks added to the XMLTYPE.