Commit a02165ab authored by Ronan's avatar Ronan
Browse files

fix(MainDb): do not execute query outside exception handler in get history range

parent 225b7a67
......@@ -1855,7 +1855,6 @@ static inline string blobToString (soci::blob &in) {
return events;
}
const long long &dbChatRoomId = d->selectChatRoomId(chatRoomId);
string query = "SELECT id, type, creation_time FROM event"
" WHERE id IN ("
" SELECT event_id FROM conference_event WHERE chat_room_id = :chatRoomId"
......@@ -1884,6 +1883,7 @@ static inline string blobToString (soci::blob &in) {
soci::session *session = d->dbSession.getBackendSession<soci::session>();
soci::transaction tr(*session);
const long long &dbChatRoomId = d->selectChatRoomId(chatRoomId);
soci::rowset<soci::row> rows = (session->prepare << query, soci::use(dbChatRoomId));
for (const auto &row : rows) {
long long eventId = d->resolveId(row, 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment