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-25529 set_up_default_partitions() ER_OUT_OF_RESOURCES error
Rex Johnston
MDEV-39333 main.group_by fails with incorrectly ordered rows

Since commit 80ea16c6209, 'order by column is null' may produce an
indeterminate column order of rows where 'column is null' is
satisfied.  This commit fixes an existing test in main.group_by
for MDEV-6129.
Yuchen Pei
MDEV-39207 Fix plugin name passed to find_bookmark in test_plugin_options

Should be lowercase, just like in construct_options(). Without this
fix all plugin session vars have test_load always
false (static_unloaded).
Sergei Golubchik
MDEV-39301: fix main.xa - Timeout in wait_until_count_sessions.inc

Backport from 11.8 aa2ac3078fa99c7cf712c29023c48ffe68677e10
Michal Schorm
MDEV-39278 Validate .cfg file parser string lengths in InnoDB import

Replace overly permissive or missing length limits in the .cfg
metadata file parser (used by ALTER TABLE ... IMPORT TABLESPACE)
with correct constants:

- Field/index/column names: NAME_LEN + 1 (193 bytes including
  NUL), matching the maximum identifier length defined in
  mysql_com.h. Replaces the hardcoded 128 for columns (with
  FIXME) and OS_FILE_MAX_PATH (4000) for index names. Adds
  missing validation for field names.
- Hostname: HOSTNAME_LENGTH + 1 (256), consistent with
  MariaDB's own hostname limit defined in mysql_com.h.
  RFC 1035 defines the textual DNS name limit as 253
  characters (254 with NUL), but HOSTNAME_LENGTH (255) is
  based on the RFC 1034 wire-format limit of 255 octets.
  Using HOSTNAME_LENGTH avoids rejecting .cfg files exported
  from servers with valid 254-255 character hostnames.
- Table name: MAX_FULL_NAME_LEN + 1 (655 bytes including NUL),
  since the .cfg file stores the full db/table name (written
  by row0quiesce.cc as table->name.m_name).

Without these checks, a crafted .cfg file could specify lengths
up to 2^32 via the 4-byte mach_read_from_4() length prefix,
causing excessive memory allocation.

Use ib_senderrf() instead of ib_errf() for reporting validation
failures. ib_errf() pre-formats its message into a single string
and passes it to ib_senderrf(), but ER_IO_READ_ERROR expects
three arguments (%lu, %s, %s). Using ib_senderrf() directly
with the correct arguments avoids this format mismatch.
The pre-existing column name check had the same ib_errf() misuse
and is corrected here as well.

The test covers hostname and table name length validation.
Column name, index name, and field name length validation
are not tested because their offsets are deep in the .cfg
binary format and would require walking past variable-length
sections (autoinc, page size, flags, column/index metadata).

Co-Authored-By: Claude AI <[email protected]>
Monty
Cleanup memory from OpenSSL at exit.

This removes warnings about not freed memory when using valgrind
Yuchen Pei
MDEV-38752 Check that virtual column is a supertype to its expression before substitution

New optimizations were introduced that substitute virtual column
expressions (abbr. vcol expr) with index virtual columns (abbr. vcol
field) in WHERE, ORDER BY and GROUP BY.

In this patch we introduce checks that the type of a vcol field is the
supertype to its vcol expr, and if not, do not proceed the
optimization. This ensures that the substitution is safe and does not
for example lose information due to truncation.

For simplicity, the version of the check implemented is strict with
100% precision, meaning that there are instances where vcol field is a
supertype to vcol expr, but the check returns false.

Types not covered in tests: Type_handler_null, Type_handler_composite,
Type_handler_refcursor

Thanks to Jarir Khan <[email protected]> for initial patches
addressing this problem.
Oleg Smirnov
MDEV-32868 SELECT NULL,NULL IN (SUBQUERY) returns 0 instead of NULL

When evaluating (SELECT NULL, NULL) IN (SELECT 1, 2 FROM t), the result
was incorrectly 0 instead of NULL.

The IN-to-EXISTS transformation wraps comparison predicates with
trigcond() guards:

  WHERE trigcond(NULL = 1) AND trigcond(NULL = 2)

During optimization, make_join_select() evaluated this as a "constant
condition". With guards ON, the condition evaluated to FALSE (NULL
treated as FALSE), triggering "Impossible WHERE". At runtime, guards
would be turned OFF for NULL columns, but the optimizer had already
marked the subquery as returning no rows.

Fix: check can_eval_in_optimize() instead of is_expensive() in
make_join_select(). Unlike is_expensive(), can_eval_in_optimize()
also verifies const_item(), which returns FALSE for Item_func_trig_cond
Oleg Smirnov
MDEV-32868 Cleanup (no change of logic)

Switch branches of the `if` condition to make the code
flow more naturally.
Mikhail Pochatkin
MDEV-39173 Replace sprintf with snprintf, remove deprecated pragma

Remove the unscoped #pragma GCC diagnostic ignored
"-Wdeprecated-declarations" from include/violite.h and replace all
sprintf/vsprintf calls with snprintf/vsnprintf across the codebase.

Where possible, pass actual buffer sizes as function parameters
instead of using hardcoded constants or recomputing strlen().
Notable API changes:
- get_date(): added to_len parameter for buffer size
- nice_time(), end_timer() in client/mysql.cc: added buff_size
- generate_new_name(): added name_size parameter
- calc_md5(): added buffer_size parameter (fixes off-by-one)
- MD5_HASH_TO_STRING macro: added _size parameter
- Added MYSQL_UDF_MAX_RESULT_LENGTH constant in mysql_com.h

Also fixed a pre-existing bug in sql/rpl_mi.cc where the ellipsis
"..." was written to the wrong buffer (dbuff instead of buff).

Vendored code is excluded: extra/readline, extra/wolfssl,
wsrep-lib, libmariadb, storage/mroonga/vendor, zlib.
Yuchen Pei
Merge branch '10.11' into 11.4
Aleksey Midenkov
vers_calc_hist_parts()
Sergei Petrunia
Fix in condition pushdown code: don't pass List<Field_pair> by value.

Affected functions:
  find_matching_field_pair(Item *item, List<Field_pair> pair_list)
  get_corresponding_field_pair(Item *item, List<Field_pair> pair_list)

Both only traverse the pair_list.
They use List_iterator so we can't easily switch to using const-reference.
Sergei Petrunia
Derived Condition Pushdown: add more comments.

Add comments to
- find_producing_item()
- Item_field::derived_field_transformer_for_where()
- Item_field::grouping_field_transformer_for_where()

Also note that Item_default_value::grouping_field_transformer_for_where()
is not implemented.
Daniel Black
MDEV-39207: Fix plugin name passed to find_bookmark in test_plugin_options (test postfix)

Under cursor/ps-protocol(Debug buidl) the UNINSTALL SONAME
in the cleanup could generate WARN_PLUGIN_BUSY during shutdown.

Disable the cursor and ps-protocol around the
disconnect and uninstall soname to resolve the test failure.

Concept/Review/Testing with: Yuchen Pei
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.
Thirunarayanan Balathandayuthapani
MDEV-19574: innodb_stats_method is not honored when innodb_stats_persistent=ON

Problem:
=======
When persistent statistics are enabled (innodb_stats_persistent=ON),
the innodb_stats_method setting is not properly utilized during
statistics calculation.

The statistics collection functions always use a hardcoded default
behavior for NULL value comparison instead of respecting the
configured stats method (NULLS_EQUAL, NULLS_UNEQUAL, or
NULLS_IGNORED). This affects the accuracy of n_diff_key_vals
(distinct key count) and n_non_null_key_val estimates, particularly
for indexes with nullable columns containing NULL values. This
impacts the query optimizer makes decisions based on inaccurate
cardinality and estimates.

Solution:
========
Introduced IndexLevelStats which is to collect statistics
at a specific B-tree level during index analysis

Introduced PageStats which is to collect statistics
for leaf page analysis

Refactored the following functions:
dict_stats_analyze_index_level() to IndexLevelStats::analyze_level()
dict_stats_analyze_index_for_n_prefix() to IndexLevelStats::sample_leaf_pages()
dict_stats_analyze_index_below_cur() to PageStats::scan_below()
dict_stats_scan_page() to PageStats::scan()

Add stats method name to stat_description in case of non
default innodb_stats_method variable value

Added the new stat name like n_nonnull_fld01, n_nonull_fld02 etc
with stats description to indicate how many non-nulls value exist
for nth field of the index. This value is properly retrieved and
stored in index statistics in dict_stats_fetch_index_stats_step().

rec_get_n_blob_pages(): Calculate the number of externally
stored pages for a record. It uses ceiling division with actual
usable blob page space(blob_part_size) and now correctly handles for
both compressed and uncompressed table formats for
accurate BLOB page counting.

When InnoDB scan the leaf page directly, assign leaf page
count as number of pages scanned in case of multi-level index.
For single page indexes, use 1. This change leads to multiple
changes in existing test case.

n_non_null_key_vals calculation:
Only leaf pages have actual null/non-null distinction that
matters for statistics.
For NOT NULL columns, n_non_null_key_vals = n_diff_key_vals
For nullable columns, n_non_null_key_vals is calculated using

n_ordinary_leaf_pages * (n_non_null_all_analyzed_pages
                        / n_leaf_pages_to_analyze)
Marko Mäkelä
unsung heroes are unsigned, not unsinged
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.
Sergei Golubchik
MDEV-39141 MariaDB crashes in THD::THD() due to misalignment

fix my_malloc() to return 16-aligned pointers

(type_assoc_array.sp-assoc-array-64bit prints changes in memory_used,
and my_malloc() uses more memory now)
Rex Johnston
MDEV-29360 Crash when pushing condition with always false IS NULL into derived

(Edited by Sergei Petrunia)

Problem: when the optimizer attempts to push a condition in form
"merged_view.not_null_column IS NULL" into a derived table other
than the merged_view itself, it may crash.

The cause is this scenario:
1. Condition pushdown code uses walk() with excl_dep_on_grouping_fields()
(or excl_dep_on_table()) to determine whether an Item expression can
be pushed. Item_args::excl_dep_on_table() assumes that any item with
const_item()==1 can be pushed anywhere.

2. Item_func_isnull(not_null_expr) will report const_item()=1 as it
will always evaluate false. However it will have non-const expression
as its argument. As described in #1, this item will be considered pushable.

3. Transformation of item for pushdown is done in "transformer function"
Item_XXX::{derived|grouping}_field_transformer_for_where().
This function will be called for Item_func_isnull's argument.
If the argument is an Item_direct_view_ref, its transformer function
will call find_matching_field_pair() (or find_producing_item())
to locate the origin of the item inside the SELECT we're pushing the
condition into. It will get a NULL pointer (origin not found) and crash.


== The fix ==
Let Item_func_is_null(not_null_expr) report const_item()==true but
let its used_tables() still report those from not_null_expr.

Then, in Item_args, make excl_dep_on_grouping_fields() and
excl_dep_on_table() to check the used tables/columns for items
that report const_item()==true but have non-zero used_tables().
ParadoxV5
Fix `$target_temp_format` in `rpl.rpl_typeconv`

The MTR snippet `suite/rpl/include/check_type.inc`
was setting `@@GLOBAL.mysql56_temporal_format` with the wrong variable.
Michal Schorm
MDEV-14373: Reject incompatible PLUGIN_xxx build mode at configure time

When a user sets -DPLUGIN_PARTITION=DYNAMIC or
-DPLUGIN_PERFSCHEMA=DYNAMIC, these plugins are declared
STATIC_ONLY in their CMakeLists.txt. Previously, the
MYSQL_ADD_PLUGIN macro would silently skip building such
plugins: the STATIC branch wouldn't match (because the user
requested DYNAMIC), and the DYNAMIC branch would be blocked
by ARG_STATIC_ONLY. The plugin was simply not built.

This caused confusing downstream compile errors in other
plugins that depended on the missing one:

  - PLUGIN_PARTITION=DYNAMIC -> CONNECT fails:
    'struct TABLE_SHARE' has no member named
    'partition_info_str_len'
    'struct TABLE' has no member named 'part_info'

  - PLUGIN_PERFSCHEMA=DYNAMIC -> MariaBackup fails:
    'MY_WME' was not declared in this scope
    'my_read' was not declared in this scope
    'MY_FILE_ERROR' was not declared in this scope

  - PLUGIN_ARIA=DYNAMIC -> Spider fails:
    'MARIA_COLUMNDEF' has not been declared
    (Note: Aria is now MANDATORY and already overrides
    user input; this was likely reproducible in older
    versions where Aria was DEFAULT)

Root cause: The MYSQL_ADD_PLUGIN macro in
cmake/plugin.cmake did not validate that the
user-requested build mode (STATIC or DYNAMIC) was
compatible with the plugin's declared capabilities
(STATIC_ONLY or MODULE_ONLY).

Fix: Add validation immediately after the existing
PLUGIN_xxx value check. If DYNAMIC is requested for a
STATIC_ONLY plugin, or STATIC is requested for a
MODULE_ONLY plugin, emit a FATAL_ERROR with a clear
message telling the user which option to use instead.

Non-MANDATORY plugins with STATIC_ONLY (the new check
catches -DPLUGIN_xxx=DYNAMIC for these):
  - partition (sql/CMakeLists.txt)
  - perfschema (storage/perfschema/CMakeLists.txt)
  - thread_pool_info (sql/CMakeLists.txt)

Conditionally STATIC_ONLY (platform/config-dependent):
  - feedback (only on Windows)

The MANDATORY + STATIC_ONLY plugin sql_sequence is
unaffected: the MANDATORY flag overrides user input to
YES before the new check runs.

MODULE_ONLY plugins (the new check catches
-DPLUGIN_xxx=STATIC for these) include all dynamically-
loaded plugins: federated, spider, rocksdb, mroonga,
oqgraph, example, and ~25 others under plugin/ and
storage/.

The YES and AUTO modes are unaffected since they already
gracefully fall through to whichever mode the plugin
supports.

Co-Authored-By: Claude AI <[email protected]>
Daniel Black
oqgraph: remove openquery.com refs and broken LP links

As requested by Arjen, openquery.com former OQ owner,
the domain is no longer existing and neither is the
launchpad project. There isn't a company that does
support/engineering, so remove those references too.
Marko Mäkelä
Copy log files between file systems, in the backup thread
Yuchen Pei
MDEV-39217 Fix the hash key calculation in session sysvar tracker

MDEV-31751 changed the key from the sys_var pointer to its offset.
This was useful for non-plugin variable aliases, but not so much for
plugin variables which all have offset 0.
Yuchen Pei
MDEV-38752 Check that virtual column is a supertype to its expression before substitution

New optimizations were introduced that substitute virtual column
expressions (abbr. vcol expr) with index virtual columns (abbr. vcol
field) in WHERE, ORDER BY and GROUP BY.

In this patch we introduce checks that the type of a vcol field is the
supertype to its vcol expr, and if not, do not proceed the
optimization. This ensures that the substitution is safe and does not
for example lose information due to truncation.

For simplicity, the version of the check implemented is strict with
100% precision, meaning that there are instances where vcol field is a
supertype to vcol expr, but the check returns false.

Types not covered in tests: Type_handler_null, Type_handler_composite,
Type_handler_refcursor

Thanks to Jarir Khan <[email protected]> for initial patches
addressing this problem.
Aleksey Midenkov
MDEV-25529 TimestampString for printing timestamps
HNOONa-0
MDEV-39043: String '0' sets the ENUM to an empty string
This fixes the string evaluation logic for ENUM types
so the literal string '0' is treated as index 0
Aleksey Midenkov
MDEV-25529 ALTER TABLE FORCE syntax improved

Improves ALTER TABLE syntax when alter_list can be supplied alongside a
partitioning expression, so that they can appear in any order. This is
particularly useful for the FORCE clause when adding it to an existing
command.

Also improves handling of AUTO with FORCE, so that AUTO FORCE
specified together provides more consistent syntax, which is used by
this task in further commits.
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.
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.
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.
Daniel Black
MDEV-39157 BUILD_TYPE=mysql_release to remove compile flags

BUILD_TYPE=mysql_release changes a bunch of build flags on Linux/UNIX
systems and our CI processes insufficiently test the impacts of these.

This effectively drops the gcc/clang optimization from O3 of a
release down to O2. The performance gains of O3 vs O2 are currently
insufficiently tested (MDEV-19734 is outstanding).

What is clear is amd64v3 is providing the ability of enhanced MMX
instructions which causes segfaults on unaligned addresses
(MDEV-38989 and others). As compilers get smarter and O3 provides
more transforms is safer if the CMAKE_BUILD_TYPE=RelWithDebInfo
experiences of CI have identical compile flags, with BUILD_TYPE=mysql_release
changing to present required features only.

This resolves MDEV-35809 by removing the specialized optimization
for platforms that are unsupported or unmaintained per PR #3744
comments.
Aleksey Midenkov
MDEV-25529 cleanup for vers_set_starts() and starts_clause
Yuchen Pei
[fixup] Initialise order->in_field_list

Otherwise we may get

sql/table.h:239:16: runtime error: load of value 165, which is not a valid value for type 'bool'
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.
Rex Johnston
MDEV-39333 main.group_by fails with incorrectly ordered rows

Since commit 80ea16c6209, 'order by column is null' may produce an
indeterminate column order of rows where 'column is null' is
satisfied.  This commit fixes an existing test in main.group_by
for MDEV-6129.