提交 08131c2c authored 作者: Thomas Mueller's avatar Thomas Mueller

The built-in functions "power" and "radians" now always return a double.

上级 192c1525
......@@ -2269,9 +2269,7 @@ public class Function extends Expression implements FunctionCall {
break;
case ABS:
case FLOOR:
case RADIANS:
case ROUND:
case POWER:
t = p0.getType();
s = p0.getScale();
p = p0.getPrecision();
......
......@@ -63,6 +63,7 @@ public class TestFunctions extends TestBase implements AggregateFunction {
@Override
public void test() throws Exception {
deleteDb("functions");
testDataType();
testVersion();
testFunctionTable();
testFunctionTableVarArgs();
......@@ -100,6 +101,19 @@ public class TestFunctions extends TestBase implements AggregateFunction {
FileUtils.deleteRecursive(TEMP_DIR, true);
}
private void testDataType() throws SQLException {
Connection conn = getConnection("functions");
Statement stat = conn.createStatement();
assertEquals(Types.DOUBLE, stat.executeQuery(
"select radians(x) from dual").
getMetaData().getColumnType(1));
assertEquals(Types.DOUBLE, stat.executeQuery(
"select power(10, 2*x) from dual").
getMetaData().getColumnType(1));
stat.close();
conn.close();
}
private void testVersion() throws SQLException {
Connection conn = getConnection("functions");
Statement stat = conn.createStatement();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论