Another unreviewed build fix after r174475.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Oct 2014 02:50:04 +0000 (02:50 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Oct 2014 02:50:04 +0000 (02:50 +0000)
Don't try to insert a duplicated row into build_commits as it results in a database constraint error.

This has been caught by a test in /api/report. I don't know why I thought all tests were passing.

* public/include/report-processor.php:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174494 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/include/report-processor.php

index 0d28e78..fe6b755 100644 (file)
@@ -1,5 +1,15 @@
 2014-10-08  Ryosuke Niwa  <rniwa@webkit.org>
 
+        Another unreviewed build fix after r174477.
+
+        Don't try to insert a duplicated row into build_commits as it results in a database constraint error.
+
+        This has been caught by a test in /api/report. I don't know why I thought all tests were passing.
+
+        * public/include/report-processor.php:
+
+2014-10-08  Ryosuke Niwa  <rniwa@webkit.org>
+
         Unreviewed build fix after r174477.
 
         * init-database.sql: Removed build_commits_index since it's redundant with build_commit's primary key.
index 162b3a5..233cda2 100644 (file)
@@ -113,8 +113,8 @@ class ReportProcessor {
             if (abs($commit_row['commit_time'] - $commit_data['time']) > 1.0)
                 $this->exit_with_error('MismatchingCommitTime', array('existing' => $commit_row, 'new' => $commit_data));
 
-            if (!$this->db->insert_row('build_commits', null,
-                array('commit_build' => $build_id, 'build_commit' => $commit_row['commit_id']), null))
+            if (!$this->db->select_or_insert_row('build_commits', null,
+                array('commit_build' => $build_id, 'build_commit' => $commit_row['commit_id']), null, '*'))
                 $this->exit_with_error('FailedToRelateCommitToBuild', array('commit' => $commit_row, 'build' => $build_id));
         }