Open MordantWastrel opened 1 year ago
@elpete This bug has blown up a number of pieces of our apps where we relying on Quick/QB intermingling, and causing records to be returned that should not be returned. It seems like a pretty big deal because it's not a 'crashes and throws an error' bug but a 'quietly does something other than what you asked it to' bug.
We had an entity with the following scope in Quick 4:
which emitted this (focus is on the
whereIn()
portion withwhere [clientID] = @P4
In Quick 6/7, it does this:
This appears to occur only when both the parent object and the subQuery
.from()
table contain the same column: the builder references the parent table's column even with an explicit.from()
A workaround is to avoid
.whereIn()
in favor of additional.whereHas()
but this is a prickly one as it's tough to track down unless you're explicitly testing for valid results in these queries.