View Issue Details

IDProjectCategoryView StatusLast Update
0005272SymmetricDSBugpublic2022-06-06 12:37
Reporterpmarzullo Assigned Topmarzullo  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.12.7 
Target Version3.13.5Fixed in Version3.13.5 
Summary0005272: Conflict Resolution of deletes of parent records fail to delete child records when child tables have no primary keys
DescriptionWhen a parent record is deleted, and the child record that refers to that parent record is still in the database, the attempt to delete the child record referring to the parent is record fails when the child table has no primary keys defined.

The delete SQL ends up being syntactically incorrect:
delete from child_table where

The where clause is empty because there are no primary keys defined.

If no primary keys are defined, then use the columns that reference the parent record:
delete from child_table where parent_id=parent_value;
Steps To Reproduce1. Create parent table
create table parent {id number not null, constraint parent_pk primary key(id));
2. Create child table referring to parent table, but with no primary keys
create table child {id number not null, parent_id number not null, foreign key (parent_id) references parent(id)};
3. Insert into parent table
insert into parent values(1);
4. Insert into child table
insert into child values(2,1);
5. Sync records to client
6. Shut off pull job on client
7. Delete child record in child table in the server node
8. Ignore the batch for this delete
9. Turn on pull job in client
10. Delete parent record in the server node
11. Sync should fail with a syntax error in client node:
delete from child where;
Tagsconflict manager

Relationships

related to 0005271 closedpmarzullo Conflict Resolution of deletes of parent records fail to delete child records when child tables have no primary keys 

Activities

There are no notes attached to this issue.

Related Changesets

SymmetricDS: 3.13 04bd62ea

2022-04-15 19:44:12

pmarzullo

Details Diff
0005272: Conflict Resolution of deletes of parent records fail to delete
child records when child tables have no primary keys
Affected Issues
0005272
mod - symmetric-io/src/test/java/org/jumpmind/symmetric/io/AbstractWriterTest.java Diff File
mod - symmetric-io/src/test/java/org/jumpmind/symmetric/io/data/writer/DatabaseWriterConflictTest.java Diff File
mod - symmetric-io/src/test/resources/testDatabaseWriter.xml Diff File
mod - symmetric-jdbc/src/main/java/org/jumpmind/db/platform/AbstractJdbcDdlReader.java Diff File

SymmetricDS: 3.14 eb63779d

2022-04-15 19:44:12

pmarzullo

Details Diff
0005272: Conflict Resolution of deletes of parent records fail to delete
child records when child tables have no primary keys
Affected Issues
0005272
mod - symmetric-io/src/test/java/org/jumpmind/symmetric/io/AbstractWriterTest.java Diff File
mod - symmetric-io/src/test/java/org/jumpmind/symmetric/io/data/writer/DatabaseWriterConflictTest.java Diff File
mod - symmetric-io/src/test/resources/testDatabaseWriter.xml Diff File
mod - symmetric-jdbc/src/main/java/org/jumpmind/db/platform/AbstractJdbcDdlReader.java Diff File

Issue History

Date Modified Username Field Change
2022-04-15 19:42 pmarzullo New Issue
2022-04-15 19:42 pmarzullo Status new => assigned
2022-04-15 19:42 pmarzullo Assigned To => pmarzullo
2022-04-15 19:42 pmarzullo Tag Attached: conflict manager
2022-04-15 19:43 pmarzullo Relationship added related to 0005271
2022-04-15 19:48 pmarzullo Status assigned => resolved
2022-04-15 19:48 pmarzullo Resolution open => fixed
2022-04-15 19:48 pmarzullo Fixed in Version => 3.13.5
2022-04-15 20:00 pmarzullo Changeset attached => SymmetricDS 3.13 04bd62ea
2022-04-15 20:00 pmarzullo Changeset attached => SymmetricDS 3.14 eb63779d
2022-06-06 12:37 admin Status resolved => closed