From 016003905ca0e8e459e3dc33e786beda8ec92f45 Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Fri, 30 Jan 2015 17:00:07 -0500 Subject: Imported Upstream version 3.0.2 --- SQLiteStudio3/coreSQLiteStudio/db/abstractdb.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'SQLiteStudio3/coreSQLiteStudio/db/abstractdb.cpp') 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 QHashsetArgs(args); @@ -323,7 +322,6 @@ SqlQueryPtr AbstractDb::execListArg(const QString& query, const QList& 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); } -- cgit v1.2.3