FK question, 2.3.3

Brian Young <[email protected]> Wed, 22 Jul 2015 20:01:43 -0400
Newsgroups gmane.comp.java.hsqldb.user
Message-ID <CAA1svc-pKPyGhxrB53zL-8kNfnm_1oFamc8dDMFHqzef5to-TQ@mail.gmail.com>
I am in the early stages of updating to 2.3.3.   So far I am dealing with
some unit test failures in our codebase after the update.

The unit test deletes a row from the table in question, and it is failing
with 2.3.3:
org.hsqldb.HsqlException: integrity constraint violation: foreign key no
action; SYS_FK_10265 table: MYTABLE

There are a few other tables that have a foreign key to this table and they
declare:
FOREIGN KEY (mytable_id) REFERENCES mytable(id) ON DELETE CASCADE

Also MYTABLE has a couple of foreign keys, the only one that might be
notable is a self reference, e.g.

CREATE CACHED TABLE mytable (
id INTEGER GENERATED BY DEFAULT AS SEQUENCE seq_mytable_id PRIMARY KEY,
 ...
alias_of INTEGER NOT NULL,
FOREIGN KEY (alias_of) REFERENCES mytable(id)

I saw a couple references to FK handling in the 2.3.3 release notes and
assume perhaps our DB was doing something wrong all along and it is just
now being caught, but I'm not sure what it might be.

Thanks,
Brian

------------------------------------------------------------------------------

_______________________________________________
Hsqldb-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user