提交 44a53f6a authored 作者: Andrew Brock's avatar Andrew Brock 提交者: Andrew Brock

In the REGEXP_REPLACE function, when in PostgreSQL compatibility mode, accept…

In the REGEXP_REPLACE function, when in PostgreSQL compatibility mode, accept (but ignore/strip out) the 'g' flag.
上级 e8f99400
......@@ -1370,6 +1370,10 @@ public class Function extends Expression implements FunctionCall {
}
String regexpMode = v3 == null || v3.getString() == null ? "" :
v3.getString();
if(database.getMode().getEnum().equals(Mode.ModeEnum.PostgreSQL)) {
// PostgreSQL doesn't do global replaces without a 'g' flag, but H2 does
regexpMode = regexpMode.replaceAll("g", "");
}
int flags = makeRegexpFlags(regexpMode);
try {
result = ValueString.get(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论