CE-651 Add check for all queires to ErrQueryAffectedZeroRows#118
Conversation
|
Claude finished @MarcusGoldschmidt's task in 1m 12s —— View job PR Review: Add check for all queries to ErrQueryAffectedZeroRows
SummaryThis PR changes the behavior of This is a sensible change. For multi-query provisioning configs (e.g., an INSERT + an auxiliary UPDATE), the old behavior would incorrectly bail on the first 0-row query even if subsequent queries would succeed. With this change, the operation is only considered a no-op (triggering Issues1. Edge case: empty At if zeroRowCount == len(queries) {
return ErrQueryAffectedZeroRows
}If In practice, callers ( if len(queries) > 0 && zeroRowCount == len(queries) {
return ErrQueryAffectedZeroRows
}2. Behavioral side effect worth noting (informational) Previously, if query 1 affected 0 rows, query 2 never executed (early return). Now all queries execute regardless, and the zero-row check happens after. This is a meaningful change beyond just the error condition — subsequent queries may have side effects (inserts, updates) even when earlier queries were no-ops. This seems intentional and correct for the use case, but worth calling out for reviewers. Looks good otherwiseThe change aligns well with the idempotency patterns described in CLAUDE.md ("already exists" and "already revoked" are not errors). The logic is clean and easy to follow. |
|
Claude finished @MarcusGoldschmidt's task in 1m 5s —— View job PR Review: Add check for all queries to ErrQueryAffectedZeroRows
SummaryThis PR changes This is a good change. For multi-query provisioning configs (e.g., an INSERT + an auxiliary UPDATE), the old behavior would incorrectly bail on the first 0-row query even when subsequent queries would succeed. Now, the operation is only treated as a no-op (triggering I can see the second commit ( ReviewLooks good. The logic is clean, the edge case is handled, and the change aligns well with the idempotency patterns in this codebase ( A few observations: 1. Behavioral change worth documenting (informational) Previously, if query 1 affected 0 rows, query 2 was never executed (early return with rollback). Now all queries execute regardless, and the zero-row check happens after the loop. This means subsequent queries may have side effects (inserts, updates) even when earlier queries were no-ops. When using transactions ( 2. Transaction safety is preserved ✓ When 3. No test coverage (minor) There are no unit tests for 4. Consider: should a mix of zero-row and non-zero-row queries in a non-transactional context be a concern? When VerdictThe change is correct and well-motivated. LGTM. |
Description
Useful links: