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

Fix LimitQueryDeterminismAnalyzer #15181

Merged
merged 1 commit into from
Sep 17, 2020
Merged

Conversation

caithagoras
Copy link
Contributor

@caithagoras caithagoras commented Sep 16, 2020

Fix LimitQueryDeterminismAnalyzer to return DETERMINISTIC when the control query row count is less then the value of the limit clause. Before the fix, LimitQueryDeterminismAnalyzer concluded ANALYSIS_FAILED_DATA_CHANGED instead where there the data is not actually changed.

== RELEASE NOTES ==

Verifier Changes
* Fix an issue in determinism analysis would indicate failing due to data being changed while the data is not changed.

@@ -262,7 +268,7 @@ private LimitQueryDeterminismAnalysis analyzeLimitNoOrderBy(Query newLimitQuery,
if (rowCountHigherLimit == rowCount) {
return DETERMINISTIC;
}
if (rowCount >= limit && rowCountHigherLimit > rowCount) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we removingrowCount >= limit check? It makes sense to be non-deterministic in this case as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change we're adding in this PR will short circuit cases with rowCount < limit. Therefore, when reaching this line, it is guaranteed that rowCount >= limit.

Fix LimitQueryDeterminismAnalyzer to return DETERMINISTIC when
row count from the control query is less then the limit of the limit
clause. Before the fix, LimitQueryDeterminismAnalyzer concluded
ANALYSIS_FAILED_DATA_CHANGED instead.
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

Successfully merging this pull request may close these issues.

4 participants