]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/email/EmailProvider.java
upd: cleanup SQL statements to make them statically verifiable.
[gigi.git] / src / org / cacert / gigi / email / EmailProvider.java
index d82725d1783ebf5e971a7fc6a5e3aba23d845f3e..a55a1c205259cb0a592e8c57446bda6edec4fa07 100644 (file)
@@ -161,11 +161,10 @@ public abstract class EmailProvider {
                         continue;
                     }
 
                         continue;
                     }
 
-                    try (GigiPreparedStatement statmt = new GigiPreparedStatement("INSERT INTO `emailPinglog` SET `when`=NOW(), `email`=?, `result`=?, `uid`=?, `type`='fast', `status`=?::`pingState`")) {
+                    try (GigiPreparedStatement statmt = new GigiPreparedStatement("INSERT INTO `emailPinglog` SET `when`=NOW(), `email`=?, `result`=?, `uid`=?, `type`='fast', `status`='success'::`pingState`")) {
                         statmt.setString(1, address);
                         statmt.setString(2, line);
                         statmt.setInt(3, forUid);
                         statmt.setString(1, address);
                         statmt.setString(2, line);
                         statmt.setInt(3, forUid);
-                        statmt.setString(4, "success");
                         statmt.execute();
                     }
 
                         statmt.execute();
                     }
 
@@ -178,11 +177,10 @@ public abstract class EmailProvider {
 
             }
         }
 
             }
         }
-        try (GigiPreparedStatement statmt = new GigiPreparedStatement("INSERT INTO `emailPinglog` SET `when`=NOW(), `email`=?, `result`=?, `uid`=?, `type`='fast', `status`=?::`pingState`")) {
+        try (GigiPreparedStatement statmt = new GigiPreparedStatement("INSERT INTO `emailPinglog` SET `when`=NOW(), `email`=?, `result`=?, `uid`=?, `type`='fast'::`emailPingType`, `status`='failed'::`pingState`")) {
             statmt.setString(1, address);
             statmt.setString(2, "Failed to make a connection to the mail server");
             statmt.setInt(3, forUid);
             statmt.setString(1, address);
             statmt.setString(2, "Failed to make a connection to the mail server");
             statmt.setInt(3, forUid);
-            statmt.setString(4, "failed");
             statmt.execute();
         }
         return FAIL;
             statmt.execute();
         }
         return FAIL;