Sitelet https://github.com/cakephp/orm/tags
Skip to content

Tags: cakephp/orm

Tags

5.4.3

Toggle 5.4.3's commit message
Fix paginated association subqueries on MariaDB (#19596)

Use DISTINCT for ungrouped association filter queries so MariaDB does not apply its lateral GROUP BY optimization. Preserve explicit grouping and select ordered columns for PostgreSQL compatibility.

* Test paginated MariaDB association results

Refs #19595.


---------

Co-authored-by: Mark Scherer <dereuromark@users.noreply.github.com>

5.4.2

Toggle 5.4.2's commit message
Fix two subquery eager loading strategy defects

A nested matching builder was inherited by every association leading up to
its target. EagerLoader::setMatching() spreads the shared options over each
segment of the association path, and the options carry the target's
queryBuilder when the nested matching is rebound from a surrogate query. The
parent association then applied the target's conditions to its own join, which
produced an ON clause referencing a table that is only joined later. The first
build of a query happened to escape it, so it surfaced when the query was
cloned, for instance while building a subquery strategy filter.

The subquery filter also groups by the source binding key and keeps the
query's LIMIT, so the limit cuts the distinct keys instead of the rows the
query returned. Both sets only coincide while the association is owned by the
query's own repository. Where the association hangs off another association,
many rows share one key, the filter answers with a different set of keys, and
the association silently comes back empty. Those loaders now use the select
strategy, which filters on the keys of the rows that were actually returned.

5.4.1

Toggle 5.4.1's commit message
fix postgres eager loading alias bug (#19552)

5.4.0

Toggle 5.4.0's commit message
Update version constraints and branch aliases

Update split package version constraints and branch aliases to 5.5

5.3.7

Toggle 5.3.7's commit message
Keep the ORDER BY intact when building a subquery strategy filter (#1…

…9538)

_subqueryFields() collects the ORDER BY fields through iterateParts(), which
rebuilds the expression from whatever the callback returns. The callback
returned nothing, so every part was dropped - and since it runs against the
caller's query rather than a clone, the query itself was left without an
ORDER BY.

The loader of the first contained association therefore stripped the order,
and every following association built its filtering subquery unordered. With
a limit in place those subqueries paged onto the wrong rows, so any hasMany
after the first one silently returned no results at all.

* Add closure param type for rector

* Fix CS

---------

Co-authored-by: Mark Scherer <dereuromark@gmail.com>

5.4.0-RC2

Toggle 5.4.0-RC2's commit message
Merge branch '5.x' into 5.next

5.3.6

Toggle 5.3.6's commit message
Merge pull request #19460 from cakephp/phpstan

Update phpstan

5.4.0-RC1

Toggle 5.4.0-RC1's commit message
Fix ambiguous column in self-referential subquery eager loading (#19397)

* Fix ambiguous column in self-referential subquery eager loading

When a HasMany association is self-referential (e.g. a tree structure
with parent_id), the subquery eager loading strategy joins the subquery
using the source alias which is the same as the outer query table alias.
This causes 'Column X.id in SELECT is ambiguous' errors.

Use a suffixed alias for the subquery join when source and target aliases
match, and update the filter identifiers accordingly.

* Fix subquery eager loading edge cases

* Add eager loading regression coverage

* Fix CI issues in eager loading regressions

* Skip non-portable SQLServer regression cases

5.3.5

Toggle 5.3.5's commit message
Merge pull request #19402 from zigzagdev/chore/refactor-replace-null_…

…safe-method

refactor: replace null check with null coalescing assignment operator

5.3.4

Toggle 5.3.4's commit message
Merge pull request #19402 from zigzagdev/chore/refactor-replace-null_…

…safe-method

refactor: replace null check with null coalescing assignment operator