aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-11-30 09:42:06 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-11-30 09:42:06 +0100
commit1b0505a3bc6aa012a3af41e5faafe2fc2cfe265a (patch)
tree7bceeb2a035b1c0cd3ef48402d1155d8cfad0111 /sonar-db
parentbac57da65f5a8ab30cf44d9bfaf9c92df75f3538 (diff)
downloadsonarqube-1b0505a3bc6aa012a3af41e5faafe2fc2cfe265a.tar.gz
sonarqube-1b0505a3bc6aa012a3af41e5faafe2fc2cfe265a.zip
Always select queue rows in the same order
Diffstat (limited to 'sonar-db')
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/ce/CeQueueMapper.xml10
1 files changed, 7 insertions, 3 deletions
diff --git a/sonar-db/src/main/resources/org/sonar/db/ce/CeQueueMapper.xml b/sonar-db/src/main/resources/org/sonar/db/ce/CeQueueMapper.xml
index 42b26d303c9..f43a9e9b30c 100644
--- a/sonar-db/src/main/resources/org/sonar/db/ce/CeQueueMapper.xml
+++ b/sonar-db/src/main/resources/org/sonar/db/ce/CeQueueMapper.xml
@@ -14,6 +14,10 @@
cq.updated_at as updatedAt
</sql>
+ <sql id="orderByDateAndId">
+ order by cq.created_at asc, cq.id asc
+ </sql>
+
<select id="selectByUuid" parameterType="String" resultType="org.sonar.db.ce.CeQueueDto">
select
<include refid="columns"/>
@@ -34,14 +38,14 @@
<include refid="columns"/>
from ce_queue cq
where cq.component_uuid=#{componentUuid}
- order by cq.id asc
+ <include refid="orderByDateAndId"/>
</select>
<select id="selectAllInAscOrder" resultType="org.sonar.db.ce.CeQueueDto">
select
<include refid="columns"/>
from ce_queue cq
- order by cq.id asc
+ <include refid="orderByDateAndId"/>
</select>
<select id="selectEligibleForPeek" resultType="String">
@@ -53,7 +57,7 @@
from ce_queue cq2
where cq.component_uuid=cq2.component_uuid and cq2.status &lt;&gt; 'PENDING'
)
- order by cq.created_at asc, cq.id asc
+ <include refid="orderByDateAndId"/>
</select>
<insert id="insert" parameterType="org.sonar.db.ce.CeQueueDto" useGeneratedKeys="false">