Skip to content

Render entire statement after applying sort. #3264

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

Closed
wants to merge 2 commits into from
Closed

Conversation

christophstrobl
Copy link
Member

This PR makes sure to render the entire statement after applying the sort expression via the QueryEnhancer.
Previously only parts, the actual statement body, had been considered.

Fixes: #3263

This commit makes sure to render the entire statement after applying the sort expression via the QueryEnhancer. Previously only parts, the actual statement body, had been considered.
@@ -179,6 +179,17 @@ void findsExistingOrderByIndependentOfCase() {
assertThat(query).endsWithIgnoringCase("ORDER BY p.firstname, p.lastname asc");
}

@Test // GH-3263
void doesNotDropWithExpressionWhenApplySort() {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to use Sorting instead of Sort for consistency.

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks @quaff - additionally I'm not happy with the doesNotDrop part. will rename the method.

@mp911de
Copy link
Member

mp911de commented Dec 12, 2023

Looks good, feel free to merge this one.

christophstrobl added a commit that referenced this pull request Dec 12, 2023
This commit makes sure to render the entire statement after applying the sort expression via the QueryEnhancer. Previously only parts, the actual statement body, had been considered.

Closes: #3263
Original Pull Request: #3264
christophstrobl added a commit that referenced this pull request Dec 12, 2023
This commit makes sure to render the entire statement after applying the sort expression via the QueryEnhancer. Previously only parts, the actual statement body, had been considered.

Closes: #3263
Original Pull Request: #3264
christophstrobl added a commit that referenced this pull request Dec 12, 2023
This commit makes sure to render the entire statement after applying the sort expression via the QueryEnhancer. Previously only parts, the actual statement body, had been considered.

Closes: #3263
Original Pull Request: #3264
@mp911de mp911de added the type: bug A general bug label Dec 14, 2023
@mp911de mp911de added this to the 3.1.7 (2023.0.7) milestone Dec 14, 2023
@christophstrobl christophstrobl deleted the issue/3263 branch December 14, 2023 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSqlParserQueryEnhancer removes WITH clauses for paginated and sorted native queries
3 participants