You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(sql): thread query collection through getSQLCondition as parameter
currentQueryCollection was per-instance mutable state, set by
getSQLConditionsForCollection and read inside SQLite's
getSQLCondition before calling findFulltextTableForAttribute. Under
Swoole, the PRAGMA executed by the lookup yields the coroutine — if
the same statement compiles a second SEARCH after the yield, its
read of currentQueryCollection can land on a value written by a
sibling coroutine. The try/finally save/restore only protected
against sequential leakage, not coroutine interleaving, so the
race could route one coroutine's SEARCH to another's FTS5 table.
Drop the property and add an explicit ?string forCollection
parameter to getSQLCondition / getSQLConditions on the SQL base,
plumb it through MariaDB and Postgres' overrides (and their TYPE_OR
/ TYPE_AND recursive calls), and have SQLite read it from the
parameter. A local parameter cannot race — each coroutine's call
frame holds its own copy across yields.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments