db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4439) NullPointerException at bind time when selecting from VALUES NULL
Date Tue, 10 Nov 2009 14:53:27 GMT

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

Knut Anders Hatlen commented on DERBY-4439:

I'm not sure if "insert into u select * from (values null) as X" is supposed to be accepted.

NULL is an <implicitly typed value specification> (see SQL:2003, part 2, 6.5 <contextually
typed value specification>), which can be found in a <contextually typed value specification>,
in a <cast specification>, or in a <default clause>.

In "insert into u select * from (values null) as X", the "values null" part is a <table
value constructor>, which as far as I can see does not accept a <contextually typed
value specification>. In "insert into u values null", on the other hand, it's a <contextually
typed table value constructor>, which does accept contextually typed values.

> NullPointerException at bind time when selecting from VALUES NULL
> -----------------------------------------------------------------
>                 Key: DERBY-4439
>                 URL: https://issues.apache.org/jira/browse/DERBY-4439
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions:,
>            Reporter: Knut Anders Hatlen
>            Priority: Minor
> I see a NullPointerException when I try the following query:
> ij> select x*2 from (values null) v(x);
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> It should fail gracefully instead, like this similar query:
> ij> select x from (values null) v(x);
> ERROR 42X07: Null is only allowed in a VALUES clause within an INSERT statement.

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

View raw message