getExportedKeys throws Null Exception for foreign key without explicit primary column name

Issue #44 resolved
Anonymous created an issue

I have a schema like:

create table REFERRED(ID integer primary key not null); create table REFERRING(ID integer, RID integer, foreign key (RID) references REFERRED2 );

On schema loading I get: REFERRED java.lang.NullPointerException at org.sqlite.MetaData.escape(MetaData.java:1862) at org.sqlite.MetaData.getExportedKeys(MetaData.java:1504)

I've tried 3.7.2 and the latest 3.7.15 builds.

Comments (9)

  1. Greg Shrago

    Please reopen as the error occurs regardless of my typo in the description of the ticket.

    The problem is in org.sqlite.MetaData.getExportedKeys which tries to escape NULL key name.

    Here you go. No typo this time:

    create table REFERRED (ID integer primary key not null);

    create table REFERRING (ID integer, RID integer, foreign key (RID) references REFERRED);

  2. Log in to comment