summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-07-13 13:28:52 +1000
committerBill King <bill.king@nokia.com>2009-07-13 13:28:52 +1000
commitde07df9001586cc18ae267591359541b7ea494a0 (patch)
treee8d162f492b214ad6aff69b252a1dc301e8907bf /src/sql
parent3f9a894acb30ff3fb5907f82327af088f96a088d (diff)
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')
-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 591b506948..18d89b4ee4 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));
}