summaryrefslogtreecommitdiffstats
path: root/src/sql/models
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-07-13 03:28:52 (GMT)
committerBill King <bill.king@nokia.com>2009-07-13 03:28:52 (GMT)
commitde07df9001586cc18ae267591359541b7ea494a0 (patch)
treee8d162f492b214ad6aff69b252a1dc301e8907bf /src/sql/models
parent3f9a894acb30ff3fb5907f82327af088f96a088d (diff)
downloadQt-de07df9001586cc18ae267591359541b7ea494a0.zip
Qt-de07df9001586cc18ae267591359541b7ea494a0.tar.gz
Qt-de07df9001586cc18ae267591359541b7ea494a0.tar.bz2
Fixes failure when table has null fields to update
Fixes an issue where too many parameters are bound when updating QSqlTableModel where the stored record has NULLs in it. Reviewed-by: Justin McPherson
Diffstat (limited to 'src/sql/models')
-rw-r--r--src/sql/models/qsqltablemodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp
index 591b506..18d89b4 100644
--- a/src/sql/models/qsqltablemodel.cpp
+++ b/src/sql/models/qsqltablemodel.cpp
@@ -202,7 +202,7 @@ bool QSqlTableModelPrivate::exec(const QString &stmt, bool prepStatement,
editQuery.addBindValue(rec.value(i));
}
for (i = 0; i < whereValues.count(); ++i) {
- if (whereValues.isGenerated(i))
+ if (whereValues.isGenerated(i) && !whereValues.isNull(i))
editQuery.addBindValue(whereValues.value(i));
}