diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-10-23 15:04:42 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-10-27 10:56:13 +0100 |
commit | da72e5538ebcc7e6008d0c4b3538d2a994f02a7e (patch) | |
tree | d7bfce43631d37cac486442f51ddfc6a1dc9c329 /src/sql/kernel | |
parent | 23cced453030492c72dea0968e4195eae18d6653 (diff) |
Retrieve auto-value for ODBC fields.
Introduce a static function returning the value called from
qMakeFieldInfo(SQLHANDLE). The field is currently only populated
when executing a query. Populating it from QODBCDriver::record()
would require executing a dummy query, which is problematic since
QSqlField does not have any provisions for delayed evaluation.
Document the limitation.
Task-number: QTBUG-39388
Change-Id: Ib2d2f2653b8b757389f627142c61c13a117fef72
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/sql/kernel')
-rw-r--r-- | src/sql/kernel/qsqlfield.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sql/kernel/qsqlfield.cpp b/src/sql/kernel/qsqlfield.cpp index dfd4712071..2022871432 100644 --- a/src/sql/kernel/qsqlfield.cpp +++ b/src/sql/kernel/qsqlfield.cpp @@ -531,6 +531,12 @@ QDebug operator<<(QDebug dbg, const QSqlField &f) Returns \c true if the value is auto-generated by the database, for example auto-increment primary key values. + \note When using the ODBC driver, due to limitations in the ODBC API, + the \c isAutoValue() field is only populated in a QSqlField resulting from a + QSqlRecord obtained by executing a \c SELECT query. It is \c false in a QSqlField + resulting from a QSqlRecord returned from QSqlDatabase::record() or + QSqlDatabase::primaryIndex(). + \sa setAutoValue() */ bool QSqlField::isAutoValue() const |