Browse Source
The problem was that the restriction on the JOIN clause does not properly filter the complete set, but actually results in wrongly joining the CFDs. This resulted in two CFDs returned, where one was wrongly assembled (the id of the first one, but the data of the second one). In a cases where the wrong one is the first one in the list of returned CFDs we would run into an error when inserting a new state, because we would try to alter the state of a wrong CFD. Fixed by joining on the id and filtering for the order.uuid in the where clause. Note: I also tested to add the `and orders.uuid = ?` restriction to the first join clause (in addition to the id clause) which might theoretically be more optimized. That would work as well, but I found it harder to reason about it. As part of the overall where clause one can see the restriction to exactly this value more clearly.fix-bad-api-calls
Daniel Karzel
3 years ago
2 changed files with 32 additions and 31 deletions
Loading…
Reference in new issue