Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-fetching duplicate rows, decremented CHANGE_TRACKING_CURRENT_VERSION() #39

Open
zboldyga opened this issue Aug 26, 2020 · 0 comments

Comments

@zboldyga
Copy link

(dec current-log-version)

This spawned from a discussion with Carlos at Stitch. I believe there may be an off-by-one error with the CHANGE_TRACKING_CURRENT_VERSION being passed into SQL Server's CHANGETABLE function. The SQL Server documentation recommends directly passing the version number retrieved by CHANGE_TRACKING_CURRENT_VERSION() into the CHANGETABLE function: https://docs.microsoft.com/en-us/sql/relational-databases/track-changes/work-with-change-tracking-sql-server?view=sql-server-2017 . If this version number is passed as-is, tables with no new updates should return zero rows (at least, I believe this is what SQL Server documentation says).

But the implementation shown in line 166 above decrements the retrieved number by one. This results in lots of duplicated copying of data, and seems to disagree with the SQL Server documentation.

Is there a reason for the decrement-by-one behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant