aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core/src/main/resources
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-06-19 11:36:10 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-06-19 11:36:19 +0200
commit9bdc6b392d81a344d660a16fbbced7df97291e2a (patch)
tree5eb3a6ce045f34a9668257734942c7f1332f483d /sonar-core/src/main/resources
parentbe13d66e40f985a7e4a6843c136b15ae7b378259 (diff)
downloadsonarqube-9bdc6b392d81a344d660a16fbbced7df97291e2a.tar.gz
sonarqube-9bdc6b392d81a344d660a16fbbced7df97291e2a.zip
SONAR-4394 shared issue filters name must be unique
Diffstat (limited to 'sonar-core/src/main/resources')
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/issue/db/IssueFilterMapper.xml17
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/issue/db/IssueMapper.xml2
2 files changed, 16 insertions, 3 deletions
diff --git a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueFilterMapper.xml b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueFilterMapper.xml
index a31b00273c5..a85abad3bbe 100644
--- a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueFilterMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueFilterMapper.xml
@@ -52,12 +52,25 @@
</where>
</select>
- <select id="selectSharedForUser" parameterType="String" resultType="IssueFilter">
+ <select id="selectSharedWithoutUserFilters" parameterType="String" resultType="IssueFilter">
select <include refid="issueFilterColumns"/>
from issue_filters filters
<where>
filters.shared=${_true}
- and filters.user_login&lt;&gt;#{user}
+ and filters.user_login&lt;&gt;#{userLogin}
+ </where>
+ </select>
+
+ <select id="selectSharedWithoutUserFiltersByName" parameterType="String" resultType="IssueFilter">
+ select <include refid="issueFilterColumns"/>
+ from issue_filters filters
+ <where>
+ filters.shared=${_true}
+ and filters.user_login&lt;&gt;#{userLogin}
+ and filters.name=#{name}
+ <if test="existingId != null">
+ and filters.id&lt;&gt;#{existingId}
+ </if>
</where>
</select>
diff --git a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueMapper.xml b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueMapper.xml
index 06fa350595e..a6b5c76457f 100644
--- a/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/issue/db/IssueMapper.xml
@@ -217,7 +217,7 @@
<!-- Oracle -->
<select id="selectIssues" parameterType="map" resultType="Issue" fetchSize="100000" databaseId="oracle">
- select * from (select i.id
+ select id from (select i.id
<include refid="sortColumn"/>
<include refid="selectQueryConditions"/>
) where rownum &lt;= #{maxResults}