Skip to content

SPR-16663 - Update NamedParameterUtils.parseSqlStatement - #1758

Merged
jhoeller merged 1 commit into
spring-projects:masterfrom
nkjackzhang:patch-1
Mar 29, 2018
Merged

jhoeller merged 1 commit into
spring-projects:masterfrom
nkjackzhang:patch-1

Conversation

@nkjackzhang

@nkjackzhang nkjackzhang commented Mar 29, 2018 •

Copy link
Copy Markdown
Contributor

In my opinion, we should parse :{x} style parameter as x is parameter using NamedParameterUtils.parseSqlStatement,
so the condition j - i > 2 is the correct condition, not j - i > 3, because if i is the index of
: in :{x}, and j is the index of } in :{x}, j - i == 3 is true.
Also add a test case for SPR-16663.

…er correctly

In my opinion, we should parse ":{x}" style parameter as "x" is parameter using "NamedParameterUtils.parseSqlStatement",
so the condition "j - i > 2" is the correct condition, not "j - i > 3", because if "i" is the index of
":" in ":{x}", and "j" is the index of "}" in ":{x}",  "j - i == 3" is true.
Also add a test case for SPR-16663.
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.

2 participants