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

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

上级 8f7f256e
...@@ -1230,15 +1230,14 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat ...@@ -1230,15 +1230,14 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
} }
checkClosed(); checkClosed();
PreparedStatement prep = conn.prepareAutoCloseStatement("SELECT " PreparedStatement prep = conn.prepareAutoCloseStatement("SELECT "
+ "CATALOG_NAME TYPE_CAT, " + "CAST(NULL AS VARCHAR) TYPE_CAT, "
+ "CATALOG_NAME TYPE_SCHEM, " + "CAST(NULL AS VARCHAR) TYPE_SCHEM, "
+ "CATALOG_NAME TYPE_NAME, " + "CAST(NULL AS VARCHAR) TYPE_NAME, "
+ "CATALOG_NAME CLASS_NAME, " + "CAST(NULL AS VARCHAR) CLASS_NAME, "
+ "CAST(ZERO() AS SMALLINT) DATA_TYPE, " + "CAST(NULL AS SMALLINT) DATA_TYPE, "
+ "CATALOG_NAME REMARKS, " + "CAST(NULL AS VARCHAR) REMARKS, "
+ "CAST(ZERO() AS SMALLINT) BASE_TYPE " + "CAST(NULL AS SMALLINT) BASE_TYPE "
+ "FROM INFORMATION_SCHEMA.CATALOGS " + "FROM DUAL WHERE FALSE");
+ "WHERE FALSE");
return prep.executeQuery(); return prep.executeQuery();
} catch (Exception e) { } catch (Exception e) {
throw logAndConvert(e); throw logAndConvert(e);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论