summaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/db/abstractdb.cpp')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/db/abstractdb.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.cpp b/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.cpp
index 56275aa..4b3165b 100644
--- a/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.cpp
+++ b/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.cpp
@@ -305,7 +305,6 @@ SqlQueryPtr AbstractDb::execHashArg(const QString& query, const QHash<QString,QV
if (!isOpenInternal())
return SqlQueryPtr(new SqlErrorResults(SqlErrorCode::DB_NOT_OPEN, tr("Cannot execute query on closed database.")));
- logSql(this, query, args, flags);
QString newQuery = query;
SqlQueryPtr queryStmt = prepare(newQuery);
queryStmt->setArgs(args);
@@ -323,7 +322,6 @@ SqlQueryPtr AbstractDb::execListArg(const QString& query, const QList<QVariant>&
if (!isOpenInternal())
return SqlQueryPtr(new SqlErrorResults(SqlErrorCode::DB_NOT_OPEN, tr("Cannot execute query on closed database.")));
- logSql(this, query, args, flags);
QString newQuery = query;
SqlQueryPtr queryStmt = prepare(newQuery);
queryStmt->setArgs(args);
@@ -636,7 +634,13 @@ void AbstractDb::detachInternal(Db* otherDb)
return;
}
- exec(QString("DETACH %1;").arg(attachedDbMap.valueByRight(otherDb)), Flag::NO_LOCK);
+ QString dbName = attachedDbMap.valueByRight(otherDb);
+ SqlQueryPtr res = exec(QString("DETACH %1;").arg(dbName), Flag::NO_LOCK);
+ if (res->isError())
+ {
+ qCritical() << "Cannot detach" << dbName << " / " << otherDb->getName() << ":" << res->getErrorText();
+ return;
+ }
attachedDbMap.removeRight(otherDb);
emit detached(otherDb);
}