提交 1dc946ee authored 作者: Thomas Mueller's avatar Thomas Mueller

Nested IN(IN(...)) didn't work.

上级 06684596
...@@ -216,6 +216,9 @@ public class ConditionIn extends Condition { ...@@ -216,6 +216,9 @@ public class ConditionIn extends Condition {
if (!areAllValues(ExpressionVisitor.get(ExpressionVisitor.EVALUATABLE))) { if (!areAllValues(ExpressionVisitor.get(ExpressionVisitor.EVALUATABLE))) {
return this; return this;
} }
if (!areAllValues(ExpressionVisitor.get(ExpressionVisitor.INDEPENDENT))) {
return this;
}
if (!(left instanceof ExpressionColumn)) { if (!(left instanceof ExpressionColumn)) {
return this; return this;
} }
......
...@@ -136,6 +136,9 @@ public class ConditionInSelect extends Condition { ...@@ -136,6 +136,9 @@ public class ConditionInSelect extends Condition {
if (!query.isEverything(ExpressionVisitor.EVALUATABLE)) { if (!query.isEverything(ExpressionVisitor.EVALUATABLE)) {
return this; return this;
} }
if (!query.isEverything(ExpressionVisitor.INDEPENDENT)) {
return this;
}
String alias = query.getFirstColumnAlias(session); String alias = query.getFirstColumnAlias(session);
if (alias == null) { if (alias == null) {
return this; return this;
......
...@@ -3,6 +3,8 @@ create table test(id identity); ...@@ -3,6 +3,8 @@ create table test(id identity);
> ok > ok
select 1 from test a where 1 in(select 1 from test b where b.id in(select 1 from test c where c.id=a.id)); select 1 from test a where 1 in(select 1 from test b where b.id in(select 1 from test c where c.id=a.id));
> 1
> -
> rows: 0 > rows: 0
drop table test; drop table test;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论