From 0843c6ca7fe604d8c44b9a81b8fcb072ab424172 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 19 May 2017 15:31:46 +0200 Subject: 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 --- src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp') diff --git a/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp b/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp index 67c24e41680..93f47e3f13e 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; } -- cgit v1.2.3