diff options
author | Bill King <bking@trolltech.com> | 2009-10-13 01:57:05 (GMT) |
---|---|---|
committer | Bill King <bking@trolltech.com> | 2009-10-13 03:21:47 (GMT) |
commit | bee70a74465ef837b446ef2d2309a002da5bfe30 (patch) | |
tree | 00d7e1a34b92422c8f6e47161427b93f83e0f1c2 /tests/auto/qsqlrelationaltablemodel | |
parent | f613b0170d0fe806378779472315d0bbdc1aada9 (diff) | |
download | Qt-bee70a74465ef837b446ef2d2309a002da5bfe30.zip Qt-bee70a74465ef837b446ef2d2309a002da5bfe30.tar.gz Qt-bee70a74465ef837b446ef2d2309a002da5bfe30.tar.bz2 |
Fixes issue with multiple lookups to same table/field
Previously the renaming scheme created a new table_field alias name.
If multiple references referred to the same table/field lookup, then
multiples of the same alias would be generated in the query, leading
the query to fail.
Reviewed-by: Justin McPherson
Diffstat (limited to 'tests/auto/qsqlrelationaltablemodel')
-rw-r--r-- | tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp b/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp index 05d546e..cb24a9f 100644 --- a/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp +++ b/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp @@ -837,10 +837,10 @@ void tst_QSqlRelationalTableModel::insertRecordDuplicateFieldNames() QVERIFY_SQL(model, select()); if (db.driverName().startsWith("QIBASE") || db.driverName().startsWith("QOCI") || db.driverName().startsWith("QDB2")) { - QCOMPARE(model.record(1).value(qTableName("reltest4").append(QLatin1String("_name")).toUpper()).toString(), + QCOMPARE(model.record(1).value(qTableName("reltest4").append(QLatin1String("_name_2")).toUpper()).toString(), QString("Trondheim")); } else { - QCOMPARE(model.record(1).value(qTableName("reltest4").append(QLatin1String("_name"))).toString(), + QCOMPARE(model.record(1).value(qTableName("reltest4").append(QLatin1String("_name_2"))).toString(), QString("Trondheim")); } @@ -859,9 +859,9 @@ void tst_QSqlRelationalTableModel::insertRecordDuplicateFieldNames() // The duplicate field names is aliased because it's comes from the relation's display column. if(db.driverName().startsWith("QIBASE") || db.driverName().startsWith("QOCI") || db.driverName().startsWith("QDB2")) - QCOMPARE(rec.fieldName(2), (qTableName("reltest4").append(QLatin1String("_name"))).toUpper()); + QCOMPARE(rec.fieldName(2), (qTableName("reltest4").append(QLatin1String("_name_2"))).toUpper()); else - QCOMPARE(rec.fieldName(2), qTableName("reltest4").append(QLatin1String("_name"))); + QCOMPARE(rec.fieldName(2), qTableName("reltest4").append(QLatin1String("_name_2"))); QVERIFY(model.insertRecord(-1, rec)); QCOMPARE(model.data(model.index(2, 2)).toString(), QString("Oslo")); |