summaryrefslogtreecommitdiffstats
path: root/tests/auto/qsqldatabase
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-07-09 11:03:54 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-07-09 11:03:54 (GMT)
commit8bc84e2180e1d5819b372f4cd8c236b853145803 (patch)
tree6c5e6a8b6a1750e2484fd34f48be662fcf51959f /tests/auto/qsqldatabase
parentd641198fa71fadd243e84dfdf02b9a0536a27b3f (diff)
parent3b1e30bb1d6651a626aba1f6b8883f5524598ed3 (diff)
downloadQt-8bc84e2180e1d5819b372f4cd8c236b853145803.zip
Qt-8bc84e2180e1d5819b372f4cd8c236b853145803.tar.gz
Qt-8bc84e2180e1d5819b372f4cd8c236b853145803.tar.bz2
Merge commit 'origin/master' into 4.6-merged
Conflicts: src/corelib/kernel/qcoreevent.cpp src/corelib/tools/qdumper.cpp src/gui/kernel/qwidget.cpp src/gui/kernel/qwidget_p.h src/gui/kernel/qwidget_s60.cpp src/gui/text/qfontdatabase.cpp src/network/access/qnetworkreplyimpl.cpp src/sql/drivers/ibase/qsql_ibase.cpp src/testlib/qtestcase.cpp src/testlib/testlib.pro tests/auto/network-settings.h tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp tests/auto/qobjectrace/tst_qobjectrace.cpp tests/auto/qsqldatabase/tst_qsqldatabase.cpp tools/configure/configureapp.cpp translations/qt_ru.ts
Diffstat (limited to 'tests/auto/qsqldatabase')
-rw-r--r--tests/auto/qsqldatabase/tst_qsqldatabase.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
index f697488..31a699c 100644
--- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
@@ -188,7 +188,7 @@ private slots:
void oci_fieldLength_data() { generic_data("QOCI"); }
void oci_fieldLength();
- void sqlite_bindAndFetchUInt_data() { generic_data("QSQLITE3"); }
+ void sqlite_bindAndFetchUInt_data() { generic_data("QSQLITE"); }
void sqlite_bindAndFetchUInt();
void sqlStatementUseIsNull_189093_data() { generic_data(); }
@@ -298,6 +298,7 @@ void tst_QSqlDatabase::createTestTables(QSqlDatabase db)
q.exec("set table_type=innodb");
if (tst_Databases::isSqlServer(db)) {
QVERIFY_SQL(q, exec("SET ANSI_DEFAULTS ON"));
+ QVERIFY_SQL(q, exec("SET IMPLICIT_TRANSACTIONS OFF"));
}
// please never ever change this table; otherwise fix all tests ;)
@@ -1240,7 +1241,7 @@ void tst_QSqlDatabase::recordSQLServer()
FieldDef("varchar(20)", QVariant::String, QString("Blah1")),
FieldDef("bigint", QVariant::LongLong, 12345),
FieldDef("int", QVariant::Int, 123456),
- FieldDef("tinyint", QVariant::Int, 255),
+ FieldDef("tinyint", QVariant::UInt, 255),
#ifdef QT3_SUPPORT
FieldDef("image", QVariant::ByteArray, Q3CString("Blah1")),
#endif
@@ -1355,11 +1356,13 @@ void tst_QSqlDatabase::bigIntField()
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
+ QString drvName = db.driverName();
QSqlQuery q(db);
q.setForwardOnly(true);
+ if (drvName.startsWith("QOCI"))
+ q.setNumericalPrecisionPolicy(QSql::LowPrecisionInt64);
- QString drvName = db.driverName();
if (drvName.startsWith("QMYSQL")) {
QVERIFY_SQL(q, exec("create table " + qTableName("qtest_bigint") + " (id int, t_s64bit bigint, t_u64bit bigint unsigned)"));
} else if (drvName.startsWith("QPSQL")
@@ -1368,6 +1371,8 @@ void tst_QSqlDatabase::bigIntField()
QVERIFY_SQL(q, exec("create table " + qTableName("qtest_bigint") + "(id int, t_s64bit bigint, t_u64bit bigint)"));
} else if (drvName.startsWith("QOCI")) {
QVERIFY_SQL(q, exec("create table " + qTableName("qtest_bigint") + " (id int, t_s64bit int, t_u64bit int)"));
+ //} else if (drvName.startsWith("QIBASE")) {
+ // QVERIFY_SQL(q, exec("create table " + qTableName("qtest_bigint") + " (id int, t_s64bit int64, t_u64bit int64)"));
} else {
QSKIP("no 64 bit integer support", SkipAll);
}
@@ -1397,10 +1402,15 @@ void tst_QSqlDatabase::bigIntField()
}
QVERIFY(q.exec("select * from " + qTableName("qtest_bigint") + " order by id"));
QVERIFY(q.next());
+ QCOMPARE(q.value(1).toDouble(), (double)ll);
QCOMPARE(q.value(1).toLongLong(), ll);
+ if(drvName.startsWith("QOCI"))
+ QEXPECT_FAIL("", "Oracle driver lacks support for unsigned int64 types", Continue);
QCOMPARE(q.value(2).toULongLong(), ull);
QVERIFY(q.next());
QCOMPARE(q.value(1).toLongLong(), -ll);
+ if(drvName.startsWith("QOCI"))
+ QEXPECT_FAIL("", "Oracle driver lacks support for unsigned int64 types", Continue);
QCOMPARE(q.value(2).toULongLong(), ull);
}
@@ -1512,6 +1522,7 @@ void tst_QSqlDatabase::psql_escapedIdentifiers()
QString field1Name = QString("fIeLdNaMe");
QString field2Name = QString("ZuLu");
+ q.exec(QString("DROP SCHEMA \"%1\" CASCADE").arg(schemaName));
QString createSchema = QString("CREATE SCHEMA \"%1\"").arg(schemaName);
QVERIFY_SQL(q, exec(createSchema));
QString createTable = QString("CREATE TABLE \"%1\".\"%2\" (\"%3\" int PRIMARY KEY, \"%4\" varchar(20))").arg(schemaName).arg(tableName).arg(field1Name).arg(field2Name);
@@ -2270,6 +2281,10 @@ void tst_QSqlDatabase::sqlite_bindAndFetchUInt()
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
+ if (db.driverName().startsWith("QSQLITE2")) {
+ QSKIP("SQLite3 specific test", SkipSingle);
+ return;
+ }
QSqlQuery q(db);
QString tableName = qTableName("uint_test");