提交 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,11 +266,15 @@ public class CompareLike extends Condition { ...@@ -265,11 +266,15 @@ 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;
try {
if (ignoreCase) { if (ignoreCase) {
patternRegexp = Pattern.compile(p, Pattern.CASE_INSENSITIVE); patternRegexp = Pattern.compile(p, Pattern.CASE_INSENSITIVE);
} else { } else {
patternRegexp = Pattern.compile(p); patternRegexp = Pattern.compile(p);
} }
} catch (PatternSyntaxException e) {
throw Message.getSQLException(ErrorCode.LIKE_ESCAPE_ERROR_1, new String[]{p}, e);
}
return; return;
} }
patternLength = 0; patternLength = 0;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论