ccording to the JDBC specification for DatabaseMetaData.getColumns(), the SOURCE_DATA_TYPE column (column 22) should be:
"source type of a distinct type or user-generated Ref type, SQL type from java.sql.Types (null if DATA_TYPE isn't DISTINCT or user-generated REF)"
However, HSQLDB returns a non-null SOURCE_DATA_TYPE value for columns where DATA_TYPE is neither Types.DISTINCT (2001) nor Types.REF (2006).
Steps to Reproduce:
Expected Result:
For a column with DATA_TYPE = 12 (VARCHAR), SOURCE_DATA_TYPE should be null.
Actual Result:
SOURCE_DATA_TYPE = 12 (non-null) is returned.
Example:
Column: PUBLIC.INFORMATION_SCHEMA.ADMINISTRABLE_ROLE_AUTHORIZATIONS.GRANTEE
DATA_TYPE: 12 (VARCHAR)
SOURCE_DATA_TYPE: 12 (should be null)
Environment:
Reference:
Feel free to adjust the version numbers based on your actual test environment.
Cannot see the issue. The value of the column is null when the DATA_TYPE is not distinct.