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.
This commit is contained in:
Martin Kleusberg
2017-01-23 17:21:58 +01:00
parent 9266d207cd
commit 383925652f

View File

@@ -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<sqlb::Table>()->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?',':';'));