summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2022-09-27 19:06:17 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-01-31 16:15:02 +0000
commitd91f5e08da0e56db450129041acb4a5cdc2abae9 (patch)
tree14d656688638ea9b043e9c5cef5641677f8d3cce
parentb47e0cef86b320c7499ea34751c8c562fb14ba88 (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. Change-Id: Ic7dcc2117e6f05b63c83f21c6a84ba7e0bda2b2d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 91374bb6322cf09525e99698c8fae7688c227d74) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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 a15baea671..2cddefd6e7 100644
--- a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
+++ b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
@@ -1318,7 +1318,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)