summaryrefslogtreecommitdiffstats
path: root/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
diff options
context:
space:
mode:
authorIikka Eklund <iikka.eklund@digia.com>2014-04-01 11:44:26 +0300
committerIikka Eklund <iikka.eklund@digia.com>2014-04-01 11:44:27 +0300
commit0ab63b035a649dc1982c867cd37d466d249004b9 (patch)
tree6de22edcd3957aae3eee698136a000e52ab7f8fe /tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
parenta6f8aa0ae1d5a1d1099df1891ea60b14b6eb6065 (diff)
parent0cb2c760c219514849ab0f6be8e5368f92dfa5d9 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Diffstat (limited to 'tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp')
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
index 5f1eb99524..a497fac79a 100644
--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
@@ -1069,6 +1069,18 @@ void tst_QSqlQuery::numRowsAffected()
QCOMPARE( q.numRowsAffected(), i );
QCOMPARE( q.numRowsAffected(), i ); // yes, we check twice
+ QVERIFY_SQL( q, prepare( "update " + qtest + " set id = id + :newid" ) );
+ q.bindValue(":newid", 100);
+ QVERIFY_SQL( q, exec() );
+ QCOMPARE( q.numRowsAffected(), i );
+ QCOMPARE( q.numRowsAffected(), i ); // yes, we check twice
+
+ QVERIFY_SQL( q, prepare( "update " + qtest + " set id = id + :newid where NOT(1 = 1)" ) );
+ q.bindValue(":newid", 100);
+ QVERIFY_SQL( q, exec() );
+ QCOMPARE( q.numRowsAffected(), 0 );
+ QCOMPARE( q.numRowsAffected(), 0 ); // yes, we check twice
+
QVERIFY_SQL( q, exec( "insert into " + qtest + " values (42000, 'homer', 'marge')" ) );
QCOMPARE( q.numRowsAffected(), 1 );
QCOMPARE( q.numRowsAffected(), 1 ); // yes, we check twice