View Issue Details

IDProjectCategoryView StatusLast Update
0006348SymmetricDS ProBugpublic2024-04-22 19:00
Reporterotaburiaux Assigned Toelong  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.15.2 
Target Version3.15.6Fixed in Version3.15.6 
Summary0006348: Issue using DbCompare on SQLServer with table names using reserved keywords
DescriptionDBCompare fails on some table that have specific names: User and Rule (maybe more ?)
From the exception, it seems the sql query is missing brackets [ ] to prevent such issue.

Exception:
2024-03-18 13:21:42,928 INFO [server-2] [y] [server-2-compare-3|13-7] Querying row count for compare request 2-3-13 for table Rule: select count(*) from XXX.dbo.Rule where 1=1
2024-03-18 13:21:42,937 ERROR [server-2] [CompareService] [server-2-compare-3|13-7] Failed to compare request 2-3-13: StackTraceKey.init [SqlException:708650562] org.jumpmind.db.sql.SqlException: Incorrect syntax near the keyword 'Rule'.
    at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:308)
    at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:297)
    at org.jumpmind.db.sql.JdbcSqlTemplate.execute(JdbcSqlTemplate.java:504)
    at org.jumpmind.db.sql.JdbcSqlTemplate.queryForObject(JdbcSqlTemplate.java:170)
    at org.jumpmind.db.sql.AbstractSqlTemplate.queryForLong(AbstractSqlTemplate.java:68)
    at com.jumpmind.symmetric.console.impl.y.a(ExtractTable.java:61)
    at com.jumpmind.symmetric.console.impl.q.a(CompareTable.java:48)
    at com.jumpmind.symmetric.console.service.impl.CompareService.execute(CompareService.java:615)
    at org.jumpmind.symmetric.service.impl.NodeCommunicationService$1.run(NodeCommunicationService.java:544)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'Rule'.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:265)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1676)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:615)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:537)
    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7785)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:3793)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:268)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:242)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:456)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
    at org.jumpmind.db.sql.JdbcSqlTemplate$1.execute(JdbcSqlTemplate.java:181)
    at org.jumpmind.db.sql.JdbcSqlTemplate.execute(JdbcSqlTemplate.java:502)
    ... 9 more
Tagsdbcompare, dialect: sql-server

Activities

There are no notes attached to this issue.

Related Changesets

SymmetricDS: 3.15 62fb6aaf

2024-04-22 18:08:05

admin

Details Diff
0006348: Issue using DbCompare on SQLServer with table names using
reserved keywords
Affected Issues
0006348
mod - symmetric-db/src/main/java/org/jumpmind/db/model/Table.java Diff File
mod - symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/transform/TransformTable.java Diff File

Issue History

Date Modified Username Field Change
2024-04-16 12:55 otaburiaux New Issue
2024-04-16 12:55 otaburiaux Tag Attached: dbcompare
2024-04-16 12:55 otaburiaux Tag Attached: dialect: sql-server
2024-04-17 17:12 emiller Project SymmetricDS => SymmetricDS Pro
2024-04-22 18:07 elong Assigned To => elong
2024-04-22 18:07 elong Status new => assigned
2024-04-22 18:07 elong Target Version => 3.15.6
2024-04-22 18:07 elong Summary Issue using DbCompare on SQLServer with specific table names => Issue using DbCompare on SQLServer with table names using reserved keywords
2024-04-22 18:08 elong Status assigned => resolved
2024-04-22 18:08 elong Resolution open => fixed
2024-04-22 18:08 elong Fixed in Version => 3.15.6
2024-04-22 19:00 admin Changeset attached => SymmetricDS 3.15 62fb6aaf
2024-05-03 17:35 admin Status resolved => closed