提交 ff7bcccc 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.
上级 8b246de5
...@@ -11,6 +11,7 @@ import java.io.InputStream; ...@@ -11,6 +11,7 @@ import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.OutputStream; import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.sql.Array;
import java.sql.Blob; import java.sql.Blob;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DatabaseMetaData; import java.sql.DatabaseMetaData;
...@@ -596,10 +597,20 @@ public class TestFunctions extends TestBase implements AggregateFunction { ...@@ -596,10 +597,20 @@ public class TestFunctions extends TestBase implements AggregateFunction {
stat.execute("CREATE ALIAS ARRAY FOR \"" + getClass().getName() + ".getArray\""); stat.execute("CREATE ALIAS ARRAY FOR \"" + getClass().getName() + ".getArray\"");
rs = stat.executeQuery("CALL ARRAY()"); rs = stat.executeQuery("CALL ARRAY()");
assertEquals(2, rs.getMetaData().getColumnCount()); assertEquals(1, rs.getMetaData().getColumnCount());
rs.next(); rs.next();
assertEquals(0, rs.getInt(1)); Array a = rs.getArray(1);
assertEquals("Hello", rs.getString(2)); Object[] array = (Object[]) a.getArray();
assertEquals(2, array.length);
assertEquals(0, ((Integer) array[0]).intValue());
assertEquals("Hello", (String) array[1]);
ResultSet rs2 = a.getResultSet();
rs2.next();
assertEquals(1, rs2.getInt(1));
assertEquals(0, rs2.getInt(2));
rs2.next();
assertEquals(2, rs2.getInt(1));
assertEquals("Hello", rs2.getString(2));
assertFalse(rs.next()); assertFalse(rs.next());
stat.execute("CREATE ALIAS ROOT FOR \"" + getClass().getName() + ".root\""); stat.execute("CREATE ALIAS ROOT FOR \"" + getClass().getName() + ".root\"");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论