提交 7efea15e authored 作者: Thomas Mueller's avatar Thomas Mueller

Views with multiple joined tables (where one was an outer join) couldn't be used in some cases.

The generated SQL statement was ambiguous.
上级 da87046d
...@@ -507,10 +507,15 @@ public class TableFilter implements ColumnResolver { ...@@ -507,10 +507,15 @@ public class TableFilter implements ColumnResolver {
plan = StringUtils.quoteRemarkSQL(plan); plan = StringUtils.quoteRemarkSQL(plan);
buff.append(plan); buff.append(plan);
buff.append(" */"); buff.append(" */");
if (joinCondition != null) { if (join) {
buff.append(" ON "); buff.append(" ON ");
if (joinCondition == null) {
// need to have a ON expression, otherwise the nesting is unclear
buff.append("1=1");
} else {
buff.append(StringUtils.unEnclose(joinCondition.getSQL())); buff.append(StringUtils.unEnclose(joinCondition.getSQL()));
} }
}
if (filterCondition != null) { if (filterCondition != null) {
buff.append(" /* WHERE "); buff.append(" /* WHERE ");
String condition = StringUtils.unEnclose(filterCondition.getSQL()); String condition = StringUtils.unEnclose(filterCondition.getSQL());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论