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

use of database name from JDBC url should be case insensitive

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 7.4
    • Fix Version/s: None
    • Component/s: Database
    • Labels:
      None
    • 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).

      Old behavior should be restored if possible. Otherwise, documentation should be updated accordingly and we must ensure this behavior is consistently enforced on all supported SGDBs.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sebastien.lesaint Sebastien Lesaint
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: