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
Vladislav Vaintroub
MDEV-37556 Memory leak in proxy protocol with name resolution enabled

When proxy protocol is used and --skip-name-resolve is not set,
thd_set_peer_addr() is called twice per connection: once for the real TCP peer (in check_connection),
and again for the proxied address (in handle_proxy_header).
Each call invokes ip_to_hostname(), which allocates a hostname string
(unless loopback connection is used) and stores it as
thd->main_security_ctx.host. That code missed to free previously
allocated hostname, which results into memory leak.

This is now fixed. Also added debug-only test to mysql_client_test, which
fakes DNS and IP resolution the same way some perfschema tests do, to
emulate remote TCP connection in MTR.
bsrikanth-mariadb
run replay_server_test only if --replay-server is provided

if --replay-server option is not provided, then the test is skipped.
Daniel Black
MDEV-39829 s3.debug test failure

MDEV-39516 corrected the interface with
curl particularly around passing options.

After this the s3.debug actually enabled
curl debugging like is was meant to. With
this enabled, there are addition s3_test_
pattens in the result file, from the error
log where curl correctly provide debug
message.

Corrected the result file with the numbers
for the new test.
Rex Johnston
MDEV-39859 alter parallel scan costs to favour putting table first.
Sergei Petrunia
Rename list_ranges -> multi_range_read_info_const_calls
Vladislav Vaintroub
MDEV-37556 Memory leak in proxy protocol with name resolution enabled

When proxy protocol is used and --skip-name-resolve is not set,
thd_set_peer_addr() is called twice per connection: once for the real TCP peer (in check_connection),
and again for the proxied address (in handle_proxy_header).
Each call invokes ip_to_hostname(), which allocates a hostname string
(unless loopback connection is used) and stores it as
thd->main_security_ctx.host. That code missed to free previously
allocated hostname, which results into memory leak.

This is now fixed. Also added debug-only test to mysql_client_test, which
fakes DNS and IP resolution the same way some perfschema tests do, to
emulate remote TCP connection in MTR.
Thirunarayanan Balathandayuthapani
MDEV-39963  InnoDB system tablespace autoshrink fails when the tail  extent is an empty XDES_FREE_FRAG extent

Problem:
========
- The InnoDB system tablespace fails to autoshrink even when it is
almost entirely free. Defragmentation reports success but no
space is reclaimed, and the log shows the high-water mark pinned
at the end of the file.

fsp_traverse_extents(): when locating the last used extent,
descends from the end of the tablespace and treats an extent
as reclaimable only when it is XDES_FREE, or the descriptor-page
extent (XDES_FREE_FRAG with two used pages).
Every other XDES_FREE_FRAG extent stops the scan.

An XDES_FREE_FRAG extent with zero used pages can legitimately
exist on disk in tablespaces written by server versions between
commit 0b47c126e31 (MDEV-13542) and commit 7737f15f874 (MDEV-31333).
In that window fsp_free_page() evaluated xdes_get_n_used()
before clearing the freed page's XDES_FREE_BIT, so freeing the
last used page of a fragment extent left the empty extent on the
FSP_FREE_FRAG list instead of moving it to FSP_FREE.
7737f15f874 restored the correct ordering, but pre-existing
data files may still carry such extents.

Such an empty extent is logically identical to XDES_FREE, but
fsp_traverse_extents() mistook it for a used extent, pinned
last_used_extent at end-of-file, and the shrink reclaimed nothing.

Solution:
========
fsp_traverse_extents(): Treat an XDES_FREE_FRAG extent with no used
pages (n_used == 0) the same as XDES_FREE
Daniel Black
MDEV-31209 Queries with window functions do not obey KILL / max_statement_time

Window functions run in a loop in
Frame_cursor::compute_values_for_current_row which can include a large
number of rows.

Adjust this function to check for the current thd being killed by only
every 256 rows, so as not to destroy any CPU pipelining or similar.
Mohammad Tafzeel Shams
MDEV-38305: Expose adaptive hash index statistics in ANALYZE FORMAT=JSON

Expose InnoDB's Adaptive Hash Index (AHI) statistics through ANALYZE
FORMAT=JSON output and global status variables to provide query-level
and system-level visibility into AHI usage and effectiveness.
This allows DBAs and developers to monitor how well
the adaptive hash index is serving their workloads on a per-query basis.

The r_ahi_stats object (nested inside r_engine_stats) now reports four
key metrics: ahi_searches (successful AHI lookups), ahi_searches_btree
(AHI misses requiring B-tree fallback), ahi_rows_added (rows inserted
into AHI), and ahi_pages_added (pages indexed by AHI). These same
metrics are exposed globally via innodb_status_variables.

Transaction-local tracking eliminates contention by accumulating
statistics in trx_t fields (n_sea, n_non_sea, n_ahi_rows_added,
n_ahi_pages_added) and aggregating them into global atomic counters
during trx_t::commit_cleanup() and trx_t::free(),
following the pattern established for buf_pool.stat.n_page_gets.

AHI counters are now organized as data members of the btr_sea structure
where they logically belong, using anonymous unions to enable both
atomic writes and direct non-atomic reads.

- btr_ahi_inc_searches(): Increment trx->n_sea when AHI lookup succeeds.
- btr_ahi_inc_searches_btree(): Increment trx->n_non_sea when AHI lookup
  fails and falls back to B-tree search.
- btr_ahi_inc_rows_added(): Increment trx->n_ahi_rows_added when rows
  are added to the adaptive hash index structure.
- btr_ahi_inc_pages_added(): Increment trx->n_ahi_pages_added when new
  pages are indexed by AHI.
- btr_cur_t::search_leaf(): Call btr_ahi_inc_searches() on successful
  AHI hit and btr_ahi_inc_searches_btree() on AHI miss.
- btr_sea: Add four counter members with anonymous unions to allow atomic
  writes and lockless reads: hit_count/hit_count_nonatomic (successful AHI
  lookups), miss_count/miss_count_nonatomic (B-tree searches after AHI miss),
  rows_added/rows_added_nonatomic (rows added to AHI), and
  pages_added/pages_added_nonatomic (pages added to AHI). Also includes
  hit_count_old and miss_count_old variant for computing deltas in monitor
  output.
- btr0cur.h/btr0cur.cc: Remove global declarations and definitions of
  btr_cur_n_sea, btr_cur_n_non_sea, btr_cur_n_sea_old, btr_cur_n_non_sea_old,
  btr_ahi_n_rows_added, and btr_ahi_n_pages_added as they are now data
  members of btr_sea.
- export_var_t: Remove innodb_ahi_hit, innodb_ahi_miss, innodb_ahi_rows_added,
  and innodb_ahi_pages_added members. MySQL status variables now point
  directly to btr_search counters.
- innodb_status_variables[]: Change AHI status variable pointers from
  &export_vars.innodb_ahi_* to &btr_search.*_nonatomic, enabling zero-copy
  reads: adaptive_hash_hash_searches points to &btr_search.hit_count_nonatomic,
  adaptive_hash_non_hash_searches to &btr_search.miss_count_nonatomic,
  adaptive_hash_rows_added to &btr_search.rows_added_nonatomic, and
  adaptive_hash_pages_added to &btr_search.pages_added_nonatomic.
- MONITOR_OVLD_ADAPTIVE_HASH_ROW_ADDED, MONITOR_OVLD_ADAPTIVE_HASH_PAGE_ADDED:
  Convert monitor counters to "overload" type that read from atomic counters
  btr_search.rows_added and btr_search.pages_added respectively instead of
  maintaining separate statistics.
- trx_t::commit_cleanup() and trx_t::free(): Update transaction cleanup to
  increment btr_search.hit_count, btr_search.miss_count, btr_search.rows_added,
  and btr_search.pages_added instead of the old global counters.
- trace_engine_stats(): Output r_ahi_stats object with all four AHI
  counters in JSON format when any AHI activity is detected during query
  execution.
- ha_handler_stats: Added ahi_searches, ahi_searches_btree, ahi_rows_added,
  and ahi_pages_added fields to track per-query AHI statistics.
- Add mtr parameter to btr_search_move_or_delete_hash_entries(),
  btr_cur_t::search_info_update(), btr_search_update_hash_on_insert(),
  btr_search_update_hash_ref(), btr_search_info_update_hash(), and
  btr_search_build_page_hash_index() to allow updating AHI statistics.
- ahi_stats.test: Comprehensive verification of AHI statistics reporting
  across different scenarios: insufficient accesses (no AHI build),
  threshold triggering (AHI construction), heavy warmup (full AHI
  utilization), and disabled AHI (verify zero statistics).
- check_ahi_status.inc: Reusable include file for executing queries with
  configurable warmup repetitions and extracting AHI statistics from
  ANALYZE FORMAT=JSON output using JSON path expressions.
Marko Mäkelä
MDEV-39971: generate_option_list may invoke pclose(nullptr)

call_mariadbd(): Remove the redundant and potentially harmful call
of my_pclose(f) when my_popen() failed. At least in some versions
of GNU libc the function pclose(3) is declared with
__attribute__((nonnull)).

Fixes up commit 7828fb475b00d4211ba8ce1ec6e9a1b06e0fc39b (MDEV-32745)
Sergei Petrunia
Make mtr accept and ignore  "--disable_replay next_query|test_file text" command
Sergei Petrunia
Rename list_records_in_range -> records_in_range_calls
Vladislav Vaintroub
MDEV-39951 DENY feature does not work for EVENT privilege

Fix calculation of need_table_or_column_check in check_access(),
so it does not consider already denied bits on DB level.

Add a test case for events (provided by Ramesh Sivaraman)
Sergei Petrunia
More include file renames.
Vladislav Vaintroub
MDEV-39951 DENY feature does not work for EVENT privilege

Fix calculation of need_table_or_column_check in check_access(),
so it does not consider already denied bits on DB level.

Add a test case for events (provided by Ramesh Sivaraman)
Yuchen Pei
[fixup] Move tests requiring an example plugin from sys_vars.session_track_system_variables_basic to a separate test

A follow up to 1f56d9c3feeeca82661cbe57cb628207c8b186f8. This restores
test coverage when the example plugin is not built.
Sergei Petrunia
Revert the --replay-server mtr feature
bsrikanth-mariadb
Disable a couple of main.cte_recursive tests when run in replay-server mode

They can be re-enabled after MDEV-39978 is resolved
Sergei Petrunia
Rename include/get_rec_idx_ranges_from_opt_ctx.inc, cleaner printouts

New name: include/opt_context_list_tables_and_ranges.inc
Yuchen Pei
MDEV-39805 MDEV-39790 signal EOF in "unordered" partition index scans

This is a follow-up fix to MDEV-39535
96531691c18ebea4993454ee9d355e60ad9bea07 and MDEV-20195
8721a00dd38dc0aa1514a3b5ca8c95c6e94af1c9.

In those two fixes we added check for m_part_spec.start_part ==
NO_CURRENT_PART_ID (a typical sign of EOF) in
ha_partition::handle_unordered_prev and
ha_partition::handle_unordered_next respectively. However, because of
MDEV-37330 496aecf9251e3d74b83285f4e787daa9d8c37ae4, we skip a call to
handle_unordered_scan_next_partition inside these functions on
EOF (error == HA_ERR_END_OF_FILE and we have run out of partitions to
scan), whereas prior to MDEV-37330
496aecf9251e3d74b83285f4e787daa9d8c37ae4, it would call
handle_unordered_scan_next_partition which sets
m_part_spec.start_part= NO_CURRENT_PART_ID.

So in this patch we restore setting m_part_spec.start_part to
NO_CURRENT_PART_ID to signal EOF.
Marko Mäkelä
fixup! f257584af9db2d2d435bdb2696515c54311663bc
Monty
Fix hp_blob_key_length() to return uint32

uint32 is correct as blobs in heap cannot be bigger than 4G by design.
Dave Gosselin
MDEV-39914:  Crash in ST_SIMPLIFY used in an IN list

A geometry function writes its binary result into a buffer given by
the caller.  ST_SIMPLIFY did not set the charset of that buffer.  A
constant value in an IN list, though, is stored into the array that IN
builds for its comparisons, and that array has no charset.  Appending
the geometry then read an invalid charset and crashed the server.

Set the result buffer to the binary charset before writing the
geometry, matching what the other geometry functions already do.
Marko Mäkelä
squash! 10539aa463aceed07c0c08b52d944a0d5e054525
Thirunarayanan Balathandayuthapani
MDEV-39963  InnoDB system tablespace autoshrink fails when the tail  extent is an empty XDES_FREE_FRAG extent

Problem:
========
- The InnoDB system tablespace fails to autoshrink even when it is
almost entirely free. Defragmentation reports success but no
space is reclaimed, and the log shows the high-water mark pinned
at the end of the file.

fsp_traverse_extents(): when locating the last used extent,
descends from the end of the tablespace and treats an extent
as reclaimable only when it is XDES_FREE, or the descriptor-page
extent (XDES_FREE_FRAG with two used pages).
Every other XDES_FREE_FRAG extent stops the scan.

An XDES_FREE_FRAG extent with zero used pages can legitimately
exist on disk in tablespaces written by server versions between
commit 0b47c126e31 (MDEV-13542) and commit 7737f15f874 (MDEV-31333).
In that window fsp_free_page() evaluated xdes_get_n_used()
before clearing the freed page's XDES_FREE_BIT, so freeing the
last used page of a fragment extent left the empty extent on the
FSP_FREE_FRAG list instead of moving it to FSP_FREE.
7737f15f874 restored the correct ordering, but pre-existing
data files may still carry such extents.

Such an empty extent is logically identical to XDES_FREE, but
fsp_traverse_extents() mistook it for a used extent, pinned
last_used_extent at end-of-file, and the shrink reclaimed nothing.

Solution:
========
fsp_traverse_extents(): Treat an XDES_FREE_FRAG extent with no used
pages (n_used == 0) the same as XDES_FREE
Daniel Black
BB can you give a s3 saved dir for MDEV-39829
Sergei Petrunia
Revert the --replay-server mtr feature
Vladislav Vaintroub
MDEV-39951 DENY feature does not work for EVENT privilege

Fix calculation of need_table_or_column_check in check_access(), so it does
not include already denied bits.

Added a test case for events, provided by Ramesh Sivaraman
Sergei Petrunia
Rename: list_index_read_costs -> cost_for_index_read_calls
Marko Mäkelä
MDEV-39971: generate_option_list may invoke pclose(nullptr)

call_mariadbd(): Remove the redundant and potentially harmful call
of my_pclose(f) when my_popen() failed. At least in some versions
of GNU libc the function pclose(3) is declared with
__attribute__((nonnull)).

Fixes up commit 7828fb475b00d4211ba8ce1ec6e9a1b06e0fc39b (MDEV-32745)
Thirunarayanan Balathandayuthapani
- Addressed the failures
Dave Gosselin
MDEV-36891:  std::make_pair compiler note

Construct the pair in place with emplace_back to silence the build
note.
Thirunarayanan Balathandayuthapani
MDEV-39963  InnoDB system tablespace autoshrink fails when the tail extent is an empty XDES_FREE_FRAG extent

Problem:
========
- The InnoDB system tablespace fails to autoshrink even when it is
almost entirely free. Defragmentation reports success but no
space is reclaimed, and the log shows the high-water mark pinned
at the end of the file.

fsp_traverse_extents(): when locating the last used extent,
descends from the end of the tablespace and treats an extent
as reclaimable only when it is XDES_FREE, or the descriptor-page
extent (XDES_FREE_FRAG with two used pages).
Every other XDES_FREE_FRAG extent stops the scan.

An XDES_FREE_FRAG extent with zero used pages can legitimately exist
on disk: it is left behind when an emptied fragment extent is not
moved from FSP_FREE_FRAG to FSP_FREE (the condition fixed in
MDEV-31333) . Such an empty extent is logically identical to
XDES_FREE, but the traversal mistakes it for a used extent,
pins last_used_extent at the end of the file, and the shrink
reclaims nothing.

Solution:
========
fsp_traverse_extents(): Treat an XDES_FREE_FRAG extent with no used
pages (n_used == 0) the same as XDES_FREE
Dave Gosselin
MDEV-36891:  std::make_pair compiler note

Construct the pair in place with emplace_back to silence the build
note.
Sergei Petrunia
Rename "list_contexts" to "tables"
Sergei Petrunia
Make mtr accept and ignore  "--disable_replay next_query|test_file text" command
Dave Gosselin
MDEV-39952:  Skip tests that need mariabackup

Skips tests that require mariabackup if mariabackup was not
built (WITH_MARIABACKUP=OFF).

Backport of the same MTR change from 12.3 but applied to
additional tests.
Alexander Barkov
MDEV-39587 Package-wide TYPE for variable declarations

SET sql_mode=ORACLE;
DELIMITER $$
CREATE OR REPLACE PACKAGE pkg AS
  -- Declare a package public data type
  TYPE varchar_array IS TABLE OF VARCHAR(2000) INDEX BY INTEGER;
END;
$$
DELIMITER ;
DELIMITER $$

CREATE OR REPLACE PROCEDURE p1 AS
  v pkg.varchar_array; -- Use the package public data type
BEGIN
  v(0):='test';
  SELECT v(0);
END;
$$
DELIMITER ;

Note, the change is done only for sql_mode=ORACLE, because the TYPE
declaration is not available for the default mode.

Where package-wide types are available
--------------------------------------
- Variabe list type:
    DECLARE var pkg1.type1;

- RETURN type for a package routine:
    CREATE FUNCTION .. RETURN pkg1.type1 ...

- Parameter type for a package routine:
    PROCEDURE p1(param1 pkg1.type1);

- Assoc array element type:
    TYPE assoc1_t IS TABLE OF pkg1.type1 ...

- REF CURSOR RETURN type:
    TYPE cur1_t IS REF CURSOR RETURN pkg1.type1;

Change details
--------------

- Adding a member Lex_length_and_dec_st::m_foreign_module_type
  It's set to true when the data type was initialized from a TYPE
  in foreign routine (e.g. in PACKAGE spec).
  It's needed to prevent use of qualified identifiers in public contexts,
  i.e. in schema public routine parameter types and schema publuc function
  RETURN types.
  Adding a helper method sp_head::check_applicability() which prevents
  use of qualified types in public context.

- Adding a helper method sp_head::raise_unknown_data_type().

- Adding methods LEX::set_field_type_typedef_package_spec() for
  2-step and 3-step qualified indentifiers.
  It's used in field_type_all_with_typedefs which covers cases:
  - Variabe list type        : DECLARE var pkg1.type1;
  - RETURN type              : CREATE FUNCTION .. RETURN pkg1.type1 ...
  - Parameter type          : PROCEDURE p1(param1 pkg1.type1);
  - Assoc array element type : TYPE assoc1_t IS TABLE OF pkg1.type1 ...

- Adding a method LEX::declare_type_ref_cursor_return_typedef().
  It handles cases when a new TYPE REF CURSOR RETURN is declared,
  for both for qualified RETURN types and non-qualified RETURN types:
  - TYPE cur0_t IS REF CURSOR RETURN rec1_t;
  - TYPE cur0_t IS REF CURSOR RETURN pkg1.rec1_t;
  - TYPE cur0_t IS REF CURSOR RETURN db1.pkg1.rec1_t;

  The code was moved from LEX::declare_type_ref_cursor() into
  LEX::declare_type_ref_cursor_return_typedef() and extended
  to cover qualified RETURN types.

- Adding a method Sql_path::find_package_spec_type().
  It iterates through all schemas specified in @@path and searches
  for the given type in the given package.

- Adding a helper method sp_pcontext::type_defs_add_ref_cursor()
  to reuse the code.

- Adding a new method sp_package::get_typedef() to search
  for TYPE definitions in PACKAGE specifications.

- Adding a new method sp_head::get_typedef_package_spec()
  to search for TYPE definitions used by a PROCEDURE or FUNCTION.

- Adding a helper method
    Sp_handler::sp_cache_routine_reentrant_suppress_errors
  Adding a method Sp_handler::find_package_spec().
Daniel Black
MDEV-33532 s3.debug test fails with ps-protocol

No easy solution. The storage engine is quite
removed from the ps-protocol so just disable it.