Hi !
While testing an application we realized than H2 1.3-168 seems to not
handle properly FOREIGN KEYs defined between 2 tables when a same foreign
key is defined with more than a single field.
For example such a FK (below) does not raise a violation when inserting bad
datas in the couple supposedly protected by the FK. It seems to me it
behaves like 2 separates FKs on single fields, while it is NOT the
expected behavior. A composite FK is supposed to protect the data
combination, not single separate fields values.
ALTER TABLE
TEST_POSSIBLE_BUG
ADD CONSTRAINT FK_TEST001
FOREIGN KEY (tpg_aaa_id,tpg_bbb_id)
REFERENCES MASTER_TABLE (aaa_id,bbb_id);
where all fields are INTEGERs all NOT NULL. In Oracle, SQLserver, Mysql,
postgres, hsqldb, inserting a couple of data in the detail table not
existing in the master table raise an error "FK violated", NOT in H2
1.3-168, the data IS inserted against all odds.
It looks like to me as a big bad bug, at least a dangerous behavior as most
SQL programmers expect a composite FK to protect data integrity, like in
other RDBMs systems.
Am I right ?
Does anyone noticed that before ?
Thx,
Patrox.
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/h2-database/-/3U5ejJMqwsMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.