NamedParameterUtils.isParameterSeparator checks for non-ASCII characters
Issue: SPR-16472
This commit is contained in:
parent
5c0ddf3c69
commit
ac7a699356
|
|
@ -391,7 +391,7 @@ public abstract class NamedParameterUtils {
|
|||
* that is, whether the given character qualifies as a separator.
|
||||
*/
|
||||
private static boolean isParameterSeparator(char c) {
|
||||
return (separatorIndex[c] || Character.isWhitespace(c));
|
||||
return (c < 128 && separatorIndex[c]) || Character.isWhitespace(c);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
|
|
@ -52,11 +52,11 @@ public class NamedParameterUtilsTests {
|
|||
assertEquals(2, psql2.getTotalParameterCount());
|
||||
assertEquals(1, psql2.getNamedParameterCount());
|
||||
|
||||
String sql3 = "xxx &a+:b" + '\t' + ":c%10 yyyy ? zzzzz";
|
||||
String sql3 = "xxx &ä+:ö" + '\t' + ":ü%10 yyyy ? zzzzz";
|
||||
ParsedSql psql3 = NamedParameterUtils.parseSqlStatement(sql3);
|
||||
assertEquals("a", psql3.getParameterNames().get(0));
|
||||
assertEquals("b", psql3.getParameterNames().get(1));
|
||||
assertEquals("c", psql3.getParameterNames().get(2));
|
||||
assertEquals("ä", psql3.getParameterNames().get(0));
|
||||
assertEquals("ö", psql3.getParameterNames().get(1));
|
||||
assertEquals("ü", psql3.getParameterNames().get(2));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Reference in New Issue