Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-7269

Historic Task Report Tenant check uses unknown column prefix

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: L3 - Default
    • Resolution: Fixed
    • Affects Version/s: 7.6.0, 7.6.1
    • Fix Version/s: 7.7.0, 7.6.5, 7.7.0-alpha2
    • Component/s: engine
    • Labels:

      Description

      If the tenant check is enabled the following code snipped will fail in an authorization test:

      public void test() {
          createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_HISTORY);
          createGrantAuthorization(TASK, ANY, userId, READ_HISTORY);
      
          historyService.createHistoricTaskInstanceReport().duration(PeriodUnit.QUARTER);
      }
      
      ### The error may exist in org/camunda/bpm/engine/impl/mapping/entity/HistoricTaskInstanceReport.xml
      ### The error may involve org.camunda.bpm.engine.impl.persistence.entity.TaskReportResultEntity.selectHistoricTaskInstanceDurationReport
      ### The error occurred while executing a query
      ### SQL: SELECT       MIN(RES.DURATION_) AS MIN_, MAX(RES.DURATION_) AS MAX_, AVG(RES.DURATION_) AS AVG_, RES.PERIOD_, 'QUARTER' AS PERIOD_UNIT_     FROM       (         SELECT                  QUARTER     (HTI.END_TIME_) AS PERIOD_, HTI.DURATION_                 FROM       ACT_HI_TASKINST HTI      WHERE END_TIME_ IS NOT NULL                                               and (HPI.TENANT_ID_ is null              )            ) RES     GROUP BY       PERIOD_
      ### Cause: org.h2.jdbc.JdbcSQLException: Column "HPI.TENANT_ID_" not found; SQL statement:
      CREATE FORCE VIEW PUBLIC._41 AS
      SELECT
          QUARTER(HTI.END_TIME_) AS PERIOD_,
          HTI.DURATION_
      FROM PUBLIC.ACT_HI_TASKINST HTI
      WHERE (END_TIME_ IS NOT NULL)
          AND (HPI.TENANT_ID_ IS NULL) [42122-168]
      

      The problem is that the tenant check uses HPI.TENANT_ID_ whereas HPI is never bound in this query.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            roman.smirnov Smirnov Roman
            Reporter:
            sebastian.menski Sebastian Menski
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development