Support tables with empty table names

Apparently SQLite supports empty table names for whatever reason. This
commit patches SQLiteBrowser to support databases with a table with an
empty name. I haven't removed the check for an empty table name in the
Create/Edit table dialog though because you probably really shouldn't
create such a table.

See issue #194.
This commit is contained in:
Martin Kleusberg
2015-02-06 13:27:54 +01:00
parent 8d55fd5c48
commit 4fa0576853
5 changed files with 15 additions and 14 deletions

View File

@@ -39,7 +39,7 @@ void SqliteTableModel::setTable(const QString& table)
if(m_db->getObjectByName(table).gettype() == "table")
{
sqlb::Table t = sqlb::Table::parseSQL(m_db->getObjectByName(table).getsql()).first;
if(t.name() != "") // parsing was OK
if(t.fields().size()) // parsing was OK
{
m_headers.push_back(t.rowidColumn());
m_headers.append(m_db->getObjectByName(table).table.fieldNames());