g10: Don't use the same variable for multiple SQL compiled statements
authorNeal H. Walfield <neal@g10code.com>
Mon, 21 Nov 2016 20:13:15 +0000 (21:13 +0100)
committerNeal H. Walfield <neal@g10code.com>
Mon, 21 Nov 2016 20:13:15 +0000 (21:13 +0100)
* g10/tofu.c (struct tofu_dbs_s): Remove unused field
record_binding_update2.  Replace register_insert with
register_signature and register_encryption.
(tofu_register_signature): Don't use dbs->s.register_insert, but
dbs->s.register_signature.
(tofu_register_encryption): Don't use dbs->s.register_insert, but
dbs->s.register_encryption.

Signed-off-by: Neal H. Walfield <neal@g10code.com>
g10/tofu.c

index 05d171d..deccc0f 100644 (file)
@@ -79,14 +79,14 @@ struct tofu_dbs_s
 
     sqlite3_stmt *record_binding_get_old_policy;
     sqlite3_stmt *record_binding_update;
-    sqlite3_stmt *record_binding_update2;
     sqlite3_stmt *get_policy_select_policy_and_conflict;
     sqlite3_stmt *get_trust_bindings_with_this_email;
     sqlite3_stmt *get_trust_gather_other_user_ids;
     sqlite3_stmt *get_trust_gather_signature_stats;
     sqlite3_stmt *get_trust_gather_encryption_stats;
     sqlite3_stmt *register_already_seen;
-    sqlite3_stmt *register_insert;
+    sqlite3_stmt *register_signature;
+    sqlite3_stmt *register_encryption;
   } s;
 
   int in_batch_transaction;
@@ -3093,7 +3093,7 @@ tofu_register_signature (ctrl_t ctrl,
           log_assert (c == 0);
 
           rc = gpgsql_stepx
-            (dbs->db, &dbs->s.register_insert, NULL, NULL, &err,
+            (dbs->db, &dbs->s.register_signature, NULL, NULL, &err,
              "insert into signatures\n"
              " (binding, sig_digest, origin, sig_time, time)\n"
              " values\n"
@@ -3209,7 +3209,7 @@ tofu_register_encryption (ctrl_t ctrl,
         }
 
       rc = gpgsql_stepx
-        (dbs->db, &dbs->s.register_insert, NULL, NULL, &err,
+        (dbs->db, &dbs->s.register_encryption, NULL, NULL, &err,
          "insert into encryptions\n"
          " (binding, time)\n"
          " values\n"