-
Bug Report
-
Resolution: Fixed
-
L3 - Default
-
7.6.0, 7.6.1
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.