From c4ba2b1c70218f76366575ee7e6d90eb99efbb08 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 30 Nov 2017 17:16:06 +0100 Subject: Copy the numericalPrecisionPolicy when copying the QSqlDatabase As the numercialPrecisionPolicy can be set and subsequently retrieved from the QSqlDatabase's driver, then when copying the QSqlDatabase, we need to set that appropriately too. Task-number: QTBUG-10452 Change-Id: I2c63748365ab4e9fbc29d8d460d80d2e2a0ee385 Reviewed-by: Edward Welbourne --- src/sql/kernel/qsqldatabase.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp index 14374c7ca9..b129499fe6 100644 --- a/src/sql/kernel/qsqldatabase.cpp +++ b/src/sql/kernel/qsqldatabase.cpp @@ -135,6 +135,8 @@ QSqlDatabasePrivate::QSqlDatabasePrivate(const QSqlDatabasePrivate &other) : ref connOptions = other.connOptions; driver = other.driver; precisionPolicy = other.precisionPolicy; + if (driver) + driver->setNumericalPrecisionPolicy(other.driver->numericalPrecisionPolicy()); } QSqlDatabasePrivate::~QSqlDatabasePrivate() @@ -253,6 +255,8 @@ void QSqlDatabasePrivate::copy(const QSqlDatabasePrivate *other) port = other->port; connOptions = other->connOptions; precisionPolicy = other->precisionPolicy; + if (driver) + driver->setNumericalPrecisionPolicy(other->driver->numericalPrecisionPolicy()); } void QSqlDatabasePrivate::disable() -- cgit v1.2.3