提交 8b246de5 authored 作者: Thomas Mueller's avatar Thomas Mueller

The statement CALL no longer converts an ARRAY return value to a list of values.…

The statement CALL no longer converts an ARRAY return value to a list of values. Now an ARRAY is returned.
上级 d1fcead9
......@@ -12,11 +12,9 @@ import org.h2.command.Prepared;
import org.h2.engine.Session;
import org.h2.expression.Expression;
import org.h2.expression.ExpressionVisitor;
import org.h2.message.DbException;
import org.h2.result.LocalResult;
import org.h2.result.ResultInterface;
import org.h2.value.Value;
import org.h2.value.ValueArray;
import org.h2.value.ValueResultSet;
/**
......@@ -35,7 +33,7 @@ public class Call extends Prepared {
public ResultInterface queryMeta() {
int expressionType = expression.getType();
LocalResult result;
if (expressionType == Value.RESULT_SET || expressionType == Value.ARRAY) {
if (expressionType == Value.RESULT_SET) {
Expression[] expr = expression.getExpressionColumns(session);
result = new LocalResult(session, expr, expr.length);
} else {
......@@ -50,7 +48,6 @@ public class Call extends Prepared {
int type = v.getType();
switch(type) {
case Value.RESULT_SET:
case Value.ARRAY:
// this will throw an exception
// methods returning a result set may not be called like this.
return super.update();
......@@ -65,20 +62,9 @@ public class Call extends Prepared {
public ResultInterface query(int maxrows) {
setCurrentRowNumber(1);
Value v = expression.getValue(session);
switch (v.getType()) {
case Value.RESULT_SET:
if (v.getType() == Value.RESULT_SET) {
ResultSet rs = ((ValueResultSet) v).getResultSet();
return LocalResult.read(session, rs, maxrows);
case Value.ARRAY:
Value[] list = ((ValueArray) v).getList();
Expression[] expr = expression.getExpressionColumns(session);
if (expr.length != list.length) {
throw DbException.throwInternalError();
}
LocalResult result = new LocalResult(session, expr, expr.length);
result.addRow(list);
result.done();
return result;
}
LocalResult result = new LocalResult(session, expressions, 1);
Value[] row = { v };
......
......@@ -3562,9 +3562,9 @@ call datediff('MS', TIMESTAMP '1900-01-01 00:00:01.000', TIMESTAMP '2008-01-01 0
> rows: 1
call select 1.0/3.0*3.0, 100.0/2.0, -25.0/100.0, 0.0/3.0, 6.9/2.0;
> C1 C2 C3 C4 C5
> ----------------------------- -- ----- -- ----
> 0.999999999999999999999999990 50 -0.25 0 3.45
> SELECT 0.999999999999999999999999990, 50, -0.25, 0, 3.45 FROM SYSTEM_RANGE(1, 1) /* PUBLIC.RANGE_INDEX */ /* scanCount: 2 */
> ----------------------------------------------------------------------------------------------------------------------------
> (0.999999999999999999999999990, 50, -0.25, 0, 3.45)
> rows: 1
call dateadd('MS', 1, TIMESTAMP '2001-02-03 04:05:06.789001');
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论