Skip to content

fix: enforce the HasLimit req by Explain #257

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

himanshusinghs
Copy link
Contributor

ExplainQuery was adding HasLimit component with n=1 but when the query already had a HasLimit component (parsed from the Java code), this newly added component was getting ignored in the
DataGripMongoDbDriver.runQuery and instead of returning an object we were returning a list, which was later causing an exception in ExplainQuery itself.

I don't have a stack trace but it should be easy to reproduce by having a query with limit and letting the Index inspection run on it. The exception should be visible in debug console.

This commit fixes that by replacing the existing limit if any which should be safe to do particularly for ExplainQuery.

Description

Checklist

Open Questions

ExplainQuery was adding HasLimit component with n=1 but when the query
already had a HasLimit component (parsed from the Java code), this newly
added component was getting ignored in the
DataGripMongoDbDriver.runQuery and instead of returning an object we
were returning a list, which was later causing an exception in
ExplainQuery itself.

I don't have a stack trace but it should be easy to reproduce by having
a query with limit and letting the Index inspection run on it. The
exception should be visible in debug console.

This commit fixes that by replacing the existing limit if any which
should be safe to do particularly for ExplainQuery.
@himanshusinghs himanshusinghs requested a review from a team as a code owner July 18, 2025 01:59
@himanshusinghs himanshusinghs added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants