Skip to content

Fix performance bug with large number of unnamed parameters #2050

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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
* @author Mark Paluch
* @author Jens Schauder
* @author Yan Qiang
* @author Mikhail Fedorov
* @since 3.0
*/
public class QueryMapper {
Expand Down Expand Up @@ -632,7 +633,7 @@ private static String getUniqueName(MapSqlParameterSource parameterSource, Strin
return name;
}

int counter = 1;
int counter = values.size();
String uniqueName;

do {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
*
* @author Mark Paluch
* @author Jens Schauder
* @author Mikhail Fedorov
*/
public class QueryMapperUnitTests {

Expand Down Expand Up @@ -121,7 +122,7 @@ public void shouldMapNestedGroup() {
Condition condition = map(criteria);

assertThat(condition).hasToString(
"(person.\"NAME\" = ?[:name]) AND (person.\"NAME\" = ?[:name1] OR person.age < ?[:age] OR (person.\"NAME\" != ?[:name2] AND person.age > ?[:age1]))");
"(person.\"NAME\" = ?[:name]) AND (person.\"NAME\" = ?[:name1] OR person.age < ?[:age] OR (person.\"NAME\" != ?[:name3] AND person.age > ?[:age4]))");
}

@Test // DATAJDBC-318
Expand Down