diff options
author | Kevin McCarthy <kevin@8t8.us> | 2019-07-14 18:59:28 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2019-08-03 14:08:09 -0700 |
commit | f0946c86d813ba993d0e7463dfe259831e3e1069 (patch) | |
tree | 4441d55cc8b230ba7fc9c57917d01f3e9206f2e5 /autocrypt | |
parent | c7d4b01957745a333912ab415570858064843000 (diff) |
Convert to use sqllite3_prepare_v3().
The documentation suggests the SQLITE_PREPARE_PERSISTENT flag is
helpful for long-lived prepared statements, and Mutt is using.
Diffstat (limited to 'autocrypt')
-rw-r--r-- | autocrypt/autocrypt_db.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/autocrypt/autocrypt_db.c b/autocrypt/autocrypt_db.c index 604c1f34..d549d678 100644 --- a/autocrypt/autocrypt_db.c +++ b/autocrypt/autocrypt_db.c @@ -173,7 +173,7 @@ int mutt_autocrypt_db_account_get (ADDRESS *addr, AUTOCRYPT_ACCOUNT **account) if (!AccountGetStmt) { - if (sqlite3_prepare_v2 ( + if (sqlite3_prepare_v3 ( AutocryptDB, "SELECT " "email_addr, " @@ -184,6 +184,7 @@ int mutt_autocrypt_db_account_get (ADDRESS *addr, AUTOCRYPT_ACCOUNT **account) "FROM account " "WHERE email_addr = ?", -1, + SQLITE_PREPARE_PERSISTENT, &AccountGetStmt, NULL) != SQLITE_OK) goto cleanup; @@ -229,7 +230,7 @@ int mutt_autocrypt_db_account_insert (ADDRESS *addr, const char *keyid, if (!AccountInsertStmt) { - if (sqlite3_prepare_v2 ( + if (sqlite3_prepare_v3 ( AutocryptDB, "INSERT INTO account " "(email_addr, " @@ -239,6 +240,7 @@ int mutt_autocrypt_db_account_insert (ADDRESS *addr, const char *keyid, "enabled) " "VALUES (?, ?, ?, ?, ?);", -1, + SQLITE_PREPARE_PERSISTENT, &AccountInsertStmt, NULL) != SQLITE_OK) goto cleanup; @@ -309,7 +311,7 @@ int mutt_autocrypt_db_peer_get (ADDRESS *addr, AUTOCRYPT_PEER **peer) if (!PeerGetStmt) { - if (sqlite3_prepare_v2 ( + if (sqlite3_prepare_v3 ( AutocryptDB, "SELECT " "email_addr, " @@ -324,6 +326,7 @@ int mutt_autocrypt_db_peer_get (ADDRESS *addr, AUTOCRYPT_PEER **peer) "FROM peer " "WHERE email_addr = ?", -1, + SQLITE_PREPARE_PERSISTENT, &PeerGetStmt, NULL) != SQLITE_OK) goto cleanup; @@ -372,7 +375,7 @@ int mutt_autocrypt_db_peer_insert (ADDRESS *addr, AUTOCRYPT_PEER *peer) if (!PeerInsertStmt) { - if (sqlite3_prepare_v2 ( + if (sqlite3_prepare_v3 ( AutocryptDB, "INSERT INTO peer " "(email_addr, " @@ -386,6 +389,7 @@ int mutt_autocrypt_db_peer_insert (ADDRESS *addr, AUTOCRYPT_PEER *peer) "gossip_keydata) " "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);", -1, + SQLITE_PREPARE_PERSISTENT, &PeerInsertStmt, NULL) != SQLITE_OK) goto cleanup; @@ -458,7 +462,7 @@ int mutt_autocrypt_db_peer_update (ADDRESS *addr, AUTOCRYPT_PEER *peer) if (!PeerUpdateStmt) { - if (sqlite3_prepare_v2 ( + if (sqlite3_prepare_v3 ( AutocryptDB, "UPDATE peer SET " "last_seen = ?, " @@ -471,6 +475,7 @@ int mutt_autocrypt_db_peer_update (ADDRESS *addr, AUTOCRYPT_PEER *peer) "gossip_keydata = ? " "WHERE email_addr = ?;", -1, + SQLITE_PREPARE_PERSISTENT, &PeerUpdateStmt, NULL) != SQLITE_OK) goto cleanup; @@ -558,7 +563,7 @@ int mutt_autocrypt_db_peer_history_insert (ADDRESS *addr, AUTOCRYPT_PEER_HISTORY if (!PeerHistoryInsertStmt) { - if (sqlite3_prepare_v2 ( + if (sqlite3_prepare_v3 ( AutocryptDB, "INSERT INTO peer_history " "(peer_email_addr, " @@ -567,6 +572,7 @@ int mutt_autocrypt_db_peer_history_insert (ADDRESS *addr, AUTOCRYPT_PEER_HISTORY "keydata) " "VALUES (?, ?, ?, ?);", -1, + SQLITE_PREPARE_PERSISTENT, &PeerHistoryInsertStmt, NULL) != SQLITE_OK) goto cleanup; |