[tor-commits] [metrics-web/master] Change a query in the database importer.

karsten at torproject.org karsten at torproject.org
Thu Jan 12 15:36:05 UTC 2012


commit 580931f412cd3284053f62b88df60f668f42ad26
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Thu Jan 12 16:34:27 2012 +0100

    Change a query in the database importer.
---
 .../cron/RelayDescriptorDatabaseImporter.java      |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/org/torproject/ernie/cron/RelayDescriptorDatabaseImporter.java b/src/org/torproject/ernie/cron/RelayDescriptorDatabaseImporter.java
index 4a9f97c..deefc10 100644
--- a/src/org/torproject/ernie/cron/RelayDescriptorDatabaseImporter.java
+++ b/src/org/torproject/ernie/cron/RelayDescriptorDatabaseImporter.java
@@ -244,7 +244,8 @@ public final class RelayDescriptorDatabaseImporter {
         this.psSs = conn.prepareStatement("SELECT COUNT(*) "
             + "FROM statusentry WHERE validafter = ?");
         this.psRs = conn.prepareStatement("SELECT COUNT(*) "
-            + "FROM statusentry WHERE validafter = ? AND descriptor = ?");
+            + "FROM statusentry WHERE validafter = ? AND "
+            + "fingerprint = ?");
         this.psDs = conn.prepareStatement("SELECT COUNT(*) "
             + "FROM descriptor WHERE descriptor = ?");
         this.psEs = conn.prepareStatement("SELECT COUNT(*) "
@@ -362,7 +363,7 @@ public final class RelayDescriptorDatabaseImporter {
         if (separateStatusEntryCheckNecessary ||
             insertedStatusEntries.contains(fingerprint)) {
           this.psRs.setTimestamp(1, validAfterTimestamp, cal);
-          this.psRs.setString(2, descriptor);
+          this.psRs.setString(2, fingerprint);
           ResultSet rs = psRs.executeQuery();
           rs.next();
           if (rs.getInt(1) > 0) {



More information about the tor-commits mailing list