mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-08 09:51:28 -04:00
6023557539
Fixed an issue in :meth:`_sql.Select.join_from` where the join condition between the left and right tables specified in the method call could be incorrectly determined based on an intermediate table already present in the FROM clause, rather than matching the foreign keys between the immediate left and right arguments. The join condition is now determined by matching primary keys between the two tables explicitly passed to :meth:`_sql.Select.join_from`, ensuring consistent and predictable join behavior regardless of the order of join operations or other tables present in the query. The fix is applied to both the Core and ORM implementations of :meth:`_sql.Select.join_from`. Fixes: #12931 Change-Id: Id457d441ee8a1bd64a002e57a9dcfd6fc56ff15e