View Issue Details

IDProjectCategoryView StatusLast Update
0003659SymmetricDSBugpublic2019-06-25 18:06
Reportermatthewehoward Assigned Touser606 
Prioritynormal 
Status closedResolutionfixed 
Product Version3.9.2 
Target Version3.10.3Fixed in Version3.10.3 
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.
Tagsdialect: sql anywhere, trigger

Activities

matthewehoward

2019-03-03 17:17

reporter   ~0001398

submitted PR https://github.com/JumpMind/symmetric-ds/pull/102

user606

2019-05-28 15:46

  ~0001507

I actually don't get any errors when the schema name has a hyphen in it, similar to what you are saying with the database name. I think this is just a weird thing with the SQL Anywhere driver. Your change does fix the problem with the database name.

Related Changesets

SymmetricDS: 3.9 3ff364e5

2019-05-28 11:49:41

matthoward


Committer: jfrees Details Diff
0003659: SqlAnywhere dialect crashes when DB name has special char (#102) Affected Issues
0003659
mod - symmetric-client/src/main/java/org/jumpmind/symmetric/db/sqlanywhere/SqlAnywhereSymmetricDialect.java Diff File

SymmetricDS: 3.10 e97e8108

2019-05-28 11:49:41

matthoward


Committer: jfrees Details Diff
0003659: SqlAnywhere dialect crashes when DB name has special char (#102)


(cherry picked from commit 3ff364e519d4893ae205b0c372898a322c99ae89)
Affected Issues
0003659
mod - symmetric-client/src/main/java/org/jumpmind/symmetric/db/sqlanywhere/SqlAnywhereSymmetricDialect.java Diff File

Issue History

Date Modified Username Field Change
2018-08-03 16:30 matthewehoward New Issue
2019-03-03 17:17 matthewehoward Note Added: 0001398
2019-04-24 18:38 elong Tag Attached: dialect: sql anywhere
2019-04-24 18:39 elong Tag Attached: trigger
2019-05-22 17:51 user606 Assigned To => user606
2019-05-22 17:51 user606 Status new => assigned
2019-05-22 17:51 user606 Status assigned => confirmed
2019-05-23 17:53 user606 Status confirmed => acknowledged
2019-05-28 15:46 user606 Note Added: 0001507
2019-05-28 15:54 user606 Status acknowledged => resolved
2019-05-28 15:54 user606 Resolution open => fixed
2019-05-28 15:54 user606 Fixed in Version => 3.10.3
2019-05-28 16:00 jfrees Changeset attached => SymmetricDS 3.9 3ff364e5
2019-05-28 16:00 jfrees Changeset attached => SymmetricDS 3.10 e97e8108
2019-06-25 18:06 admin Status resolved => closed