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

NamedParameterUtils.substituteNamedParameters(ParsedSql parsedSql, SqlParameterSource paramSource) creates empty parentheses when a select list is empty [SPR-10730] #15358

Closed
spring-projects-issues opened this issue Jul 9, 2013 · 2 comments
Labels
in: core status: bulk-closed

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jul 9, 2013

andrew chen opened SPR-10730 and commented

org.springframework.jdbc.core.namedparam.NamedParameterUtils.substituteNamedParameters(ParsedSql parsedSql, SqlParameterSource paramSource) creates empty parentheses when a select list is empty, which generates invalid sql such as " in ()".

A workaround would replace the placeholder with null so that it becomes "in (null)" like in Ruby on Rails so that it will still be valid sql.


Affects: 3.1.4, 3.2 GA, 3.2.1, 3.2.2, 3.2.3, 4.0 M1

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Dec 17, 2013

Juergen Hoeller commented

This proposal seems plausible. However, the corresponding behavior in Ruby on Rails seems to be somewhat controversial, according to some quick browsing on the web. I'd like to see more context, best-practice guidelines for SQL IN clauses, etc before we move ahead with such a change in NamedParameterUtils.

Juergen

@spring-projects-issues spring-projects-issues added status: waiting-for-triage type: enhancement in: core and removed type: enhancement labels Jan 11, 2019
@rstoyanchev rstoyanchev added status: bulk-closed and removed status: waiting-for-triage labels Jan 11, 2019
@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jan 12, 2019

Bulk closing outdated, unresolved issues. Please, reopen if still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: bulk-closed
Projects
None yet
Development

No branches or pull requests

2 participants