diff options
author | Bill King <bill.king@nokia.com> | 2009-07-13 13:28:52 +1000 |
---|---|---|
committer | Bill King <bill.king@nokia.com> | 2009-07-13 13:28:52 +1000 |
commit | de07df9001586cc18ae267591359541b7ea494a0 (patch) | |
tree | e8d162f492b214ad6aff69b252a1dc301e8907bf /src | |
parent | 3f9a894acb30ff3fb5907f82327af088f96a088d (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')
-rw-r--r-- | src/sql/models/qsqltablemodel.cpp | 2 |
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)); } |