[Xsquash4Jira] Synchro KO when a requirement's path is over 255 characters in Squash TM
This request is KO when the complete path to the requirement in Squash TM is over 300 characters: with recursive PATHCTE(ID, PATH, POSITION) as (select RLN_RESOURCE.RLN_ID, cast(RESOURCE.NAME as char), REQUIREMENT_LIBRARY_CONTENT.CONTENT_ORDER from PROJECT join REQUIREMENT_LIBRARY_CONTENT on PROJECT.RL_ID = REQUIREMENT_LIBRARY_CONTENT.LIBRARY_ID join RLN_RESOURCE on REQUIREMENT_LIBRARY_CONTENT.CONTENT_ID = RLN_RESOURCE.RLN_ID join RESOURCE on RLN_RESOURCE.RES_ID = RESOURCE.RES_ID where PROJECT.NAME = ? union select RLN_RELATIONSHIP.DESCENDANT_ID, cast(CONCAT(CONCAT(cast(PATHCTE.PATH as char), ?), RESOURCE.NAME) as char), RLN_RELATIONSHIP.CONTENT_ORDER from PATHCTE join RLN_RELATIONSHIP on PATHCTE.ID = RLN_RELATIONSHIP.ANCESTOR_ID join RLN_RESOURCE on RLN_RELATIONSHIP.DESCENDANT_ID = RLN_RESOURCE.RLN_ID join RESOURCE on RLN_RESOURCE.RES_ID = RESOURCE.RES_ID where ? like CONCAT(cast(PATHCTE.PATH as char), ?, RESOURCE.NAME, ?) ) select PATHCTE.ID, PATHCTE.PATH, PATHCTE.POSITION from PATHCTE order by PATHCTE.POSITION;
The problem comes from the cast in the first select of the recursive part: the max length for the string will be the size of the column RESOURCE.NAME in MariaDB. I would cast to varchar(10000)in the first and the second select of the recursive part.