View Issue Details

IDProjectCategoryView StatusLast Update
0003643SymmetricDSBugpublic2018-08-03 14:12
Reporterefraimmachado Assigned Tojosh-a-hicks  
Priorityhigh 
Status closedResolutionfixed 
Target Version3.9.10Fixed in Version3.9.10 
Summary0003643: Error in DB2 select's for initial load and triggers
DescriptionThe SymmetricDS code generates a wrong triggers and selects (for initial load) because there are cases when a string column has a empty string a error happens during the execution of replace function.

In the class DB2TriggerTemplate, there is a string variable called stringColumnTemplate responsible to define the template to generate triggers and the select used in the initial load. The stringColumnTamplate is:
 stringColumnTemplate = "case when $(tableAlias).\"$(columnName)\" is null then $(oracleToClob)'' else '\"' || replace(replace($(oracleToClob)$(tableAlias).\"$(columnName)\",'\\','\\\\'),'\"','\\\"') || '\"' end" ;

The correct should be like this to avoid the case above:

 stringColumnTemplate = "case when $(tableAlias).\"$(columnName)\" is null or $(tableAlias).\"$(columnName)\" = '' then $(oracleToClob)'' else '\"' || replace(replace($(oracleToClob)$(tableAlias).\"$(columnName)\",'\\','\\\\'),'\"','\\\"') || '\"' end" ;
Steps To ReproduceRun symmetricDS using demo enviromment (db2 zos) and set an row of item table with the name '' (empty string).
When the inital load or the item table trigger is executed the error -171 will happen.
TagsNo tags attached.

Activities

josh-a-hicks

2018-07-24 19:25

developer   ~0001219

Here is a batch to utilize this change.

https://www.jumpmind.com/downloads/symmetricds/patches/3.9/patch-0003643.jar

Related Changesets

SymmetricDS: 3.9 ad2e7396

2018-07-25 08:31:07

josh-a-hicks

Details Diff
0003643: Error in DB2 select's for initial load and triggers Affected Issues
0003643
mod - symmetric-client/src/main/java/org/jumpmind/symmetric/db/db2/Db2zOsTriggerTemplate.java Diff File

Issue History

Date Modified Username Field Change
2018-07-23 12:34 efraimmachado New Issue
2018-07-24 19:25 josh-a-hicks Note Added: 0001219
2018-07-25 12:32 josh-a-hicks Assigned To => josh-a-hicks
2018-07-25 12:32 josh-a-hicks Status new => resolved
2018-07-25 12:32 josh-a-hicks Resolution open => fixed
2018-07-25 12:32 josh-a-hicks Fixed in Version => 3.9.10
2018-07-25 13:00 josh-a-hicks Changeset attached => SymmetricDS 3.9 ad2e7396
2018-08-03 14:12 chenson Status resolved => closed