Skip to content

PXC-5276 [9.7] Packaging tasks for release - PXC 9.7.2 - #2398

Merged
adivinho merged 820 commits into
9.7from
release-9.7.2-2
Nov 12, 2026
Merged

adivinho merged 820 commits into
9.7from
release-9.7.2-2

Conversation

@adivinho

@adivinho adivinho commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Chaithra-MG and others added 30 commits June 26, 2026 17:26
Due to a mistake, a NULL value check was made for the wrong argument.

Fixed by checking the correct NULL value.

Change-Id: I6cd654ca2faf9c07f817ad415b66efe29f0984c3
The fix for Bug#36578540 makes ForceMaterializationBeforeSort()
insert a STREAM step for ORDER BY expressions with RAND_TABLE_BIT.
HypergraphOptimizerTest.NoSortAheadOnNondeterministicFunction then
crashes in FinalizePlanForQueryBlock(), which tries to create the
backing temporary table, but gunit runs without temporary table
engines (TEST_NO_TEMP_TABLES).

The test only inspects plan shape, so call FindBestQueryPlan()
without finalization. Also assert that the STREAM step is present,
so the test guards the Bug#36578540 fix.

Change-Id: I59d8613fa74f9c820db58d1e77fa6177867e60a5
…ral string

Due to a mistake, two return values were true instead of false.
This caused wrong results in certain IN queries with temporal values
and strings.

The problem is fixed by replacing true with false.

Change-Id: Id6d76c783518f28f0f4f0766807fc416c47842ae
Due to a missing orthogonality in Item_func_json_value::val_date(),
a JSON_VALUE expression with RETURNING DATETIME, when casting result
to DATE, an invalid value was returned.

Fixed by calling a new function Item::get_date_from_datetime() instead
of extract_date_value() for this case.

Change-Id: Ie58a178f380f0204eaa6d64b71c6cab8a96f2ac3
…Hook()' failed.

Problem:
========
A query using the hypergraph optimizer with GROUP BY ROLLUP on a
constant expression and an empty USE INDEX FOR GROUP BY() hint could
assert during planning.

Since ROLLUP is present, the query is still aggregated. Aggregation
planning could end up with no candidate plan, causing
FindBestQueryPlanInner() to assert that this only happens when a
secondary engine cost hook is present.

Root Cause:
===========
A constant ROLLUP expression reduced the required logical grouping order
to the empty ordering. When deciding whether grouping requires a sort,
the optimizer checks whether the required grouping order is already
provided by the chosen access path, and whether any index used for that
order is allowed by the GROUP BY index hint. USE INDEX FOR GROUP BY()
with an empty index list means that no index may be used for GROUP BY,
so the proposed access path was rejected even though the empty grouping
order did not require any index ordering.

The optimizer then treated the query as needing a grouping sort. However,
empty orderings are not represented as sort-ahead orderings, so no sorted
aggregate path could be generated. As a result, no aggregate access path
was proposed.

Solution:
=========
Do not require index-order hint validation when the GROUP BY ordering is
empty. No index order is needed for a constant grouping expression, so
the streaming aggregate path can be proposed.

Change-Id: I385234fc058f2b298eeea4080bab88f76f470012
Approved-by: Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
Change-Id: I52b7309024d3d021fad0c019974248c8525059f9
Change-Id: I2fabf5e021c2025ffb0cdb142862183728465969
Approved-by: Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
Change-Id: Id779828c32d0746f3c085f7a0d48194a70add10b
Change-Id: I6a0226e3b43460e454d82c184ab5f82b832da445
Approved-by: Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
Change-Id: I5bac489a5fa37f07f0fe3496f39430d79a0b4f83
Approved-by: Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
Change-Id: I603772b28475f926d76ce0a8bf03d838c92a4876
Approved-by: Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
Change-Id: Iae09488511e954303010ef71cc96c2d58d5a605c
Approved-by: Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
Change-Id: I614884101f07023a3c37386cc2f7b669652a41f3
Approved-by: Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
Change-Id: I95ac6c503e2ecd3b949dc34c5cac0c8ae433b532
Problem
-------
Valgrind reported a "Conditional jump or move depends on uninitialised
value(s)" error in log_line_submit() (log_builtins.cc:1343) triggered
from three distinct wsrep/mysqld code paths:

  1. wsrep_cluster_address_update (wsrep_var.cc:566)
     → wsrep_stop_replication → wsrep_close_client_connections
     → log_message → log_vmessage → log_line_submit
     Reproducible in: wsrep.wsrep_cluster_address_basic (9 mysqld instances)

  2. wsrep_reject_queries_update (wsrep_var.cc:505)
     → wsrep_close_client_connections → log_message → log_line_submit
     Reproducible in: galera.thread_pool_shutdown (4 instances)

  3. unireg_abort (mysqld.cc:2874)
     → wsrep_close_client_connections → log_message → log_line_submit
     Reproducible in: startup-failure paths (4 instances)

Root cause
----------
PS 8.4.10 added a new 'flags' field (log_line_flags_mask) to the
_log_line struct to support OpenTelemetry telemetry routing:

  typedef struct _log_line {
    log_item_type_mask seen;
    log_item_iter      iter;
    log_item           output_buffer;
    int                count;
    log_item           item[LOG_ITEM_MAX];
    log_line_flags_mask flags;       /* ← new field */
  } log_line;

log_line_init() (log_builtins.cc:604) correctly initialises the struct
with memset + sets flags = LOG_LINE_EMIT_TELEMETRY.

However, log_vmessage() (log.cc:2533) uses a stack-allocated log_line
and only initialised 'count' and 'seen', leaving 'flags' as garbage:

  log_line ll;
  ll.count = 0;
  ll.seen  = 0;
  /* ll.flags ← uninitialised */

log_line_submit() then reads ll->flags at line 1343:

  if (ll->flags & LOG_LINE_EMIT_TELEMETRY) { ... }

causing the Valgrind error on any code path that reaches log_vmessage()
(i.e., all sql_print_information / log_message / log_errlog_formatted
callers, not just wsrep).
https://perconadev.atlassian.net/browse/PS-11297

validate_rec_offset() in the rec_offs_*() helpers of rem0wrec was called
unconditionally, including in non-debug builds where it does no useful work.
Wrap these calls in ut_d() so they are compiled only in debug builds, removing
the per-call overhead on release builds.
…ble using InnoDb DYNAMIC row format

The fix for Bug#39129182 'Mysqld Crash due to "Deadlock Detected!" Error',
made the estimation returned by get_field_max_size() more accurate, as
was necessary to correctly decide if a page split or merge could happen,
and thus help decide if a stronger latch on ancestor pages will be
necessary, and take it ahead of time to avoid deadlock. This is used
during each descent into a B-tree.

This function is also used in a DDL context, to decide if a newly
proposed shape of a table, say in CREATE TABLE, could lead to row which
can't fit into a page. When innodb_strict_mode is ON, such DDLs would be
rejected. When OFF, it would only emit a warning.

Thus, the change in get_field_max_size() resulted in observable change
in behaviour in LTS versions of MySQL, which on itself is unavoidable
when fixing any bug.

Despite this change was arguably allowed by spec and made the
behaviour more strict, it caused a lot of problems for existing
applications and their maintainers, as deploying innodb_strict_mode=OFF
workaround to thousands of db systems was difficult.

So, due to overwhelming community demand, the current patch brings back
the old behaviour during DDL operations, while preserving the new
behaviour during B-tree descent, by splitting the function into two.

Note that for ALTER TABLE using ALGORITHM=INSTANT, the legacy behaviour
was unsafe, and thus in this case we use the new, more accurate
estimator, to avoid problems related to big DEFAULT values.

We'd like to thank:
* Paweł Olchawa from Percona, for suggesting this idea,
* Meng-Hsiu Chiang from Amazon, who proposed the test cases

Change-Id: I1dcb6ec545106c811bfbdef5aa9c9d48b2da4a4e
PXC-4932: Code refresh for - PXC 8.4.10
…tion on BUF_BLOCK_MUTEX by reading ahead the access_time)
PS-11253 [8.4]: Fix heap-use-after-free when granting external roles

PROBLEM 1
When OpenID Connect authentication maps external roles during login,
acl_authenticate() called grant_role() with mpvio->acl_user. That
ACL_USER is a copy allocated on the connection's mem_root and is freed
when dispatch_command() ends.

grant_role() stores ACL_USER by value in the role graph, including the
raw user/host pointers. Later DROP USER walks that graph and reads those
pointers after the mem_root was cleared, causing a heap-use-after-free
(ASAN failure in auth_openid_connect.idp cleanup).

FIX 1
Lookup the durable ACL cache entry with find_acl_user() and pass that
to grant_role() instead of the mem_root copy.

PROBLEM 2
An external role once granted was not revoked until the server restarts.

FIX 2
Compare roles returned by authentication plugin with roles already granted.
Revoke external roles that are no longer granted by the plugin.
Simplified external roles container (the external roles always have
empty hostname).
Upstream added OIDC authentication in 9.x, by this commit
the client side plugin is backported to 8.4.

Follow up of WL#16269 OpenID Connect (Oauth2 - JWT) Authentication Support

Change-Id in upstream: I11944643d4a6098312edd16550c0160e86905063

The upstream commit introduces client side OpenID Connect authentication
plugin to MySQL 9.x. Here we port it to 8.4 as part of work on Percona
OpenID Connect authentication.
OpenID Connect pluggable authentication is a parity feature
with MySQL Enterprise Edition. It allows users to authenticate
to Percona MySQL Server using OpenID Connect.

The user connecting to the server must identify itself with
ID Token previously obtained from an Identity Provider.
The server verifies if the token was signed by user’s Identity
Provider (IDP) and if token’s subject matches user’s name in
the Identity Provider domain.

The plugin supports group-role mapping and proxy accounts.

This commit gathers the following tasks:
 PS-10849: OpenID Connect Pluggable Authentication
 PS-11017: MTR tests
 PS-11018: Add proxy support to OIDC authentication
 PS-11065: Telemetry support for OpenID Connect authentication
 PS-11220: Add MySQL instrumentation to memory
…IR error

Update percona-xtradb-cluster-galera submodule to include the fix for
cmake failure when building with -DINSTALL_LAYOUT=RPM:
PXC-4932: Update galera submodule - fix cmake RPM layout INSTALL_DOCD…
…hes MySQL Router

https://perconadev.atlassian.net/browse/PS-11329

Bug#39204635 mysql/mysql-server@6adc159923b

Description
===========
For X Protocol routing with `client_ssl_mode=PREFERRED` and
`server_ssl_mode=AS_CLIENT`, a client can send
`CON_CAPABILITIES_SET(tls=true)` after TLS is already active.

Router accepted this second TLS capability request and re-entered
the TLS upgrade path. During `tls_accept_finalize()`, the server-side
TLS channel could already be initialized, which led to a `logic_error`
and connection termination.

Fix
===
Reject repeated TLS capability upgrades when client-side TLS is already
active. For a second `tls=true` capability request, Router now returns
error 5001 (`Capability prepare failed for 'tls'`) and continues normal
session handling.

Change-Id: Ifaaa93eeec1019160c7a6db50daa7e1af8f383c5

Co-authored-by: Lukasz Kotula <lukasz.kotula@oracle.com>
https://perconadev.atlassian.net/browse/PS-11329

Bug#39116965 mysql/mysql-server@5417e736ad9

Description:
Connection attribute parsing read a length-encoded size field before
checking that the complete field was present in the packet.

Fix:
A size check was added before reading the field. Debug coverage was
added for short length-encoded attribute packets during
pre-authentication.

Change-Id: I08d69b0cfcbd38392a2826a4dd208320e89af5e9
https://perconadev.atlassian.net/browse/PS-11329

Raised MYSQL_VERSION_EXTRA to 38 in MYSQL_VERSION file.
Raised PERCONA_INNODB_VERSION to 38 in univ.i file.
jaideepkarande and others added 20 commits September 22, 2026 20:08
Update wsrep-lib submodule
wsrep-lib: 23432d4eacffeb90c04b48575986881b12e59220 -> 96ab92c40674846a20c1eb33960c120f7509c645

Resolve galera.galera_audit_log_plugin_basic test failure
  -ERROR HY000: Aborted by Audit API ('EVENT_TRACKING_TABLE_ACCESS_INSERT';1).
  +ERROR HY000: Statement was aborted by an audit log filter.

Report the wsrep applier as not client-owned
Caused by the following commit merged from PS 9.7.2-2:
  90f3b62
  Bug#39474825 Align applier privilege checks for client BINLOG execution

Fix thread-local storage leak in wsrep_create_streaming_applier()
Port commit 09df9c1 from the 8.4

Add missing suppression to innodb.innodb_stats_drop_locked
Add Valgrind suppressions for OpenSSL 3.x AES-NI false positives
Port of commit d363217 from the 8.4 line
(trunk) PXC-5272: Null merge 8.4 to trunk
…ose()

Upstream Bug#38501299 (a19c025, first picked up in 9.7.2) made the
parallel DDL scan workers create an internal THD via create_internal_thd()
and then deliberately poison it under ASAN:

  ASAN_POISON_MEMORY_REGION((void *)&thd->variables, sizeof(thd->variables));
  ASAN_UNPOISON_MEMORY_REGION((void *)&thd->variables.sql_mode, ...);

Only sql_mode is copied from the caller thread and considered valid, the
rest of THD::variables is off-limits by construction.

Percona's innobase_slow_log_verbose() is reached from the Buf_fetch
constructor via innobase_get_trx_for_slow_log() on every page fetch, which
includes fetches done by those worker threads. It evaluated
thd_log_slow_verbosity(thd), i.e. thd->variables.log_slow_verbosity, before
thd_is_background_thread(thd), so ASAN builds reported:

  ERROR: AddressSanitizer: use-after-poison
    #0 thd_log_slow_verbosity sql/sql_class.cc:1648
    #1 innobase_slow_log_verbose storage/innobase/handler/ha_innodb.cc:2988
    #2 innobase_get_trx_for_slow_log() storage/innobase/handler/ha_innodb.cc:3079
    #3 Buf_fetch<...>::Buf_fetch() storage/innobase/buf/buf0buf.cc:3823

Swap the two terms. create_internal_thd() sets system_thread to
SYSTEM_THREAD_BACKGROUND, so the background thread check already made the
whole expression false for these THDs, the old ordering only bought a
poisoned read. Behaviour for user connections is unchanged and background
threads now short-circuit one step earlier.

(cherry picked from commit ec06aff4c4392e96fc7f79b9bf145a648179f90b)
EventFilterFunctionQueryDigest::get_query_digest() pre-created a string
via mysql_string_factory->create() and then passed the same handle to
mysql_thd_attributes->get(thd, "query_digest", ...). That getter does not
fill an existing string, it allocates a new one and overwrites the handle,
so the pre-created String was orphaned and leaked on every successful
query_digest() filter evaluation:

  Direct leak of 600 byte(s) in 15 object(s) allocated from:
    #1 mysql_string_imp::create(my_h_string_imp**)
    #2 EventFilterFunction<QueryDigest>::get_query_digest()
    #3 EventFilterFunction<QueryDigest>::exec()

Drop the create() call, initialize the handle to nullptr and only use it
when the attribute getter succeeded and actually set it. destroy() is a
no-op on nullptr, so the failure paths (no current digest, no THD) stay
safe. This matches how AuditLogFilter::get_sql_text() already handles the
equivalent "sql_text" attribute.

(cherry picked from commit d8e77ec872f1f233cbabef828ab6668299aaeac3)
galera-x.performance_schema_stmt
  Re-record the galera-x result to match the new X Plugin behaviour.
  Upstream BUG#39268863 (f8f1115, "X Plugin string quoting with
  NO_BACKSLASH_ESCAPES") stopped the X Plugin from issuing
  "SELECT @@sql_mode" before admin commands and re-recorded
  x.performance_schema_stmt accordingly.
  The PXC-only galera-x copy of the test updated during the merge.

component_percona_telemetry.initialization
component_audit_log_filter.abort_during_startup
  Use --loose-mysql_native_password instead of --mysql_native_password
…al roles change

https://perconadev.atlassian.net/browse/PS-11593

Problem:
Every successful login takes the ACL cache lock in exclusive mode to check
whether the plugin reported any roles or the user has any cached.
When the lock cannot be acquired, ER_CANNOT_LOCK_USER_MANAGEMENT_CACHES
is left in the diagnostics area and acl_authenticate() continues to my_ok(),
which trips Diagnostics_area::assert_not_set and aborts a debug server.

Resolution:
Probe g_external_roles under a READ lock and return early in the common case of
no roles reported and none cached.

(cherry picked from commit 2f66f87e33cde84feab943b42a45da74bb446546)
(cherry picked from commit c19ac1e4a0df07b00526ea8878bb0b1e1960318a)
sql/rpl_rli.h: the comment had "#ifdef GALERA" which is not parsed correctly
by Percona_Server_Diff_Check
Restored the original comment from 8.4 (release-8.4.11-11)

Thee PS commits have been cherry-picked from PS 26 release, wrapped them in
WITH_WSREP
  components/audit_log_filter/event_filter_function/query_digest.cc  PS-11352 audit_log_filter leak fix
  storage/innobase/handler/ha_innodb.cc  PS-11352 innobase_slow_log_verbose() ASAN fix
  sql/auth/sql_authentication.cc  PS-11593 ACL cache lock fix

Removed check_src/whitelist/ha_innodb.cc
(trunk) PXC-5272: Code refresh for - PXC 9.7.2-2
PXC-5256 [9.7] Packaging tasks for release - PXC 9.7.2
PXC-5256 [9.7] Packaging tasks for release - PXC 9.7.2
PXC-5276 [9.7] Packaging tasks for release - PXC 9.7.2
PXC-5276 [9.7] Packaging tasks for release - PXC 9.7.2
@adivinho
adivinho merged commit c9179de into 9.7 Nov 12, 2026
2 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.