summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2022-09-27 19:06:17 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-28 18:40:38 +0000
commit91374bb6322cf09525e99698c8fae7688c227d74 (patch)
tree163a0a7f83841d6f91d44365ae8899052f8bab12 /src/plugins/sqldrivers/odbc/qsql_odbc.cpp
parenta0dfa8c4d29a005009d04dcb52452efb9d74e26e (diff)
QODBC: correctly fill cache when index() is called
QODBCResult::isNull() incorrectly checked for the validity of the internal row cache which lead to wrong results when the requested column was not yet cached. Pick-to: 6.4 6.2 5.15 Change-Id: Ic7dcc2117e6f05b63c83f21c6a84ba7e0bda2b2d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins/sqldrivers/odbc/qsql_odbc.cpp')
-rw-r--r--src/plugins/sqldrivers/odbc/qsql_odbc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
index bfcff3ad47..49ceaf9c69 100644
--- a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
+++ b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
@@ -1274,7 +1274,7 @@ bool QODBCResult::isNull(int field)
Q_D(const QODBCResult);
if (field < 0 || field >= d->fieldCache.size())
return true;
- if (field <= d->fieldCacheIdx) {
+ if (field >= d->fieldCacheIdx) {
// since there is no good way to find out whether the value is NULL
// without fetching the field we'll fetch it here.
// (data() also sets the NULL flag)