db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel John Debrunner (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3350) SQL CAST always marks its type as nullable even if the expression to be cast is not nullable
Date Thu, 24 Jan 2008 20:08:35 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12562197#action_12562197

Daniel John Debrunner commented on DERBY-3350:

One issue is the nullability of various columns returned from DatabaseMetaData.getXXX() calls.

E.g. getTables() column 1 TABLE_CAT is currently nullable for Derby's meta data, and this
is tested in DatabaseMetaDataTest

The JDBC docs say the column '(may be null)' - though I don't think that means has to be nullable
in any implementation.

Derby's expression that produces this column is:


 which returns the empty string as the catalog for the table, not NULL.

Fixing this bug changes the nullability to not nullable and thus causes DatabaseMetaDataTest
to fail. Seems like changing nullability to not null is correct here, it seems that Derby
returns '' if a table does not have a catalog, and to preserve backwards compatibility that
would continue to be the case, even if Derby supported catalogs.

> SQL CAST always marks its type as nullable even if the expression to be cast is not nullable
> --------------------------------------------------------------------------------------------
>                 Key: DERBY-3350
>                 URL: https://issues.apache.org/jira/browse/DERBY-3350
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions:,,,,,,,,,
>            Reporter: Daniel John Debrunner
>            Assignee: Daniel John Debrunner
>            Priority: Minor
> Can be exposed as a column's type in a ResultSet being nullable when in reality it can
never be null.
> Can impact performance as the SQL compiler can general optimal paths with correct nullability,
e.g. a non-null INTEGER expression does not need normalization if being stored in a non-null
INTEGER column, routine calling can be optimized for a RETURNS NULL ON NULL INPUT function
if the inputs are never null.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message