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

Actions on the quality gate page fail on MsSQL

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 7.9
    • Fix Version/s: 7.9.1
    • Component/s: Database, Quality Gate, Web API
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      Description

      On 7.9 when using MsSQL, it's no more possible to select a quality gate and to create a new one.

      Technical details

      Failure stacktrace is the following:

      org.apache.ibatis.exceptions.PersistenceException: 
          ### Error querying database.  Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'key'.
          ### The error may exist in org.sonar.db.qualitygate.ProjectQgateAssociationMapper
          ### The error may involve org.sonar.db.qualitygate.ProjectQgateAssociationMapper.selectProjects-Inline
          ### The error occurred while setting parameters
          ### SQL: SELECT proj.id as id, proj.kee as key, proj.name as name, prop.text_value as gateId     FROM projects proj     LEFT JOIN properties prop ON prop.resource_id=proj.id AND prop.prop_key='sonar.qualitygate' AND prop.text_value = ?     where     proj.qualifier = 'TRK'     and proj.enabled = 1     and proj.main_branch_project_uuid is null     and proj.copy_component_uuid is null     and proj.organization_uuid=?               and prop.text_value IS NOT NULL                   order by proj.name
          ### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'key'.
              at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
              at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:149)
              at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
              at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:147)
              at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:80)
              at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
              at com.sun.proxy.$Proxy56.selectProjects(Unknown Source)
              at org.sonar.db.qualitygate.ProjectQgateAssociationDao.selectProjects(ProjectQgateAssociationDao.java:30)
              at org.sonar.db.qualitygate.ProjectQgateAssociationDaoTest.select_projects_by_query(ProjectQgateAssociationDaoTest.java:76)        Caused by:
              com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'key'.
                  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.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:592)
                  at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:522)
                  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.SQLServerPreparedStatement.execute(SQLServerPreparedStatement.java:503)
                  at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:94)
                  at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:94)
                  at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
                  at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
                  at org.apache.ibatis.executor.ReuseExecutor.doQuery(ReuseExecutor.java:60)
                  at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
                  at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
                  at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
                  at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
                  at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
                  ... 7 more 

        Attachments

          Activity

            People

            • Assignee:
              sebastien.lesaint Sebastien Lesaint
              Reporter:
              sebastien.lesaint Sebastien Lesaint
            • Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: