summaryrefslogtreecommitdiffstats
path: root/tests/auto/sql/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/sql/kernel')
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
index 23c8460133..38da5431fa 100644
--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
@@ -2347,6 +2347,16 @@ void tst_QSqlQuery::prepare_bind_exec()
QCOMPARE(q.value(0).toInt(), 107);
QCOMPARE(q.value(1).toString(), QString("name"));
QCOMPARE(q.value(2).toString(), QString("107"));
+
+ // Test just duplicated placeholders
+ QVERIFY(q.prepare("insert into " + qtest_prepare + " (id, name, name2) values (110, :name, :name)"));
+ q.bindValue(":name", "name");
+ QVERIFY_SQL(q, exec());
+ QVERIFY(q.exec("select * from " + qtest_prepare + " where id > 109 order by id"));
+ QVERIFY(q.next());
+ QCOMPARE(q.value(0).toInt(), 110);
+ QCOMPARE(q.value(1).toString(), QString("name"));
+ QCOMPARE(q.value(2).toString(), QString("name"));
} // end of SQLite scope
}