X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fsqlitestorage.cpp;h=5f0ac2e279ce6d7f898259d7c85ca6a796c1409f;hb=08bace4e9ecf08273f094c0c6aa8b3363d38ac3e;hp=46e2c70e981b580bb798660c6a5fad4852a1792d;hpb=d0e9b7a1d5e73041ade519189eea012500440ba9;p=quassel.git diff --git a/src/core/sqlitestorage.cpp b/src/core/sqlitestorage.cpp index 46e2c70e..5f0ac2e2 100644 --- a/src/core/sqlitestorage.cpp +++ b/src/core/sqlitestorage.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -193,7 +193,7 @@ UserId SqliteStorage::validateUser(const QString &user, const QString &password) { UserId userId; QString hashedPassword; - Storage::HashVersion hashVersion; + Storage::HashVersion hashVersion = Storage::HashVersion::Latest; { QSqlQuery query(logDb()); @@ -968,7 +968,7 @@ void SqliteStorage::setChannelPersistent(UserId user, const NetworkId &networkId QSqlQuery query(db); query.prepare(queryString("update_buffer_persistent_channel")); query.bindValue(":userid", user.toInt()); - query.bindValue(":networkId", networkId.toInt()); + query.bindValue(":networkid", networkId.toInt()); query.bindValue(":buffercname", channel.toLower()); query.bindValue(":joined", isJoined ? 1 : 0); @@ -990,7 +990,7 @@ void SqliteStorage::setPersistentChannelKey(UserId user, const NetworkId &networ QSqlQuery query(db); query.prepare(queryString("update_buffer_set_channel_key")); query.bindValue(":userid", user.toInt()); - query.bindValue(":networkId", networkId.toInt()); + query.bindValue(":networkid", networkId.toInt()); query.bindValue(":buffercname", channel.toLower()); query.bindValue(":key", key); @@ -1720,12 +1720,15 @@ bool SqliteStorage::safeExec(QSqlQuery &query, int retryCount) switch (query.lastError().number()) { case 5: // SQLITE_BUSY 5 /* The database file is locked */ + [[clang::fallthrough]]; case 6: // SQLITE_LOCKED 6 /* A table in the database is locked */ if (retryCount < _maxRetryCount) return safeExec(query, retryCount + 1); + break; default: - return false; + ; } + return false; } @@ -1808,6 +1811,7 @@ bool SqliteMigrationReader::readMo(QuasselUserMO &user) user.id = value(0).toInt(); user.username = value(1).toString(); user.password = value(2).toString(); + user.hashversion = value(3).toInt(); return true; }