View Issue Details

IDProjectCategoryView StatusLast Update
0004800SymmetricDSImprovementpublic2021-11-17 16:00
Reporteravarianik Assigned Toelong  
Prioritylow 
Status closedResolutionfixed 
Product Version3.12.4 
Target Version3.13.0Fixed in Version3.13.0 
Summary0004800: Subselect router expression improvement
DescriptionI catch a bug In my project with symmetricDS, recently. Data events could not been insetred because of key (data_id, batch_id) have been duplicated. During research i found problem in routing process. One of my subselect router produce node which not included in router's target group. The point was in provided router expression: A or B, without parentheses. So full router query was:

select c.node_id
from sym_node c
where c.node_group_id=:NODE_GROUP_ID
        and c.sync_enabled=1 and A or B

When B expression is true all nodes returnes.

I know is my fault, but i think i'm not only one, who made a careless mistake.
So i propose to add parentheses for concatanable part of sql by default.

Tagsrouting

Activities

elong

2021-02-03 18:42

developer   ~0001886

Makes sense. For subselect, the router expression (for example: A or B) provided by user should be wrapped in parenthesis, like this:

select c.node_id from sym_node c where c.node_group_id=:NODE_GROUP_ID and c.sync_enabled=1 and (A or B)

avarianik

2021-02-04 05:49

reporter   ~0001888

https://github.com/JumpMind/symmetric-ds/pull/140

Related Changesets

SymmetricDS: 3.13 1708bb8b

2021-10-08 20:21:21

admin

Details Diff
0004800: Subselect router expression in parens Affected Issues
0004800
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/route/SubSelectDataRouter.java Diff File

Issue History

Date Modified Username Field Change
2021-01-29 13:54 avarianik New Issue
2021-01-29 13:54 avarianik Tag Attached: routing
2021-02-03 18:42 elong Note Added: 0001886
2021-02-04 05:49 avarianik Note Added: 0001888
2021-10-08 20:22 elong Assigned To => elong
2021-10-08 20:22 elong Status new => resolved
2021-10-08 20:22 elong Resolution open => fixed
2021-10-08 20:22 elong Fixed in Version => 3.13.0
2021-10-08 20:22 elong Target Version => 3.13.0
2021-10-08 21:00 admin Changeset attached => SymmetricDS 3.13 1708bb8b
2021-11-17 16:00 admin Status resolved => closed