View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004800||SymmetricDS||Improvement||public||2021-01-29 13:54||2021-02-04 05:49|
|Summary||0004800: Subselect router expression improvement|
|Description||I 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:|
from sym_node c
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.
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)