View Issue Details

IDProjectCategoryView StatusLast Update
0003659SymmetricDSBugpublic2019-06-25 14:06
ReportermatthewehowardAssigned Tojaredfrees 
Prioritynormal 
Status closedResolutionfixed 
Product Version3.9.2 
Target VersionFixed 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 12:17

reporter   ~0001398

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

jaredfrees

2019-05-28 11:46

developer   ~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)
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)

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 12:30 matthewehoward New Issue
2019-03-03 12:17 matthewehoward Note Added: 0001398
2019-04-24 14:38 elong Tag Attached: dialect: sql anywhere
2019-04-24 14:39 elong Tag Attached: trigger
2019-05-22 13:51 jaredfrees Assigned To => jaredfrees
2019-05-22 13:51 jaredfrees Status new => assigned
2019-05-22 13:51 jaredfrees Status assigned => confirmed
2019-05-23 13:53 jaredfrees Status confirmed => acknowledged
2019-05-28 11:46 jaredfrees Note Added: 0001507
2019-05-28 11:54 jaredfrees Status acknowledged => resolved
2019-05-28 11:54 jaredfrees Resolution open => fixed
2019-05-28 11:54 jaredfrees Fixed in Version => 3.10.3
2019-05-28 12:00 jfrees Changeset attached => SymmetricDS 3.9 3ff364e5
2019-05-28 12:00 jfrees Changeset attached => SymmetricDS 3.10 e97e8108
2019-06-25 14:06 admin Status resolved => closed