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-38072 Optimizer choosing the wrong plan

(Variant 3, more comments)
When multiple indexes produce ordering that matches the
ORDER BY ... LIMIT clause, like

  INDEX idx1(kp1, kp2)
  INDEX idx2(kp2)
and the query with
  WHERE kp1=const ORDER BY kp2 LIMIT 2

then test_if_cheaper_ordering() in pre-11.0 versions will choose
the index with the smallest KEY::user_defined_key_parts (idx2 in
this example). This can produce a much worse query plan.

The fix is to do what MariaDB 11.0 would do: use the index for which
we have the cheapest access method. The cost of access method here
takes into account that we will stop after producing #LIMIT rows.

The fix is controlled by the
  @@optimizer_adjust_secondary_key_costs=fix_order_by_index_choice
flag and is OFF by default.
Aleksey Midenkov
vers_calc_hist_parts()
Aleksey Midenkov
MDEV-27569 Followup fix
rusher
[misc] update CI
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.
rusher
[misc] add maxscale testing
rusher
[misc] add maxscale testing
Aleksey Midenkov
MDEV-38798 followup 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.
Aleksey Midenkov
vers_calc_hist_parts()
Aleksey Midenkov
vers_calc_hist_parts()
HNOONa-0
MDEV-35369: Refactor Yes_or_empty to Yes_or_no

- Rename Yes_or_empty to Yes_or_no, returning YES/NO instead of Yes/"".
- Globally replace store_yesno() with Yes_or_no::value().
- Preserve legacy output ("Yes"/"") in I_S.COLLATIONS and
  I_S.COLLATION_CHARACTER_SET_APPLICABILITY for backward compatibility.
- Assign CYCLE_OPTION variable "Yes"/"No" values
Aleksey Midenkov
Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Aleksey Midenkov
Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Aleksey Midenkov
MDEV-38798 followup 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.
Aleksey Midenkov
Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Aleksey Midenkov
Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Thirunarayanan Balathandayuthapani
MDEV-39261 MariaDB crash on startup in presence of indexed virtual columns

Problem:
========
A single InnoDB purge worker thread can process undo logs from different
tables within the same batch. But get_purge_table(), open_purge_table()
incorrectly assumes that a 1:1 relationship between a purge worker thread
and a table within a single batch. Based on this wrong assumtion,
InnoDB attempts to reuse TABLE objects cached in thd->open_tables for
virtual column computation.

1) Purge worker opens Table A and caches the TABLE pointer in thd->open_tables.
2) Same purge worker moves to Table B in the same batch, get_purge_table()
retrieves the cached pointer for Table A instead of opening Table B.
3) Because innobase::open() is ignored for Table B, the virtual column
template is never initialized.
4) virtual column computation for Table B aborts the server

Solution:
========
- Introduced purge_table class which has the following
purge_table: Stores either TABLE* (for tables with indexed virtual
columns) or MDL_ticket* (for tables without) in a single union
using LSB as a flag.
For tables with indexed virtual columns: opens TABLE*, accesses
MDL_ticket* via TABLE->mdl_ticket
For tables without indexed virtual columns: stores only MDL_ticket*.

trx_purge_attach_undo_recs(): Coordinator opens both dict_table_t*
and TABLE* with proper MDL protection. Workers access cached
table pointers from purge_node_t->tables without opening
their own handles

purge_sys.coordinator_thd: Distinguish coordinator from workers
in cleanup logic. Skip innobase_reset_background_thd() for
coordinator thread to prevent premature table closure during
batch processing. Workers still call cleanup to release their
thread-local resources

trx_purge_close_tables():
Rewrite for purge coordinator thread
1) Close all dict_table_t* objects first
2) Call close_thread_tables() once for all TABLE* objects
3) Release MDL tickets last, after tables are closed

Added table->lock_mutex protection when reading (or) writing
vc_templ->mysql_table and mysql_table_query_id. Clear cached
TABLE* pointers before closing tables to prevent stale pointer
access

Declared open_purge_table() and close_thread_tables() in trx0purge.cc
Declared reset_thd() in row0purge.cc and dict0stats_bg.cc.
Removed innobase_reset_background_thd()
Abhishek Bansal
MDEV-36444: Support for user-defined field and index options
Aleksey Midenkov
MDEV-38798 followup 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.
Aleksey Midenkov
Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Aleksey Midenkov
MDEV-38798 followup TABLE_LIST C++-friendly initialization refactoring

The problem with the current initialization is that TABLE_LIST ctors
as will 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.
Aleksey Midenkov
MDEV-25529 Auto-create: Pre-existing historical data is not partitioned as specified by ALTER

Adds logic into prep_alter_part_table() for AUTO to check the history
range (vers_get_history_range()) and based on (max_ts - min_ts)
difference compute the number of created partitions and set STARTS
value to round down min_ts value (vers_set_starts()) if it was not
specified by user or if the user specified it incorrectly. In the
latter case it will print warning about wrongly specified user value.

In case of fast ALTER TABLE, f.ex. when partitioning already exists,
the above logic is ignored unless FORCE clause is specified. When user
specifies partition list explicitly the above logic is ignored even
with FORCE clause.

vers_get_history_range() detects if the index can be used for row_end
min/max stats and if so it gets it with ha_index_first() and
HA_READ_BEFORE_KEY (as it must ignore current data). Otherwise it does
table scan to read the stats. There is test_mdev-25529 debug keyword
to check the both and compare results. A warning is printed if the
algorithm uses slow scan.

Field_vers_trx_id::get_timestamp() is implemented for TRX_ID based
versioning to get epoch value. It works in vers_get_history_range()
but since partitioning is not enabled for TRX_ID versioning create
temporary table fails with error, requiring timestamp-based system
fields. This method will be useful when partitioning will be enabled
for TRX_ID which is mostly performance problems to solve.

Static key_cmp was renamed to key_eq to resolve compilation after
key.h was included as key_cmp was already declared there.
Aleksey Midenkov
MDEV-38798 followup TABLE_LIST C++-friendly initialization refactoring

The problem with the current initialization is that TABLE_LIST ctors
as will 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.
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]
Marko Mäkelä
Hard-link or rename the InnoDB log

TODO: Duplicate the last log file at the end

innodb_backup_checkpoint(): Invoked when log checkpoint is switching
to a new file.
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).
Raghunandan Bhat
MDEV-35717: UBSAN: runtime error: applying zero offset to null pointer in `my_strnncoll_utf8mb3_general1400_as_ci`

Problem:
  UBSAN reports runtime errors in string comparision functions where
  pointer arithmetic is done without checking NULL.

Fix:
  Defines a new function `streq_safe` as a replacement for `streq` that
  resulted in UBSAN errors, capable of handling NULL pointers. Also
  makes `is_infoschema_db` and `is_perfschema_db` use `streq_safe` for
  comparision.
bsrikanth-mariadb
MDEV-39222: After loading saved optimizer context, further queries cause errors

The problem can be seen as:
source /tmp/saved_optimizer_context.sql
INSERT ..(or any DML);
-- This causes "Failed to match the stats from replay context" warning-turned-error.

The cause is that saved_optimizer_context.sql ends with:
  set @opt_context=...;
  set optimizer_replay_context='opt_context';
  <query for which the context was captured>
Note that optimizer_replay_context remains set and will apply for any further query.

== SOLUTION ==
Make saved optimizer context have this as last statement:
  set optimizer_replay_context=NULL;
If one desires to replay the context, it's still available in @opt_context.
Aleksey Midenkov
MDEV-27569 fix 2
Raghunandan Bhat
MDEV-35717: UBSAN: runtime error: applying zero offset to null pointer in `my_strnncoll_utf8mb3_general1400_as_ci`

Problem:
  UBSAN reports runtime errors in string comparision functions when
  pointer arithmetic is done without checking NULL.

Fix:
  - Add debug asserts in `strnncoll` function to catch NULL pointers.
  - Define a new function `streq_safe` as a replacement for `streq`,
    capable of handling NULL pointers. Replace `streq` with `streq_safe`
    at multiple call sites, identified by the debug asserts.
  - Add empty identifier checks in `is_infoschema_db` and
    `is_perfschema_db` before calling the deep character-set based
    comparision.
rusher
[misc] update CI
HNOONa-0
MDEV-35369: Add IS_DEPRECATED to SYSTEM_VARIABLES

- Add IS_DEPRECATED and DEPRECATION_REPLACEMENT columns to the
  SYSTEM_VARIABLES information schema table
- Add a mysql-test case to verify the new columns output correctly
Aleksey Midenkov
MDEV-38798 followup 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.
Aleksey Midenkov
MDEV-25529 Auto-create: Pre-existing historical data is not partitioned as specified by ALTER

Adds logic into prep_alter_part_table() for AUTO to check the history
range (vers_get_history_range()) and based on (max_ts - min_ts)
difference compute the number of created partitions and set STARTS
value to round down min_ts value (vers_set_starts()) if it was not
specified by user or if the user specified it incorrectly. In the
latter case it will print warning about wrongly specified user value.

In case of fast ALTER TABLE, f.ex. when partitioning already exists,
the above logic is ignored unless FORCE clause is specified. When user
specifies partition list explicitly the above logic is ignored even
with FORCE clause.

vers_get_history_range() detects if the index can be used for row_end
min/max stats and if so it gets it with ha_index_first() and
HA_READ_BEFORE_KEY (as it must ignore current data). Otherwise it does
table scan to read the stats. There is test_mdev-25529 debug keyword
to check the both and compare results. A warning is printed if the
algorithm uses slow scan.

Field_vers_trx_id::get_timestamp() is implemented for TRX_ID based
versioning to get epoch value. It works in vers_get_history_range()
but since partitioning is not enabled for TRX_ID versioning create
temporary table fails with error, requiring timestamp-based system
fields. This method will be useful when partitioning will be enabled
for TRX_ID which is mostly performance problems to solve.

Static key_cmp was renamed to key_eq to resolve compilation after
key.h was included as key_cmp was already declared there.
Sergei Golubchik
Revert "check_digest() tests"

This reverts commit 485773adce55ed3dcae3d20028a218f2f694775d.

We need at least one test that actually shows P_S digests
Raghunandan Bhat
MDEV-35717: UBSAN: runtime error: applying zero offset to null pointer in `my_strnncoll_utf8mb3_general1400_as_ci`

Problem:
  UBSAN reports runtime errors in string comparision functions where
  pointer arithmetic is done without checking NULL.

Fix:
  Defines a new function `streq_safe` as a replacement for `streq` that
  resulted in UBSAN errors, capable of handling NULL pointers. Also
  makes `is_infoschema_db` and `is_perfschema_db` use `streq_safe` for
  comparision.