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-28619 with_flags cleanup

The best practice is to init as much info as possible in class
constructor. with_flags access may be needed before fix_fields() or
fix_fields() may be not called at all like it takes place in
MDEV-28619. The fix for MDEV-28619 requires WINDOW_FUNC check on
unfixed item.
Sergei Golubchik
MDEV-38868 Assertion `*str != '\0'' failed in my_message_sql on CREATE TABLE

avoid empty error messages in failed CONNECT assisted discovery
Aleksey Midenkov
MDEV-27569 Valgrind/MSAN errors in ha_partition::swap_blobs

row_sel_store_mysql_field() does:

3113                    mysql_rec[templ->mysql_null_byte_offset]
3114                            &= static_cast<byte>(~templ->mysql_null_bit_mask);

but mysql_rec[] which is prefetch buffer was allocated without
initialization. Prefetch buffers are allocated by
row_sel_prefetch_cache_init():

3881            ptr = static_cast<byte*>(ut_malloc_nokey(sz));

and then it initializes the buffers with the magic numbers.

The fix initializes the buffers with null bytes as well for nullable
fields.
Aleksey Midenkov
MDEV-38798 Assertion `mdl_key->length() == 3' failed in MDL_map::find_or_insert

Originally two MDL_EXCLUSIVE are used for pure alias of derived table
and its schema which is empty db name. It is concurrency performance
overhead and there is no obvious reason why such MDL should exist.

MDEV-33985 changed pure alias check from `db.str` to `db.length` and
that allowed `empty_c_string` to be pure alias too. It is important
for MDEV-33985 fix with sequences. Now such kind of pure alias skips
MDL initialization and thus derived table fails falsely on BACKUP
namespace as it is default namespace for 0-filled structure (see TODO
comments).

The fix a) keeps MDL_NOT_INITIALIZED for uninitialized MDL and that
was the consequence of MDL_INTENTION_EXCLUSIVE value 0 (see TODO
comment).

And b) does not update MDL type for pure alias when view is
initialized, so it is MDL_NOT_INITIALIZED. `lock_table_names()` code
naturally skips such kind of MDL with (mdl_request.type <
MDL_SHARED_UPGRADABLE) condition when processing tables list.
Marko Mäkelä
MDEV-11426 fixup: Remove fil_node_t::init_size

The field fil_node_t::init_size that had been added in
mysql/mysql-server@38e3aa74d8d2bf882863d9586ad8c9e9ed2c4f00
should have been removed in 0b66d3f70d365bbb936aae4ca67892c17d68d241.
Sergei Golubchik
CONNECT: suppress \n at the end of the error message
Aleksey Midenkov
MDEV-25365 More query cache debug trace

Usage:

mtr --mysqld=--debug=d,qcache,query:i:O,/tmp/qcache_full.log
sed -nre '/(move_by_type|dispatch_command|pack_cache)/ p' \
    < /tmp/qcache_full.log \
    > /tmp/qcache.log
Oleg Smirnov
MDEV-28817: Derived table elimination fails when field aliases are used

When a derived table's SELECT list contains the same column under
multiple aliases (e.g. "SELECT a, b, a as a2 FROM t2 GROUP BY a, b"),
the table elimination logic failed to recognize that the aliased
column is also part of the GROUP BY pseudo-key.

The root cause was in find_field_in_list() which only recorded the
first matching position in the SELECT list for each GROUP BY element.
If the ON clause referenced the column via a different alias (a later
position), covers_field() would not find it in the pseudo-key bitmap.

Fix: find_field_in_list() now marks ALL matching positions in the
SELECT list, so every alias of a GROUP BY column is recognized as
part of the pseudo-key.
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)
Abhishek Bansal
MDEV-9247: Make default_master_connection settable globally

Currently, default_master_connection can only be set on session level. Using SET GLOBAL we get the following error:
ERROR 1228 (HY000): Variable 'default_master_connection' is a SESSION variable and can't be used with SET GLOBAL

The solution is to change the variable scope from SESSION_ONLY to SESSION_VAR.

Reviewed-by: [email protected]
Sergei Golubchik
connect fix odbc_sqlite3 test
bsrikanth-mariadb
MDEV-37904: Use of un-initialized value

valgrind reported use of an un-initialized value, when trying to write
analyzed plan to json. Instead of fetching c_str() from the string
object and passing it to the writer object's add_string() method, one could
use an overridden add_string() that accepts a different string object.
This would avoid the valgrind warnings.
Aleksey Midenkov
MDEV-25365 Cleanups
Aleksey Midenkov
MDEV-38710 Assertion is_lock_owner on error returning from auto-create in mysql_admin_table

Followup commit for 4802bfe4f90.

After returning error from check_vers_constants() the stack
immediately returns error status up to mysql_admin_table() where it
does close_thread_tables(). The latter expects MDL acquired.

The bug discloses the generic problem of fallback mechanism throwing
an error when the upper frame does close_thread_tables().
Arcadiy Ivanov
MDEV-37977 InnoDB deadlock report incorrectly reports rolled back transaction number

The "WE ROLL BACK TRANSACTION (N)" message in the deadlock report
referred to the wrong transaction number. The victim selection loop
and the display loop in `Deadlock::report()` traversed the cycle in
the same order (`cycle->wait_trx, ..., cycle`) but used misaligned
position numbering:

- **Victim selection** initialized `victim = cycle` at position 1
  *before* the loop, then started iterating from `cycle->wait_trx`
  at position 2.
- **Display loop** started from `cycle->wait_trx` at label `(1)`,
  with `cycle` displayed last at label `(N)`.

This caused `victim_pos` to be off by one relative to the displayed
transaction labels.

Fix: restructure the victim selection loop to start with `l=0` and
`victim=nullptr`, letting the loop handle all transactions uniformly.
The first iteration unconditionally picks `cycle->wait_trx` as the
initial victim at position 1, matching the display loop. The
`thd_deadlock_victim_preference()` call is guarded with a
`victim != nullptr` check to skip it on the first iteration (where
no prior victim exists to compare against).
Raghunandan Bhat
MDEV-31284: SIGSEGV in VDec2_lazy::VDec2_lazy | Item_func_plus::decimal_op

Problem:
  When a query contains large number arithmatic operations (e.g.
  addition) on numbers, it can trigger deep recursion leading to a stack
  overrun and crashing the server. Currently, the server checks for
  stack overruns only during `fix_fileds` time and not during the
  execution of the query.

Fix:
  Introduces a stack overrun check druing the execution of query to
  prevent crash during the execution time.
Aleksey Midenkov
MDEV-25365 Server hangs or crashes in Query_cache::move_by_type upon FLUSH QUERY CACHE

Caused by Bug#988 in 702b5ad.

How it works

QUERY blocks has all its tables in the array coming after
Query_cache_block header. Each such table element
(Query_cache_block_table) is also an element of doubly-linked circular
list associated with TABLE block used to find all queries by a
table. TABLE block data() is actually Query_cache_table: identificator
for table elements by real name. Every element in the circular list
has `parent` set to such Query_cache_table, except the list root. The
list root is the only Query_cache_block_table element owned by a TABLE
block, all other elements are owned by QUERY blocks. Thus TABLE block
n_tables is always 1.

FREE blocks are transformed into gap pointed by `border`. All the
QUERY and TABLE blocks are moved in place of the gap providing free
space defragmentation. Moving is done by creating new block at the
location of the gap and then doing memmove() from an old block to new
block. This may involve blocks overlap when the distance between the
blocks is less than the block size.

What was broken

When the old and the new QUERY blocks overlap, pointer can be in range
of both of them and checking the range does not guarantee affiliation
of the pointer with the old block. Such intra-block checks added by
Bug#988 can wrongly work on an already updated pointer.

In the test case small gap allows both tables 16 and 17 to be in the
overlapping region of old and new blocks. Iteration 16 updated
`prev->next` on the normal manner and the `prev` was table 17.
Iteration 17 sees this `next` as a pointer coming from an old block
though really it is already for a new block (as small gap shift allows
table 16 to be in both blocks), and it shifts it to the wrong
location. That have broken TABLE block circular chain.

How it was fixed

The fix modifies intra-block checks to work only in the forward
direction. F.ex., current table jx references intra-block by `next`
another table jy in later iteration (jx < jy) and we shift this `next`
pointer. Then by normal code (pre-Bug#988) we update `next->prev`. At
iteration jy we skip intra-block check for `prev` as it is in the past
iteration and was updated by iteration jx. The same happens for the
opposite direction, there is no semantic difference between `next` and
`prev` pointers.
Alexey Botchkov
MDEV-38767 XML datatype to be reported as format in extended metadata in protocol.

add Send_field metadata for UDT.
Aleksey Midenkov
MDEV-27569 Valgrind/MSAN errors in ha_partition::swap_blobs

row_sel_store_mysql_field() does:

3113                    mysql_rec[templ->mysql_null_byte_offset]
3114                            &= static_cast<byte>(~templ->mysql_null_bit_mask);

but mysql_rec[] which is prefetch buffer was allocated without
initialization. Prefetch buffers are allocated by
row_sel_prefetch_cache_init():

3881            ptr = static_cast<byte*>(ut_malloc_nokey(sz));

and then it initializes the buffers with the magic numbers.

The fix initializes the buffers with null bytes as well for nullable
fields.
Marko Mäkelä
fixup! 1a013273a12fca45d7ae72ab68662742675c9ae2

Fix the build on FreeBSD and Microsoft Windows
Thirunarayanan Balathandayuthapani
MDEV-24356 InnoDB: Failing assertion: len < sizeof(tmp_buff) in get_foreign_key_info

get_foreign_key_info(): Changed tmp_buff size from NAME_LEN+1
to MAX_DATABASE_NAME_LEN+1 to accommodate encoded database names.
The buffer stores the database name extracted from
referenced_table_name and foreign_table_name, which can contain
encoded special characters (In this case dots encoded as @002e).
With encoding, database names can exceed NAME_LEN (64 bytes) even
if the logical name is within limits.
Oleg Smirnov
MDEV-37792 MSAN: use-of-uninitialized-value on DELETE from sequence table

SEQUENCE is a pseudo-engine intended to produce sequential numbers.
This engine has HTON_HIDDEN flag, and optimizer costs for such engines
are zeroed and marked with MEM_UNDEFINED() macro.

However, some code paths still examine optimizer costs during
execution of queries involving SEQUENCE tables. For example,
deletion from a sequence table, despite being invalid, still evaluates
costs of access to the table before producing an error. This makes
MSAN trigger on the error "use-of-uninitialized-value".

Not to overcomplicate the logic for handling such scenarios,
this patch simply removes MEM_UNDEFINED() macro for engines with
HTON_HIDDEN flag.
Vladislav Vaintroub
MDEV-33083 AFTER UPDATE trigger sometimes does not fire "ON DUPLICATE KEY UPDATE"

Prior to this change, AFTER UPDATE did not fire, if data was unchanged.

Now this is fixed. Also added a test to verify that trigger behavior for
on-duplicate-update is the same as normal update, in case data does not
change.
Georg Richter
Follow up of 5fe4d03f26045d1215e894d16054935ddd65ecc0:

Always initialize length variables of MYSQL_BIND structure
to make MSAN happy.
Rucha Deodhar
MDEV-39119: Improve error handling when using OLD_VALUE as alias name

Analysis:
Since OLD_VALUE_SYM was part of reserved keywords, it did not allow
old_value in the alias.
Fix:
Change OLD_VALUE_SYM from reserved keyword to keyword_sp_var_and_label.
Sergei Golubchik
MDEV-38827 Assertion `str[strlen(str)-1] != '\n'[ || strlen(str) == 512-1]' failed in my_message_sql

remove trailing '\n' from CONNECT error messages
Rucha Deodhar
MDEV-39127: UBSAN : downcast of address X which does not point to an object
of type 'multi_update' in sql/sql_update.cc
| Sql_cmd_update::update_single_table

Analysis:
the 'result' object was being incorrectly used which maybe of the type
multi_update.This caused UBSAN error due to an invalid downcast in
Sql_cmd_update::update_single_table().

Fix:
Introduce a dedicated returning_result object for handling RETURNING output
instead of reusing result. This ensures the correct result handler is used
and avoids unsafe casts.
Marko Mäkelä
Implement copying on POSIX

TODO: Implement proper locking

TODO: Create missing the directory on Microsoft Windows
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ä
fixup! 0ee4de89de1bab0f7d417532a99c706bcd0f609a
Vladislav Vaintroub
MDEV-33083 AFTER UPDATE trigger sometimes does not fire "ON DUPLICATE KEY UPDATE"

Prior to this change, AFTER UPDATE did not fire, if data was unchanged.

Now this is fixed. Also added a test to verify that trigger behavior for
on-duplicate-update is the same as normal update, in case data does not
change.
Raghunandan Bhat
MDEV-31284: SIGSEGV in VDec2_lazy::VDec2_lazy | Item_func_plus::decimal_op

Problem:
  When a query contains large number operations (e.g. addition) on
  decimal numbers, it can trigger deep recursion leading to a stack
  overrun and crashing the server. Currently, the server checks for
  stack overruns only during `fix_fileds` time and not during the
  execution of the query.

Fix:
  Introduces a stack overrun check druing the execution of query to
  prevent crash during the execution time.
Aleksey Midenkov
MDEV-28619 Server crash and UBSAN null-pointer-use in Window_funcs_sort::setup

Optimization in st_select_lex_unit::prepare() removes ORDER BY for
certain subqueries. That excludes ORDER BY items from being fixed, but
sl->window_funcs still contains window function items and those
related to optimized out ORDER BY are unfixed. The error about missing
window spec is thrown when the item is fixed. Hence we get redundant
processing of window function items without checking window spec
existence.

The fix removes the related window function items when ORDER BY is
optimized out. ORDER accumulates window_funcs at parser stage which
are then removed from SELECT_LEX::window_funcs. The fix also updates
similar optimization in mysql_make_view().
Marko Mäkelä
fixup! 4cd4d5bebc4bc6ec2334e980525f0245e774e919
forkfun
MDEV-32770 mariadb-dump produces not loadable dump due to temporary view structure

When mariadb-dump produces a dump, it first creates a temporary placeholder for views
to satisfy potential dependencies before their actual creation later in the dump file.
Previously, these views were populated with int literals for their columns (1 AS `col_name`).
This could cause syntax or type-resolution errors during restoration if another view depended
on this placeholder view.

This commit changes the placeholder column values from 1 to NULL, as it is more permissive
and allowing the dump to be restored successfully.
Alexey Botchkov
MDEV-38767 XML datatype to be reported as format in extended metadata in protocol.

add Send_field metadata for UDT.