diff options
author | Bill King <bill.king@nokia.com> | 2009-06-18 03:57:51 (GMT) |
---|---|---|
committer | Bill King <bill.king@nokia.com> | 2009-06-21 23:04:53 (GMT) |
commit | a290f3b64a4a77018845612eef15baa98fc0833a (patch) | |
tree | 9ab806dd7e0c3cf2a2264759a633aa68e1370d30 /src/sql/kernel | |
parent | cb8cfe965d9e5716e4ffc14b90c1fefaab53d126 (diff) | |
download | Qt-a290f3b64a4a77018845612eef15baa98fc0833a.zip Qt-a290f3b64a4a77018845612eef15baa98fc0833a.tar.gz Qt-a290f3b64a4a77018845612eef15baa98fc0833a.tar.bz2 |
Stage 2 of incorporating database level precision policy.
All autotests pass now for all databases except DB2 (untested).
Diffstat (limited to 'src/sql/kernel')
-rw-r--r-- | src/sql/kernel/qsqlcachedresult.cpp | 13 | ||||
-rw-r--r-- | src/sql/kernel/qsqlcachedresult_p.h | 1 | ||||
-rw-r--r-- | src/sql/kernel/qsqlresult.cpp | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/src/sql/kernel/qsqlcachedresult.cpp b/src/sql/kernel/qsqlcachedresult.cpp index 3cace06..ca51dc0 100644 --- a/src/sql/kernel/qsqlcachedresult.cpp +++ b/src/sql/kernel/qsqlcachedresult.cpp @@ -294,4 +294,17 @@ QSqlCachedResult::ValueCache &QSqlCachedResult::cache() return d->cache; } +void QSqlCachedResult::virtual_hook(int id, void *data) +{ + switch (id) { + case QSqlResult::DetachFromResultSet: + case QSqlResult::SetNumericalPrecision: + cleanup(); + break; + default: + QSqlResult::virtual_hook(id, data); + } +} + + QT_END_NAMESPACE diff --git a/src/sql/kernel/qsqlcachedresult_p.h b/src/sql/kernel/qsqlcachedresult_p.h index d19435c..a384b2e 100644 --- a/src/sql/kernel/qsqlcachedresult_p.h +++ b/src/sql/kernel/qsqlcachedresult_p.h @@ -89,6 +89,7 @@ protected: int colCount() const; ValueCache &cache(); + void virtual_hook(int id, void *data); private: bool cacheNext(); QSqlCachedResultPrivate *d; diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp index 1c1595d..93c9d9f 100644 --- a/src/sql/kernel/qsqlresult.cpp +++ b/src/sql/kernel/qsqlresult.cpp @@ -905,7 +905,6 @@ QVariant QSqlResult::lastInsertId() const */ void QSqlResult::virtual_hook(int, void *) { - Q_ASSERT(false); } /*! \internal @@ -971,6 +970,7 @@ void QSqlResult::detachFromResultSet() void QSqlResult::setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy policy) { d->precisionPolicy = policy; + virtual_hook(SetNumericalPrecision, &policy); } /*! \internal |