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
Georgi (Joro) Kodinov
MDEV-35986 - Use memory safe snprintf() in client

Replace sprintf(buf, ...) with snprintf(buf, sizeof(buf), ...),
where buf is allocated with a size known at compile time.

This makes sure we are not writing outside array/string bounds which will
lead to undefined behaviour. In case the code is trying to write outside bounds
- safe version of functions simply cut the string messages so we process this
gracefully.
Rucha Deodhar
MDEV-33843: Server crashes by stack-overflow with UPDATEXML

Analysis:
The stack size if insufficient and there is no stack overrun check.

Fix:
Add stack overrun check.
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-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
Abhishek Bansal
MDEV-34079: ST_AsGeoJSON returns incorrect value for empty geometry

ST_AsGeoJSON stripped the first '[' bracket when serializing an EMPTY
GeometryCollection, outputting '{"type": "GeometryCollection",
"geometries":]}'.

This occurred because several Gis_*::get_data_as_json functions
unconditionally truncated the last 2 characters of their String buffer
to remove the trailing ', ' appended inside their element loops. For
empty collections, the loop doesn't execute and there is no trailing
comma, causing the truncate to strip the initial '[' bracket.

Fixed by checking if the last character in the buffer is ' ' before
truncating.
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
Merge branch '10.11' into 11.4
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() wastes less memory now)
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.
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 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.
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
Rucha Deodhar
MDEV-33843: Server crashes by stack-overflow with UPDATEXML

Analysis:
The stack size if insufficient and there is no stack overrun check.

Fix:
Add stack overrun check.
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.
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.
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.
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.
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.
Sergei Golubchik
correct sql_command_flags: add CF_CHANGES_DATA as needed

SQLCOM_REVOKE_ALL needs it because SQLCOM_REVOKE does.
SQLCOM_DROP_ROLE needs it because SQLCOM_DROP_USER does.
SQLCOM_CREATE_SERVER / SQLCOM_ALTER_SERVER / SQLCOM_DROP_SERVER
need it because SQLCOM_CREATE_USER / etc do.
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.
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.
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
ParadoxV5
MDEV-39190 mariadb-dump --dump-slave outputs partial output for old servers

When dumping from older servers, the MDEV-37146 optimization was
clever to reuse the SHOW ALL SLAVES STATUS from an earlier step.
But it forgot to rewind the tape before playing again,
so it only saw a blank screen.
It also left an extra “SHOW ALL SLAVES STATUS” text in dead code.

This commit fixes both of these oversights.
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-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.
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'
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.