aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/db/abstractdb.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2015-01-30 17:00:24 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2015-01-30 17:00:24 -0500
commite4767514ed04e6a0bddf3f4a47f5f0b09e65e0ee (patch)
tree86cadc2137831d44fa29fd40a2964f7fb1326de4 /SQLiteStudio3/coreSQLiteStudio/db/abstractdb.cpp
parent26ddfe11c2b7fac52e5f57dcd9f5223a50b2a9a7 (diff)
parent016003905ca0e8e459e3dc33e786beda8ec92f45 (diff)
Merge tag 'upstream/3.0.2'
Upstream version 3.0.2 # gpg: Signature made Fri 30 Jan 2015 05:00:11 PM EST using RSA key ID EBE9BD91 # gpg: Good signature from "Unit 193 <unit193@gmail.com>" # gpg: aka "Unit 193 <unit193@ninthfloor.org>" # gpg: aka "Unit 193 <unit193@ubuntu.com>"
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);
}