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
Check RowsAffected when applying DML events to get more accurate statistics (#844)
* Check RowsAffected when applying DML events to get more accurate statistics
Addresses #600.
When applying a DML event, check the RowsAffected on the `Result`
struct. Since all DML event queries are point queries, this will only
ever be 0 or 1. The applier then takes this value and multiplies by
the `rowsDelta` of the event, resulting in a properly-signed, accurate
row delta to use in the statistics.
If an error occurs here, log it, but do not surface this as an
actual error .. simply assume the DML affected a row and move on. It
will be inaccurate, but this is already the case.
* Fix import
* update wording to warning log message
Co-authored-by: Tim Vaillancourt <[email protected]>
log.Warningf("error getting rows affected from DML event query: %s. i'm going to assume that the DML affected a single row, but this may result in inaccurate statistics", err)
1083
+
rowsAffected=1
1084
+
}
1085
+
// each DML is either a single insert (delta +1), update (delta +0) or delete (delta -1).
1086
+
// multiplying by the rows actually affected (either 0 or 1) will give an accurate row delta for this DML event
0 commit comments