Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.6.0, 5.15.2
-
None
-
-
14f9f00fdb2dc428610c08e3d9d03e38e9602166 (qt/qtbase/dev), 7ba2cb99a (dev), f0bc9c6f4 (6.5)
Description
When I copy prepared QSqlQuery with assign or copy constructor and bind to them different values with bindValue they both will have the same bound value, one which was bound last.
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE", "test"); db.setDatabaseName(":memory:"); db.open(); QSqlQuery createQuery(db); createQuery.exec("CREATE TABLE if not exists test" "(test_id integer)"); QSqlQuery query1(db); query1.prepare("INSERT INTO test (test_id) VALUES(:test_id)"); query1.bindValue(":test_id", 1); //this returns 1 qDebug() << query1.boundValue(":test_id"); QSqlQuery query2(query1); //QSqlQuery query2 = query1; query2.bindValue(":test_id", 2); qDebug() << query1.boundValue(":test_id") << query2.boundValue(":test_id"); //both return 2
Attachments
Issue Links
- relates to
-
PYSIDE-2394 QSqlQueryModel.setQuery( QSqlQuery() ) Produces Deprecation Warning
- Closed