Menu

#1743 DatabaseMetaData.getColumns() returns non-null SOURCE_DATA_TYPE for non-DISTINCT/non-REF columns

version 2.5.x
open-works-for-me
5
2026-03-22
2026-02-02
Jin Kwon
No

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:

  1. Create an in-memory HSQLDB database
  2. Call DatabaseMetaData.getColumns() on system tables (e.g., INFORMATION_SCHEMA.ADMINISTRABLE_ROLE_AUTHORIZATIONS)
  3. Observe the SOURCE_DATA_TYPE value for VARCHAR columns

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:

  • HSQLDB version: 2.7.x
  • JDBC version: 4.2

Reference:


Feel free to adjust the version numbers based on your actual test environment.

Discussion

  • Fred Toussi

    Fred Toussi - 2026-03-22
    • status: open --> open-works-for-me
    • assigned_to: Fred Toussi
     
  • Fred Toussi

    Fred Toussi - 2026-03-22

    Cannot see the issue. The value of the column is null when the DATA_TYPE is not distinct.

     

Log in to post a comment.

MongoDB Logo MongoDB