diff options
author | Axel Spoerl <axel.spoerl@qt.io> | 2023-07-05 08:51:49 +0200 |
---|---|---|
committer | Axel Spoerl <axel.spoerl@qt.io> | 2023-07-05 20:40:30 +0200 |
commit | 634ef449bffad3e97a7141ca6c2df0795407b9fc (patch) | |
tree | 274d69e8b79d1aa304d5278b10796c3e4d9ba3f0 /src/plugins/sqldrivers | |
parent | 9de8e7532b52a0a98bfb319d045ee03874dc09c8 (diff) |
QIbaseResult: null parameter follow up fix
a7deddba519fc1f6fd637496e92ca5daccf6d453 implemented a warning for
disallowed null parameters. A check, was missing, if the argument is
actually null.
This patch adds the missing check.
Fixes: QTBUG-114683
Pick-to: 6.6 6.5
Change-Id: Iecbd636599a28284a0a9afe2987e48552f3658ff
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Diffstat (limited to 'src/plugins/sqldrivers')
-rw-r--r-- | src/plugins/sqldrivers/ibase/qsql_ibase.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp index 6e86640d31..0e5b515c77 100644 --- a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp +++ b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp @@ -1052,8 +1052,11 @@ bool QIBaseResult::exec() // a value of 0 means non-null. *(d->inda->sqlvar[para].sqlind) = 0; } else { - qWarning() << "QIBaseResult::exec: Null value replaced by zero for"_L1 - << d->inda->sqlvar[para].ownname; + if (QSqlResultPrivate::isVariantNull(val)) { + qWarning() << "QIBaseResult::exec: Null value replaced by default (zero)"_L1 + << "value for type of column"_L1 << d->inda->sqlvar[para].ownname + << ", which is not nullable."_L1; + } } switch(d->inda->sqlvar[para].sqltype & ~1) { case SQL_INT64: |