提交 97d1657b authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 f61d2340
...@@ -6,6 +6,7 @@ package org.h2.expression; ...@@ -6,6 +6,7 @@ package org.h2.expression;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.h2.constant.ErrorCode; import org.h2.constant.ErrorCode;
import org.h2.engine.Constants; import org.h2.engine.Constants;
...@@ -265,10 +266,14 @@ public class CompareLike extends Condition { ...@@ -265,10 +266,14 @@ public class CompareLike extends Condition {
private void initPattern(String p, char escape) throws SQLException { private void initPattern(String p, char escape) throws SQLException {
if (regexp) { if (regexp) {
patternString = p; patternString = p;
if (ignoreCase) { try {
patternRegexp = Pattern.compile(p, Pattern.CASE_INSENSITIVE); if (ignoreCase) {
} else { patternRegexp = Pattern.compile(p, Pattern.CASE_INSENSITIVE);
patternRegexp = Pattern.compile(p); } else {
patternRegexp = Pattern.compile(p);
}
} catch (PatternSyntaxException e) {
throw Message.getSQLException(ErrorCode.LIKE_ESCAPE_ERROR_1, new String[]{p}, e);
} }
return; return;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论