-
Bug Report
-
Resolution: Fixed
-
L3 - Default
-
7.14.0
-
None
Environment:
- Camunda spring boot 7.16.0 camunda version with Rest API enabled
Description:
When we try try to access endpoint: GET /history/detail with query parameters: userOperationId, variableUpdates , there is syntax error in a DB query.
Steps to reproduce:
- Start Camunda Platfrom 7.16.0 or higher.
- If the Invoice Example is used, access the endpoint: http://localhost:8080/engine-rest/history/detail?userOperationId=<USER_OPERATION_ID>&variableUpdates=true
Observed behavior:
The following exception can be seen in the logs:
Rest endpoint is: engine-rest/history/detail?userOperationId=*******************************&variableUpdates=true Exception when we call history/details rest end point is: h3. SQL: select * from ( select a.{_}, ROWNUM rnum from ( select distinct RES.{_} from ACT_HI_DETAIL RES left join ( SELECT A.* FROM ACT_RU_AUTHORIZATION A WHERE A.TYPE_ < 2 AND ( A.USER_ID_ in ( ?, '{_}') OR A.GROUP_ID_ IN ( ? ) ) AND ( ( A.RESOURCE_TYPE_ = ? AND BITAND(A.PERMS_,?) = ? ) ) ) AUTH ON (AUTH.RESOURCE_ID_ in ( RES.PROC_DEF_KEY_, '{_}' )) WHERE *RES.TYPE_ = ? RES.OPERATION_ID_ = ?* and ( (RES.EXECUTION_ID_ is not null AND AUTH.RESOURCE_ID_ IS NOT NULL ) or RES.EXECUTION_ID_ is null ) order by RES.ID_ asc ) a where ROWNUM < ?) where rnum >= ? *### Cause: java.sql.SQLSyntaxErrorException: ORA-00907: missing right parenthesis*
Expected behavior:
No exception is thrown.
Root cause:
After investigation, we found that there is AND keyword missing at the highlighted point in above query. Also after checking HistoricDetail.xml at org/camunda/bpm/engine/impl/mapping/entity/HistoricDetail.xml, we could see same issue: