View Issue Details

IDProjectCategoryView StatusLast Update
0003659SymmetricDSBugpublic2018-08-03 12:30
ReportermatthewehowardAssigned To 
Prioritynormal 
Status newResolutionopen 
Product Version3.9.2 
Target VersionFixed in Version 
Summary0003659: SqlAnywhere dialect crashes when DB name has special char
DescriptionMy client has a (Sybase SqlAnywhere) database named with a "-" which seemed to cause problems in the triggers that SYM creates. For example if the database name is "product-staging" and the schema is "ABC" then the trigger that is created on the tables contains text like below:

if(product-staging.ABC.sym_triggers_disabled(0) = 0) begin

This causes an exception when we insert/update to this table Column 'product' not found because it reads the "-" as an operator. I've created a patch locally that fixes this by calling SymmetricUtils.quote in both getSyncTriggersExpression and getTransactionTriggerExpression in https://github.com/JumpMind/symmetric-ds/blob/a894239d22e2a602be1dfaf87de9ef059e3d65a7/symmetric-client/src/main/java/org/jumpmind/symmetric/db/sqlanywhere/SqlAnywhereSymmetricDialect.java#L250

This produces the trigger text:
if("product-staging".ABC.sym_triggers_disabled(0) = 0) begin

I'm fairly sure I should apply the same to the schema name as well - but not sure if there are other places where these should be quoted either in the SqlAnywhere dialect or other dialects. My patch has resolved the issue for my client for now.





Steps To ReproducePoint symmetric to a Sybase/SqlAnywhere database named with a "-" in it.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2018-08-03 12:30 matthewehoward New Issue