Issue Details (XML | Word | Printable)

Key: DERBY-1528
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Knut Anders Hatlen
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Preparing "INSERT INTO table SELECT FROM (...)" may cause NullPointerException and subsequent internal errors reported by RawStore module

Created: 18/Jul/06 10:46 AM   Updated: 12/Nov/09 08:59 PM
Return to search
Component/s: SQL
Affects Version/s: 10.1.3.1
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works repro1528_assert.java 2006-07-18 11:19 AM Knut Anders Hatlen 1 kB
Java Source File Licensed for inclusion in ASF works repro1528_npe.java 2006-07-18 11:27 AM Knut Anders Hatlen 1 kB

Urgency: Normal
Issue & fix info: Workaround attached, Repro attached, High Value Fix


 Description  « Hide
When preparing a "INSERT INTO table SELECT FROM (...)" statement,
Derby in some cases throw a NullPointerException or an
AssertFailure. This happens when a '?' occurs in a VALUES statement in
the from list. If one tries to access the table after the
NullPointerException, this exception is thrown:

ERROR 40XT0: An internal error was identified by RawStore module.

Example:

ij> create table t (text varchar(20), len int);
0 rows inserted/updated/deleted
ij> prepare p as 'insert into t select x, length(x) from (values(?)) as v(x)';
ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
ij> select * from t;
ERROR 40XT0: An internal error was identified by RawStore module.

Replacing '?' with 'CAST (? AS VARCHAR(20))' fixes the problem, but
there is enough information in the query to determine the type of the
parameter even without the cast.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.