From 1db9962cef140971d18110bb76486c40db373b8f Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Thu, 18 Feb 2016 14:38:39 +0100 Subject: QSqlDriver::sqlStatement: documentation fix Change-Id: I12bd612c48020594b5377b04aeccc51f7c4be53d Reviewed-by: Andy Shaw Reviewed-by: Vyacheslav Grigoryev --- src/sql/kernel/qsqldriver.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/sql/kernel') diff --git a/src/sql/kernel/qsqldriver.cpp b/src/sql/kernel/qsqldriver.cpp index 9ee8d67f56..adaeb8c846 100644 --- a/src/sql/kernel/qsqldriver.cpp +++ b/src/sql/kernel/qsqldriver.cpp @@ -457,6 +457,17 @@ QString QSqlDriver::stripDelimiters(const QString &identifier, IdentifierType ty This method can be used to manipulate tables without having to worry about database-dependent SQL dialects. For non-prepared statements, the values will be properly escaped. + + In the WHERE statement, each non-null field of \a rec specifies a + filter condition of equality to the field value, or if prepared, a + placeholder. However, prepared or not, a null field specifies the + condition IS NULL and never introduces a placeholder. The + application must not attempt to bind data for the null field during + execution. The field must be set to some non-null value if a + placeholder is desired. Furthermore, since non-null fields specify + equality conditions and SQL NULL is not equal to anything, even + itself, it is generally not useful to bind a null to a placeholder. + */ QString QSqlDriver::sqlStatement(StatementType type, const QString &tableName, const QSqlRecord &rec, bool preparedStatement) const -- cgit v1.2.3