if (!AccountGetStmt)
{
- if (sqlite3_prepare_v2(AutocryptDB,
+ if (sqlite3_prepare_v3(AutocryptDB,
"SELECT "
"email_addr, "
"keyid, "
"enabled "
"FROM account "
"WHERE email_addr = ?",
- -1, &AccountGetStmt, NULL) != SQLITE_OK)
+ -1, SQLITE_PREPARE_PERSISTENT, &AccountGetStmt, NULL) != SQLITE_OK)
goto cleanup;
}
if (!AccountInsertStmt)
{
- if (sqlite3_prepare_v2(AutocryptDB,
+ if (sqlite3_prepare_v3(AutocryptDB,
"INSERT INTO account "
"(email_addr, "
"keyid, "
"prefer_encrypt, "
"enabled) "
"VALUES (?, ?, ?, ?, ?);",
- -1, &AccountInsertStmt, NULL) != SQLITE_OK)
+ -1, SQLITE_PREPARE_PERSISTENT, &AccountInsertStmt, NULL) != SQLITE_OK)
goto cleanup;
}
if (!PeerGetStmt)
{
- if (sqlite3_prepare_v2(AutocryptDB,
+ if (sqlite3_prepare_v3(AutocryptDB,
"SELECT "
"email_addr, "
"last_seen, "
"gossip_keydata "
"FROM peer "
"WHERE email_addr = ?",
- -1, &PeerGetStmt, NULL) != SQLITE_OK)
+ -1, SQLITE_PREPARE_PERSISTENT, &PeerGetStmt, NULL) != SQLITE_OK)
goto cleanup;
}
if (!PeerInsertStmt)
{
- if (sqlite3_prepare_v2(AutocryptDB,
+ if (sqlite3_prepare_v3(AutocryptDB,
"INSERT INTO peer "
"(email_addr, "
"last_seen, "
"gossip_keyid, "
"gossip_keydata) "
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);",
- -1, &PeerInsertStmt, NULL) != SQLITE_OK)
+ -1, SQLITE_PREPARE_PERSISTENT, &PeerInsertStmt, NULL) != SQLITE_OK)
goto cleanup;
}
if (!PeerUpdateStmt)
{
- if (sqlite3_prepare_v2(AutocryptDB,
+ if (sqlite3_prepare_v3(AutocryptDB,
"UPDATE peer SET "
"last_seen = ?, "
"autocrypt_timestamp = ?, "
"gossip_keyid = ?, "
"gossip_keydata = ? "
"WHERE email_addr = ?;",
- -1, &PeerUpdateStmt, NULL) != SQLITE_OK)
+ -1, SQLITE_PREPARE_PERSISTENT, &PeerUpdateStmt, NULL) != SQLITE_OK)
goto cleanup;
}
if (!PeerHistoryInsertStmt)
{
- if (sqlite3_prepare_v2(AutocryptDB,
+ if (sqlite3_prepare_v3(AutocryptDB,
"INSERT INTO peer_history "
"(peer_email_addr, "
"email_msgid, "
"timestamp, "
"keydata) "
"VALUES (?, ?, ?, ?);",
- -1, &PeerHistoryInsertStmt, NULL) != SQLITE_OK)
+ -1, SQLITE_PREPARE_PERSISTENT,
+ &PeerHistoryInsertStmt, NULL) != SQLITE_OK)
goto cleanup;
}