File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
main/java/org/springframework/r2dbc/core
test/java/org/springframework/r2dbc/core Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 48
48
* @author Thomas Risberg
49
49
* @author Juergen Hoeller
50
50
* @author Mark Paluch
51
+ * @author Anton Naydenov
51
52
* @since 5.3
52
53
*/
53
54
abstract class NamedParameterUtils {
@@ -66,7 +67,7 @@ abstract class NamedParameterUtils {
66
67
* Set of characters that qualify as parameter separators,
67
68
* indicating that a parameter name in an SQL String has ended.
68
69
*/
69
- private static final String PARAMETER_SEPARATORS = "\" ':&,;()|=+-*%/\\ <>^" ;
70
+ private static final String PARAMETER_SEPARATORS = "\" ':&,;()|=+-*%/\\ <>^[] " ;
70
71
71
72
/**
72
73
* An index with separator flags per character code.
Original file line number Diff line number Diff line change 38
38
*
39
39
* @author Mark Paluch
40
40
* @author Jens Schauder
41
+ * @author Anton Naydenov
41
42
*/
42
43
public class NamedParameterUtilsUnitTests {
43
44
@@ -274,6 +275,18 @@ public void parseSqlStatementWithQuotesAndCommentAfter() {
274
275
assertThat (psql2 .getParameterNames ()).containsExactly ("xxx" );
275
276
}
276
277
278
+ @ Test public void parseSqlStatementWithSquareBracket () {
279
+ // given
280
+ String sql = "SELECT ARRAY[:ext]" ;
281
+
282
+ // when
283
+ ParsedSql psql = NamedParameterUtils .parseSqlStatement (sql );
284
+
285
+ //then
286
+ assertThat (psql .getNamedParameterCount ()).isEqualTo (1 );
287
+ assertThat (psql .getParameterNames ()).containsExactly ("ext" );
288
+ }
289
+
277
290
@ Test
278
291
public void shouldAllowParsingMultipleUseOfParameter () {
279
292
You can’t perform that action at this time.
0 commit comments