summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel/qsqldatabase.cpp
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2017-11-30 17:16:06 +0100
committerAndy Shaw <andy.shaw@qt.io>2017-12-01 10:52:44 +0000
commitc4ba2b1c70218f76366575ee7e6d90eb99efbb08 (patch)
tree0314859f575d4e76847dd21748fe68418b3ec179 /src/sql/kernel/qsqldatabase.cpp
parent33b03d99cdaff3e8292b31bc166d97b8f5775640 (diff)
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 <edward.welbourne@qt.io>
Diffstat (limited to 'src/sql/kernel/qsqldatabase.cpp')
-rw-r--r--src/sql/kernel/qsqldatabase.cpp4
1 files changed, 4 insertions, 0 deletions
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()