mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-29 03:54:43 -04:00
d71f34cb2a
Fixed a regression in 1.2 due to the introduction of baked queries for relationship lazy loaders, where a race condition is created during the generation of the "lazy clause" which occurs within a memoized attribute. If two threads initialize the memoized attribute concurrently, the baked query could be generated with bind parameter keys that are then replaced with new keys by the next run, leading to a lazy load query that specifies the related criteria as ``None``. The fix establishes that the parameter names are fixed before the new clause and parameter objects are generated, so that the names are the same every time. Fixes: #4507 Change-Id: I605b824e028c87bc20ca8c2577227cdf6a591064