Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-11443

Document that database name from JDBC url is case sensitive

    Details

    • Type: Documentation
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.4
    • Fix Version/s: 7.8
    • Component/s: Database
    • Edition:
      Community
    • Production Notes:
      None

      Description

      (from https://discuss.sonarsource.com/t/v7-4-database-name-now-case-sensitive/1484)

      Prior to v7.4, the case of the database name did not matter (a database named sonar74 could be represented as sonar74 or Sonar74 in the JDBC connection string and both would work).

      java.lang.IllegalStateException: Can not check that table schema_migrations exists
      at org.sonar.db.DatabaseUtils.wrapSqlException(DatabaseUtils.java:324)
      at org.sonar.db.DatabaseUtils.doTableExists(DatabaseUtils.java:319)
      at org.sonar.db.DatabaseUtils.tableExists(DatabaseUtils.java:290)
      at org.sonar.server.platform.db.migration.history.MigrationHistoryTableImpl.start(MigrationHistoryTableImpl.java:44)
      at java.util.Optional.ifPresent(Optional.java:159)
      at org.sonar.server.platform.platformlevel.PlatformLevel2.start(PlatformLevel2.java:107)
      at org.sonar.server.platform.Platform.start(Platform.java:211)
      at org.sonar.server.platform.Platform.startLevel2Container(Platform.java:177)
      at org.sonar.server.platform.Platform.init(Platform.java:87)
      at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:45)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      
      Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The database name component of the object qualifier must be the name of the current database.
      	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:258)
      	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1535)
      	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:467)
      	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:409)
      	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7151)
      	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2478)
      	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:219)
      	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:199)
      	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQueryInternal(SQLServerPreparedStatement.java:344)
      	at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getResultSetFromStoredProc(SQLServerDatabaseMetaData.java:301)
      	at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getResultSetWithProvidedColumnNames(SQLServerDatabaseMetaData.java:316)
      	at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getTables(SQLServerDatabaseMetaData.java:481)
      	at org.apache.commons.dbcp2.DelegatingDatabaseMetaData.getTables(DelegatingDatabaseMetaData.java:902)
      	at org.apache.commons.dbcp2.DelegatingDatabaseMetaData.getTables(DelegatingDatabaseMetaData.java:902)
      	at org.sonar.db.DatabaseUtils.doTableExists(DatabaseUtils.java:310)
      	... 17 common frames omitted`
      

      This behavior has not been introduced on purpose but is rather a side effect of other changes (see PR https://github.com/SonarSource/sonar-enterprise/pull/666).

      However,  there is no workaround the case of the database being now case sensitive when it is, this behavior is the responsibility of the JDBC driver and therefor it should be explicitly documented.

        Attachments

          Activity

            People

            • Assignee:
              michael.birnstiehl Mike Birnstiehl
              Reporter:
              sebastien.lesaint Sebastien Lesaint
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: