From 983b3c4a62c4541bbc0bab5d96c43f55efa52100 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 28 Jun 2016 09:35:02 +0200 Subject: [PATCH] Fix SQL request for MSSQL and Postgres --- .../org/sonar/db/component/ComponentMapper.xml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sonar-db/src/main/resources/org/sonar/db/component/ComponentMapper.xml b/sonar-db/src/main/resources/org/sonar/db/component/ComponentMapper.xml index 49646233f04..31b71fecbab 100644 --- a/sonar-db/src/main/resources/org/sonar/db/component/ComponentMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/component/ComponentMapper.xml @@ -322,10 +322,9 @@ select from projects base - inner join projects p + inner join projects p on p.project_uuid = base.project_uuid where base.uuid = #{query.baseUuid} - and p.project_uuid = base.project_uuid and base.uuid_path like #{baseUuidPathLike} and p.uuid != base.uuid and p.enabled = ${_true} @@ -347,12 +346,10 @@ from projects p - inner join projects base - inner join snapshots s + inner join projects base on base.project_uuid = p.project_uuid + inner join snapshots s on s.component_uuid = base.project_uuid where base.uuid = #{query.baseUuid} - and base.project_uuid = p.project_uuid - and s.component_uuid = base.project_uuid and p.enabled = ${_true} and s.islast = ${_true} and p.uuid_path = #{baseUuidPath} @@ -400,14 +397,12 @@ from projects p - inner join projects base - inner join snapshots s + inner join projects base on base.project_uuid=p.project_uuid + inner join snapshots s on s.component_uuid = base.project_uuid where base.uuid = #{query.baseUuid} - and base.project_uuid=p.project_uuid and p.enabled = ${_true} and p.uuid_path like #{baseUuidPathLike} ESCAPE '/' - and s.component_uuid = base.project_uuid and s.islast = ${_true} -- 2.39.5