summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-12-12 01:01:03 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-12-12 01:01:04 +0100
commit11d7788c18bf062c204782b3661e67b45e818819 (patch)
tree7e6df60892757c060ecf9d2698b893f8b93315e7 /src/plugins
parentb3c0e9afa0041d4d45e47880732deda1dd1013b9 (diff)
parent3162345670ffe67a71a62abaeda0d8eb8ad0682e (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/sqldrivers/README4
-rw-r--r--src/plugins/sqldrivers/psql/qsql_psql.cpp34
2 files changed, 11 insertions, 27 deletions
diff --git a/src/plugins/sqldrivers/README b/src/plugins/sqldrivers/README
index 7000fb5613..26418c5e36 100644
--- a/src/plugins/sqldrivers/README
+++ b/src/plugins/sqldrivers/README
@@ -1,5 +1,5 @@
-Please note that the DB2, Oracle and TDS client drivers are not distributed
-with the Qt Open Source Editions.
+Please note that the DB2, MySQL, Oracle and TDS client drivers are not
+distributed with the Qt Open Source Editions.
This is because the client libraries are distributed under a license which
is not compatible with the GPL license.
diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp
index 3d8ed29b54..d735d29fc7 100644
--- a/src/plugins/sqldrivers/psql/qsql_psql.cpp
+++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp
@@ -692,40 +692,24 @@ QVariant QPSQLResult::data(int i)
return dbl;
}
case QVariant::Date:
- if (val[0] == '\0') {
- return QVariant(QDate());
- } else {
#if QT_CONFIG(datestring)
- return QVariant(QDate::fromString(QString::fromLatin1(val), Qt::ISODate));
+ return QVariant(QDate::fromString(QString::fromLatin1(val), Qt::ISODate));
#else
- return QVariant(QString::fromLatin1(val));
+ return QVariant(QString::fromLatin1(val));
#endif
- }
- case QVariant::Time: {
- const QString str = QString::fromLatin1(val);
+ case QVariant::Time:
#if QT_CONFIG(datestring)
- if (str.isEmpty())
- return QVariant(QTime());
- else
- return QVariant(QTime::fromString(str, Qt::ISODate));
+ return QVariant(QTime::fromString(QString::fromLatin1(val), Qt::ISODate));
#else
- return QVariant(str);
+ return QVariant(QString::fromLatin1(val));
#endif
- }
- case QVariant::DateTime: {
- QString dtval = QString::fromLatin1(val);
+ case QVariant::DateTime:
#if QT_CONFIG(datestring)
- if (dtval.length() < 10) {
- return QVariant(QDateTime());
- } else {
- QChar sign = dtval[dtval.size() - 3];
- if (sign == QLatin1Char('-') || sign == QLatin1Char('+')) dtval += QLatin1String(":00");
- return QVariant(QDateTime::fromString(dtval, Qt::ISODate).toLocalTime());
- }
+ return QVariant(QDateTime::fromString(QString::fromLatin1(val),
+ Qt::ISODate).toLocalTime());
#else
- return QVariant(dtval);
+ return QVariant(QString::fromLatin1(val));
#endif
- }
case QVariant::ByteArray: {
size_t len;
unsigned char *data = PQunescapeBytea((const unsigned char*)val, &len);