summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2011-11-10 06:56:57 (GMT)
committerQt Commercial Integration <QtCommercial@digia.com>2012-01-31 10:25:09 (GMT)
commit17332a87f61171ed1bfda16f4adf535956471520 (patch)
treeeceb5fb1066aaf974ba46462a5eaa2ee0a8bab47
parent1852ed71d850769bcbb14f01c086a64964f27f0b (diff)
downloadQt-17332a87f61171ed1bfda16f4adf535956471520.zip
Qt-17332a87f61171ed1bfda16f4adf535956471520.tar.gz
Qt-17332a87f61171ed1bfda16f4adf535956471520.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
-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 db5124c..4bf3558 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();