Add debug for 'PRAGMA cipher_migrate'

GitOrigin-RevId: 69c9a979ccf27f77d106e6ce7712c6e4a939722c
This commit is contained in:
Arseny Smirnov 2020-08-13 19:21:15 +03:00
parent d4f0162ee9
commit cecea2ba08

View File

@ -189,7 +189,10 @@ Result<SqliteDb> SqliteDb::do_open_with_key(CSlice path, const DbKey &db_key, bo
auto key = db_key_to_sqlcipher_key(db_key);
TRY_STATUS(db.exec(PSLICE() << "PRAGMA key = " << key));
if (with_cipher_migrate) {
LOG(INFO) << "Start 'PRAGMA cipher_migrate' for " << path;
PerfWarningTimer timer("PRAGMA cipher_migrate", 0.5);
TRY_RESULT(code, db.get_pragma_string("cipher_migrate"));
LOG(INFO) << "Finish 'PRAGMA cipher_migrate' for " << path;
if (code != "0") {
return Status::Error(PSLICE() << "'PRAGMA cipher_migrate' failed - " << code);
}