path: root/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp
diff options
authorAndy Shaw <>2017-05-19 15:31:46 +0200
committerAndy Shaw <>2017-07-12 09:01:50 +0000
commit0843c6ca7fe604d8c44b9a81b8fcb072ab424172 (patch)
treee6784759b9dd8729d5bd179a38552170e084a723 /src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp
parent9423be1f190bd7cdeb04add39f4ec621a33a3041 (diff)
QSqlField: Add a means to see what the tablename is for a given field
When you are using a query that pulls from a number of different tables then it can be ambiguous as to which table a particular field belongs to. So this will make it possible to determine the table that a given field belongs to if it is set. Task-number: QTBUG-7170 Change-Id: I49b7890c0523d81272a153df3860df800ff853d5 Reviewed-by: Jesus Fernandez <> Reviewed-by: Edward Welbourne <>
Diffstat (limited to 'src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp b/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp
index 67c24e4168..93f47e3f13 100644
--- a/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp
+++ b/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp
@@ -576,7 +576,7 @@ QSqlIndex QSQLite2Driver::primaryIndex(const QString &tblname) const
QVariant::Type type = QVariant::Invalid;
if (rec.contains(name))
type = rec.field(name).type();
- index.append(QSqlField(name, type));
+ index.append(QSqlField(name, type, tblname));
return index;