提交 c2d30074 authored 作者: Thomas Mueller's avatar Thomas Mueller

CAST(NULL AS ...) doesn't forget the data type, precision, and scale any longer.

上级 40c884a2
......@@ -1744,7 +1744,13 @@ public class Function extends Expression implements FunctionCall {
scale = s;
displaySize = d;
if (allConst) {
return ValueExpression.get(getValue(session));
Value v = getValue(session);
if (v == ValueNull.INSTANCE) {
if (info.type == CAST || info.type == CONVERT) {
return this;
}
}
return ValueExpression.get(v);
}
return this;
}
......
......@@ -52,6 +52,7 @@ public class TestMetaData extends TestBase {
testColumnDefault();
testCrossReferences();
testProcedureColumns();
testUDTs();
stat = conn.createStatement();
meta = conn.getMetaData();
......@@ -206,7 +207,6 @@ public class TestMetaData extends TestBase {
// meta.getSuperTables()
// meta.getSuperTypes()
// meta.getTypeInfo()
// meta.getUDTs()
conn.close();
......@@ -329,6 +329,17 @@ public class TestMetaData extends TestBase {
stat.execute("DROP ALIAS PROP");
}
private void testUDTs() throws SQLException {
meta = conn.getMetaData();
ResultSet rs;
rs = meta.getUDTs(null, null, null, null);
assertResultSetMeta(rs, 7, new String[] { "TYPE_CAT", "TYPE_SCHEM", "TYPE_NAME",
"CLASS_NAME", "DATA_TYPE", "REMARKS", "BASE_TYPE"
}, new int[] {
Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.SMALLINT, Types.VARCHAR,
Types.SMALLINT }, null, null);
}
private void testCrossReferences() throws SQLException {
meta = conn.getMetaData();
ResultSet rs;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论