CDC logging wrong operation type for a MERGE statement, when Unique index is present
While doing an update using MERGE statement on a CDC enabled table, it logs two records with:
_operation 1: DELETE
_operation 2: INSERT
It should actually log as 3[Before Update] and 4 [After Update]. It only happens, when any indexed column is in MERGE's update statement.
This is a specific case of the same issue reported (and incorrectly closed) earlier here: https://feedback.azure.com/forums/908035-sql-server/suggestions/32896951-cdc-functions-fn-cdc-get-net-changes-are-slow-an