From 383925652f51ddefa3f048010833813eca00edd9 Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Mon, 23 Jan 2017 17:21:58 +0100 Subject: [PATCH] Don't use base table name where the actual table name is appropriate In the SQL export don't use the base table name of a table when you should actually use the table name itself. The way SQLite reports its data these just happen to be the same for tables. This doesn't change anything when it comes to functionality but is semantically more correct. --- src/sqlitedb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sqlitedb.cpp b/src/sqlitedb.cpp index 09249784e..2ecfbcd3e 100644 --- a/src/sqlitedb.cpp +++ b/src/sqlitedb.cpp @@ -491,7 +491,7 @@ bool DBBrowserDB::dump(const QString& filename, // Loop through all tables first as they are required to generate views, indices etc. later for(auto it=tables.constBegin();it!=tables.constEnd();++it) { - if (tablesToDump.indexOf(it->getTableName()) == -1) + if (tablesToDump.indexOf(it->getname()) == -1) continue; // Write the SQL string used to create this table to the output file @@ -505,7 +505,7 @@ bool DBBrowserDB::dump(const QString& filename, // get columns QStringList cols(it->object.dynamicCast()->fieldNames()); - QString sQuery = QString("SELECT * FROM %1;").arg(sqlb::escapeIdentifier(it->getTableName())); + QString sQuery = QString("SELECT * FROM %1;").arg(sqlb::escapeIdentifier(it->getname())); QByteArray utf8Query = sQuery.toUtf8(); sqlite3_stmt *stmt; QString lineSep(QString(")%1\n").arg(insertNewSyntx?',':';'));