View Issue Details

IDProjectCategoryView StatusLast Update
0002238SymmetricDSBugpublic2015-03-30 09:23
ReporterspadalkarAssigned Tochenson 
PriorityhighSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.7.10 
Target Version3.7.11Fixed in Version3.7.11 
Summary0002238: Router service fails due to Syntax error
Description'select d.data_id, d.table_name, d.event_type, d.row_data as row_data, d.pk_data as pk_data, d.old_data as old_data, d.create_time, d.trigger_hist_id, d.channel_id, d. transaction_id, d.source_node_id, d.external_data, d.node_list from sym_data d where d.channel_id=@p0 and data_id >= @p1order by d.data_id asc'

TDS 1: SQL error: 'SQL Anywhere Error -131: Syntax error near 'by' on line 1'

There is missing space between at start of 'order by' clause.
Additional InformationQuick Fix:
===================================================================


Index: trunk/symmetric-core/src/main/java/org/jumpmind/symmetric/route/DataGapRouteReader.java
===================================================================
--- trunk/symmetric-core/src/main/java/org/jumpmind/symmetric/route/DataGapRouteReader.java (revision 9414)
+++ trunk/symmetric-core/src/main/java/org/jumpmind/symmetric/route/DataGapRouteReader.java (working copy)
@@ -302,7 +302,7 @@
         }
         
         if (parameterService.is(ParameterConstants.ROUTING_DATA_READER_ORDER_BY_DATA_ID_ENABLED, true)) {
- sql = sql + engine.getRouterService().getSql("orderByDataId");
+ sql = sql + " " + engine.getRouterService().getSql("orderByDataId");
         }
 
         ISqlTemplate sqlTemplate = engine.getSymmetricDialect().getPlatform().getSqlTemplate();




Real Issue: (As per my understanding)
===================================================================

trunk/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/AbstractSqlMap.java


In protected void putSql(String key, String sql) we are calling this.platform.scrubSql(sql) which uses trim function as follows:

return FormatUtils.replaceTokens(sql, replacementTokens, false).trim();

Due to this we get above erroneous sql statement.
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Related Changesets

SymmetricDS: master 53b91869

2015-03-25 10:15:41

chenson

Details Diff
0002238: Router service fails due to Syntax error
0002238
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/route/DataGapRouteReader.java Diff File

Issue History

Date Modified Username Field Change
2015-03-24 20:13 spadalkar New Issue
2015-03-25 10:15 chenson Assigned To => chenson
2015-03-25 10:15 chenson Status new => assigned
2015-03-25 10:15 chenson Fixed in Version => 3.7.11
2015-03-25 10:15 chenson Target Version => 3.7.11
2015-03-25 10:15 chenson Status assigned => resolved
2015-03-25 10:15 chenson Resolution open => fixed
2015-03-25 11:00 chenson Changeset attached => SymmetricDS trunk r9415
2015-03-30 09:23 chenson Status resolved => closed
2015-07-30 21:49 chenson Changeset attached => SymmetricDS master 53b91869