View Issue Details

IDProjectCategoryView StatusLast Update
0000069SymmetricDSBugpublic2009-01-11 15:26
ReporterAssigned Tochenson  
Priorityhigh 
Status closedResolutionfixed 
Product Version1.6.0 
Target Version1.6.1Fixed in Version1.6.1 
Summary0000069: Catalog and Schema Names Need Quotes on SQL Server
Description"My MSSQL Server database has dashes in its name. The query run by {{AbstractDbDialect.determineAutoIncrementFromResultSetMetaData}} breaks because of the dashes. It appears the fix is to make sure the DB object names are quoted. *The offending statement is*: {{SELECT t.""channel_id"",t.""processing_order"",t.""max_batch_size"",t.""max_batch_to_send"",t.""enabled"",t.""description"" FROM x-34-symmetric.dbo.""sym_channel"" t WHERE 1 = 0}} *The statement is fixed when the db object names are quoted*: {{SELECT t.""channel_id"",t.""processing_order"",t.""max_batch_size"",t.""max_batch_to_send"",t.""enabled"",t.""description"" FROM {color:blue}""x-34-symmetric"".""dbo""{color}.""sym_channel"" t WHERE 1 = 0}} Here's the salient log: 2009-04-17 10:59:18,875 ERROR [jdbc.audit] [main] 11. Statement.executeQuery(SELECT t.""channel_id"",t.""processing_order"",t.""max_batch_size"",t.""max_batch_to_send"",t.""enabled"",t.""description"" FROM xcenter-34-symmetric.dbo.""sym_channel"" t WHERE 1 = 0) SELECT t.""channel_id"",t.""processing_order"",t.""max_batch_size"",t.""max_batch_to_send"",t.""enabled"",t.""description"" FROM xcenter-34-symmetric.dbo.""sym_channel"" t WHERE 1 = 0 com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '-'. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(Unknown Source) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source) at net.sf.log4jdbc.StatementSpy.executeQuery(StatementSpy.java:661) at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205) at org.jumpmind.symmetric.db.AbstractDbDialect$4.doInStatement(AbstractDbDialect.java:493) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:396) at org.jumpmind.symmetric.db.AbstractDbDialect.determineAutoIncrementFromResultSetMetaData(AbstractDbDialect.java:491) . . ."
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change