View Issue Details

IDProjectCategoryView StatusLast Update
0003711SymmetricDSBugpublic2019-04-11 19:20
Reportergwilmer Assigned Tojosh-a-hicks  
Priorityhigh 
Status closedResolutionfixed 
Product Version3.9.12 
Target Version3.9.15Fixed in Version3.9.15 
Summary0003711: Table reload request for a table with a foreign to itself and a data row where the row fk is to itself doesn't load any data
DescriptionTable reload request for a table with a foreign to itself and a data row where the row fk is to itself doesn't load any data to the target table
Steps To Reproduce1. Create simple 2 node sync scenario (server -> client)
2. Create the following table:

CREATE TABLE "TEST"(
    "ID" INTEGER NOT NULL,
    "NAME" CHAR(50) NULL,
    "PARENT_ID" INTEGER,
    PRIMARY KEY ("ID")
);
ALTER TABLE "TEST"
    ADD CONSTRAINT "CONSTRAINT_273C" FOREIGN KEY ("PARENT_ID") REFERENCES "TEST" ("ID");

Add the following data to the table on the server:

insert into test values (1,'first row',1)
insert into test values (2,'child',1)

3. Configure table test to sync from server to client
4. Initiate a reload request of table test from server to client

Batch will be created, and be sent OK with zero rows.
TagsNo tags attached.

Relationships

related to 0003598 closedelong Order rows in initial load for table with self-referencing foreign key 
has duplicate 0003712 closed Syncing a table with FK to itself and then issuing a delete * from table on src results in FK error on target 
has duplicate 0001341 closedelong Initial loads on table with FK to itself may fail with FK violations 

Activities

hanes

2018-10-03 18:20

developer   ~0001254

The trick is that there can be cases where there is no node with a parent of null. The example above shows that the database also supports a "root" node where the node points to itself (i.e., id = parent_id). Should handle the case where parent_id = null and id = parent_id similarly.

Related Changesets

SymmetricDS: 3.9 afa37309

2018-10-12 16:02:54

josh-a-hicks

Details Diff
0003711: Table reload request for a table with a foreign to itself and a
data row where the row fk is to itself doesn't load any data
Affected Issues
0003711
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/DataExtractorService.java Diff File

Issue History

Date Modified Username Field Change
2018-09-08 13:18 gwilmer New Issue
2018-09-10 11:45 gwilmer Assigned To => gwilmer
2018-09-10 11:45 gwilmer Status new => assigned
2018-10-03 17:34 hanes Relationship added related to 0003598
2018-10-03 18:20 hanes Note Added: 0001254
2018-10-03 18:21 hanes Target Version => 3.9.15
2018-10-03 18:21 hanes Assigned To gwilmer =>
2018-10-12 20:03 josh-a-hicks Assigned To => josh-a-hicks
2018-10-12 20:04 josh-a-hicks Status assigned => resolved
2018-10-12 20:04 josh-a-hicks Resolution open => fixed
2018-10-12 20:04 josh-a-hicks Fixed in Version => 3.9.15
2018-10-12 21:00 josh-a-hicks Changeset attached => SymmetricDS 3.9 afa37309
2018-10-25 19:21 hanes Relationship added has duplicate 0003712
2018-10-31 18:59 mmichalek Status resolved => closed
2019-04-11 19:20 elong Relationship added has duplicate 0001341