aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db/src/main/resources/org/sonar/db
diff options
context:
space:
mode:
authorDaniel Schwarz <bartfastiel@users.noreply.github.com>2017-01-23 16:08:49 +0100
committerGitHub <noreply@github.com>2017-01-23 16:08:49 +0100
commit0832a517c9b7cb70d51ba6557094a605a8a9efdc (patch)
tree2fa021674a42d7e7a0291cced2301d52e69d8489 /sonar-db/src/main/resources/org/sonar/db
parent0584dc8d5d5d82a2035763c34afba0e12cf6e8d0 (diff)
downloadsonarqube-0832a517c9b7cb70d51ba6557094a605a8a9efdc.tar.gz
sonarqube-0832a517c9b7cb70d51ba6557094a605a8a9efdc.zip
SONAR-8238 when updating a project, clear ALL components from index
Diffstat (limited to 'sonar-db/src/main/resources/org/sonar/db')
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/component/ComponentMapper.xml13
1 files changed, 9 insertions, 4 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 a9d12f01871..92c23601b28 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
@@ -414,11 +414,16 @@
</if>
</sql>
- <select id="selectAll" parameterType="map" resultType="Component">
- select distinct
- <include refid="componentColumns"/>
+ <select id="selectForIndexing" parameterType="map" resultType="Component">
+ select
+ <include refid="componentColumns"/>
from projects p
- where p.enabled=${_true}
+ where
+ p.enabled=${_true}
+ and p.copy_component_uuid is null
+ <if test="projectUuid != null">
+ and p.project_uuid=#{projectUuid}
+ </if>
</select>
<insert id="insert" parameterType="Component" keyColumn="id" useGeneratedKeys="true" keyProperty="id">