summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2012-02-03 22:47:18 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-02-07 21:21:12 (GMT)
commit68241a1d889b94156a63159fb7cdcffc10b9d397 (patch)
tree1086e1beeef66ce7db27c81c313a144efcccd4de /src
parent593947ba70188df3d33efe031fab2fd255faa8b9 (diff)
downloadQt-68241a1d889b94156a63159fb7cdcffc10b9d397.zip
Qt-68241a1d889b94156a63159fb7cdcffc10b9d397.tar.gz
Qt-68241a1d889b94156a63159fb7cdcffc10b9d397.tar.bz2
Ensure that QSqlDatabase::database() is still thread-safe
QSqlDatabase::database() is documented to be thread-safe and when the driver is queried for the numericalPrecisionPolicy set then it can comprimise the thread-safety. Since the driver itself (if one is set) will be queried for the numericalPrecisionPolicy when numericalPrecisionPolicy() is called on the QSqlDatabase then we can have it fallback to the default instead rather than taking the driver's own setting. Task-number: QTBUG-13423 Change-Id: Ie6a8ed76236a3bb3b8bfdb61ef156699b05a93ab Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/sql/kernel/qsqldatabase.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp
index 161e93e8..9b23d10 100644
--- a/src/sql/kernel/qsqldatabase.cpp
+++ b/src/sql/kernel/qsqldatabase.cpp
@@ -138,10 +138,7 @@ public:
port(-1)
{
ref = 1;
- if(driver)
- precisionPolicy = driver->numericalPrecisionPolicy();
- else
- precisionPolicy= QSql::LowPrecisionDouble;
+ precisionPolicy= QSql::LowPrecisionDouble;
}
QSqlDatabasePrivate(const QSqlDatabasePrivate &other);
~QSqlDatabasePrivate();