projects
/
profile
/
ivi
/
qtbase.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bdd3521
)
Fix QSqlQuery::value to use proper index check
author
Thiago A. Correa
<thiago.correa@gmail.com>
Thu, 4 Oct 2012 16:11:23 +0000
(13:11 -0300)
committer
The Qt Project
<gerrit-noreply@qt-project.org>
Fri, 5 Oct 2012 01:16:37 +0000
(
03:16
+0200)
Change the validation of index parameter to use -1 constant
instead of QSql::BeforeFirstRow which is unrelated to field index
Change-Id: I43b42bc7ce717bcd9ddc987d2e716f1672c00775
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
src/sql/kernel/qsqlquery.cpp
patch
|
blob
|
history
diff --git
a/src/sql/kernel/qsqlquery.cpp
b/src/sql/kernel/qsqlquery.cpp
index
8cba762
..
eff211c
100644
(file)
--- a/
src/sql/kernel/qsqlquery.cpp
+++ b/
src/sql/kernel/qsqlquery.cpp
@@
-399,7
+399,7
@@
bool QSqlQuery::exec(const QString& query)
QVariant QSqlQuery::value(int index) const
{
- if (isActive() && isValid() && (index >
QSql::BeforeFirstRow
))
+ if (isActive() && isValid() && (index >
-1
))
return d->sqlResult->data(index);
qWarning("QSqlQuery::value: not positioned on a valid record");
return QVariant();