NamedParameterUtils skips Postgres-style ?? operator
Issue: SPR-13582
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -103,7 +103,7 @@ public abstract class NamedParameterUtils {
|
||||
if (c == ':' || c == '&') {
|
||||
int j = i + 1;
|
||||
if (j < statement.length && statement[j] == ':' && c == ':') {
|
||||
// Postgres-style "::" casting operator - to be skipped.
|
||||
// Postgres-style "::" casting operator should be skipped
|
||||
i = i + 2;
|
||||
continue;
|
||||
}
|
||||
@@ -144,7 +144,7 @@ public abstract class NamedParameterUtils {
|
||||
if (c == '\\') {
|
||||
int j = i + 1;
|
||||
if (j < statement.length && statement[j] == ':') {
|
||||
// this is an escaped : and should be skipped
|
||||
// escaped ":" should be skipped
|
||||
sqlToUse = sqlToUse.substring(0, i - escapes) + sqlToUse.substring(i - escapes + 1);
|
||||
escapes++;
|
||||
i = i + 2;
|
||||
@@ -152,6 +152,12 @@ public abstract class NamedParameterUtils {
|
||||
}
|
||||
}
|
||||
if (c == '?') {
|
||||
int j = i + 1;
|
||||
if (j < statement.length && statement[j] == '?') {
|
||||
// Postgres-style "??" operator should be skipped
|
||||
i = i + 2;
|
||||
continue;
|
||||
}
|
||||
unnamedParameterCount++;
|
||||
totalParameterCount++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user