]> source.dussan.org Git - sonarqube.git/commitdiff
Always select queue rows in the same order 659/head
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 30 Nov 2015 08:42:06 +0000 (09:42 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 30 Nov 2015 08:42:06 +0000 (09:42 +0100)
sonar-db/src/main/resources/org/sonar/db/ce/CeQueueMapper.xml

index 42b26d303c96e43eedb540cf6130eb3e2d35e89a..f43a9e9b30c23dc00b3cc91342151c41355345d1 100644 (file)
     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"/>
     <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">