Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-4253

SQL Server connector fails when database name requires quoting.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 1.7.0.Final
    • sqlserver-connector
    • None
    • False
    • False

      Starting with 1.7.0.Final the SQL Server connector fails with `com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '.'.` when the database name requires quoting (in our case, the database name starts with a digit). The 1.6.3.Final build does not fail against the same database. It appears that it's commit 37a4523685 which introduces the issue by prefixing function/procedure names but not bracket-quoting the database name component when interpolating in `replaceDatabaseNamePlaceholder`.

       

      Complete exception:
      ERROR Producer failure (io.debezium.pipeline.ErrorHandler:31)
      io.debezium.DebeziumException: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '.'.
      at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:79)
      at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:118)
      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '.'.
      at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262)
      at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1621)
      at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:868)
      at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:768)
      at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7194)
      at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2935)
      at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:248)
      at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:223)
      at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(SQLServerStatement.java:693)
      at io.debezium.jdbc.JdbcConnection.queryAndMap(JdbcConnection.java:644)
      at io.debezium.jdbc.JdbcConnection.queryAndMap(JdbcConnection.java:513)
      at io.debezium.connector.sqlserver.SqlServerConnection.getMaxLsn(SqlServerConnection.java:184)
      at io.debezium.connector.sqlserver.SqlServerSnapshotChangeEventSource.determineSnapshotOffset(SqlServerSnapshotChangeEventSource.java:168)
      at io.debezium.connector.sqlserver.SqlServerSnapshotChangeEventSource.determineSnapshotOffset(SqlServerSnapshotChangeEventSource.java:33)
      at io.debezium.relational.RelationalSnapshotChangeEventSource.doExecute(RelationalSnapshotChangeEventSource.java:116)
      at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:70)
      ... 6 more

              Unassigned Unassigned
              sg-djackowitz Daniel Jackowitz (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: