View Issue Details

IDProjectCategoryView StatusLast Update
0004800SymmetricDSImprovementpublic2021-02-04 05:49
Reporteravarianik Assigned To 
Status newResolutionopen 
Product Version3.12.4 
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.




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)


2021-02-04 05:49

reporter   ~0001888

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