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

Partially revert d04b4cb7

上级 160306dc
......@@ -490,7 +490,7 @@ Instead, use a prepared statement with arrays as in the following example:
</p>
<pre>
PreparedStatement prep = conn.prepareStatement(
"SELECT * FROM TEST WHERE ID IN(UNNEST(?))");
"SELECT * FROM TEST WHERE ID = ANY(?)");
prep.setObject(1, new Object[] { "1", "2" });
ResultSet rs = prep.executeQuery();
</pre>
......
......@@ -24,7 +24,7 @@ import org.h2.value.ValueBoolean;
import org.h2.value.ValueNull;
/**
* A condition with parameter as {@code IN(UNNEST(?))}.
* A condition with parameter as {@code = ANY(?)}.
*/
public class ConditionInParameter extends Condition {
private static final class ParameterList extends AbstractList<Expression> {
......@@ -104,12 +104,12 @@ public class ConditionInParameter extends Condition {
}
/**
* Create a new {@code IN(UNNEST(?))} condition.
* Create a new {@code = ANY(?)} condition.
*
* @param database
* the database
* @param left
* the expression before {@code IN(UNNEST(?))}
* the expression before {@code = ANY(?)}
* @param parameter
* parameter
*/
......@@ -162,8 +162,8 @@ public class ConditionInParameter extends Condition {
@Override
public StringBuilder getSQL(StringBuilder builder) {
builder.append('(');
left.getSQL(builder).append(" IN(UNNEST(");
return parameter.getSQL(builder).append(")))");
left.getSQL(builder).append(" = ANY(");
return parameter.getSQL(builder).append("))");
}
@Override
......
......@@ -60,8 +60,8 @@ SELECT X, X IN(UNNEST(ARRAY[2, 4])) FROM SYSTEM_RANGE(1, 5);
SELECT X, X IN(UNNEST(?)) FROM SYSTEM_RANGE(1, 5);
{
2
> X X IN(UNNEST(?1))
> - ----------------
> X X = ANY(?1)
> - -----------
> 1 FALSE
> 2 TRUE
> 3 FALSE
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论