Skip to content
/ server Public

Conversation

@DaveGosselin-MariaDB
Copy link
Member

…ubqueries

When optimizing unflattened subqueries we assert that, if any SELECT in a unit sets the uncacheable flag with UNCACHEABLE_RAND, then the unit's uncacheable flag itself should be set likewise. Put another way, any SELECT in the unit that is UNCACHEABLE_RAND causes the entire unit to be so marked.

However, this marking was not preserved by SELECT_LEX::register_unit when registering a new unit. During that method, the SELECT_LEX's uncacheable value is updated with the registered unit's uncacheable value but, if the UNCACHEABLE_RAND marking is present, it is not propagated to the uncacheable flag of the enclosing unit.

If the incoming unit's uncacheable flag has the UNCACHEABLE_RAND bit set and if the master unit exists, then set the UNCACHEABLE_RAND flag on the master unit.

…ubqueries

When optimizing unflattened subqueries we assert that, if any SELECT in a unit
sets the uncacheable flag with UNCACHEABLE_RAND, then the unit's uncacheable
flag itself should be set likewise.  Put another way, any SELECT in the unit
that is UNCACHEABLE_RAND causes the entire unit to be so marked.

However, this marking was not preserved by SELECT_LEX::register_unit when
registering a new unit.  During that method, the SELECT_LEX's uncacheable
value is updated with the registered unit's uncacheable value but, if the
UNCACHEABLE_RAND marking is present, it is not propagated to the uncacheable
flag of the enclosing unit.

If the incoming unit's uncacheable flag has the UNCACHEABLE_RAND bit set and
if the master unit exists, then set the UNCACHEABLE_RAND flag on the master
unit.
@DaveGosselin-MariaDB DaveGosselin-MariaDB force-pushed the 12.2-MDEV-38099-assertion-fail branch from a5504f0 to 2e253ef Compare January 20, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants