提交 d41c7df9 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Fix ConditionInSelect for optimizeInSelect = false

上级 58d82af2
......@@ -99,9 +99,7 @@ public class ConditionInSelect extends Condition {
// row, and if l is not null
if (all) {
while (rows.next()) {
Value[] currentRow = rows.currentRow();
Value r = query.getColumnCount() == 1 ? currentRow[0] : ValueRow.get(currentRow);
Value cmp = Comparison.compare(database, l, r, compareType);
Value cmp = compare(l, rows);
if (cmp == ValueNull.INSTANCE) {
return ValueNull.INSTANCE;
} else if (cmp == ValueBoolean.FALSE) {
......@@ -112,9 +110,7 @@ public class ConditionInSelect extends Condition {
} else {
boolean hasNull = false;
while (rows.next()) {
Value[] currentRow = rows.currentRow();
Value r = query.getColumnCount() == 1 ? currentRow[0] : ValueRow.get(currentRow);
Value cmp = Comparison.compare(database, l, r, compareType);
Value cmp = compare(l, rows);
if (cmp == ValueNull.INSTANCE) {
hasNull = true;
} else if (cmp == ValueBoolean.TRUE) {
......@@ -128,6 +124,12 @@ public class ConditionInSelect extends Condition {
}
}
private Value compare(Value l, ResultInterface rows) {
Value[] currentRow = rows.currentRow();
Value r = l.getType() != Value.ROW && query.getColumnCount() == 1 ? currentRow[0] : ValueRow.get(currentRow);
return Comparison.compare(database, l, r, compareType);
}
@Override
public void mapColumns(ColumnResolver resolver, int level, int state) {
left.mapColumns(resolver, level, state);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论