You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
查看源码
ReplacementIntercepter中的##解析的正则表达式有问题
final Pattern PATTERN = Pattern.compile("\{([a-zA-Z0-9_\.\:]+)\}|##\((.+)\)");
这个正则表达式采用的是贪婪模式
如下sql
update ##(:1) set status=:2 where id in (:3)
源码
while (matcher.find(start)) {
String group = matcher.group();
String key = null;
if (group.startsWith("{")) {
key = matcher.group(1);
} else if (group.startsWith("##(")) {
key = matcher.group(2); //key = :1) set status=:2 where id in (:3
}
The text was updated successfully, but these errors were encountered:
现象
当SQL中使用##拼接sql字符串时,如果sql语句中使用了in的sql语法,就会导致解析错误
查看源码
ReplacementIntercepter中的##解析的正则表达式有问题
final Pattern PATTERN = Pattern.compile("\{([a-zA-Z0-9_\.\:]+)\}|##\((.+)\)");
这个正则表达式采用的是贪婪模式
如下sql
update ##(:1) set status=:2 where id in (:3)
源码
while (matcher.find(start)) {
String group = matcher.group();
String key = null;
if (group.startsWith("{")) {
key = matcher.group(1);
} else if (group.startsWith("##(")) {
key = matcher.group(2); //key = :1) set status=:2 where id in (:3
}
The text was updated successfully, but these errors were encountered: