diff options
-rw-r--r-- | tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp | 8 | ||||
-rw-r--r-- | tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp index 89978319a0..4130b364f4 100644 --- a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp @@ -890,10 +890,10 @@ void tst_QSqlDatabase::recordMySQL() static QDateTime dt(QDate::currentDate(), QTime(1, 2, 3, 0)); static const FieldDef fieldDefs[] = { - FieldDef("tinyint", QVariant::Int, 127), - FieldDef("tinyint unsigned", QVariant::UInt, 255), - FieldDef("smallint", QVariant::Int, 32767), - FieldDef("smallint unsigned", QVariant::UInt, 65535), + FieldDef("tinyint", static_cast<QVariant::Type>(QMetaType::Char), 127), + FieldDef("tinyint unsigned", static_cast<QVariant::Type>(QMetaType::UChar), 255), + FieldDef("smallint", static_cast<QVariant::Type>(QMetaType::Short), 32767), + FieldDef("smallint unsigned", static_cast<QVariant::Type>(QMetaType::UShort), 65535), FieldDef("mediumint", QVariant::Int, 8388607), FieldDef("mediumint unsigned", QVariant::UInt, 16777215), FieldDef("integer", QVariant::Int, 2147483647), diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp index c4a27a3175..6843ff7d4a 100644 --- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp @@ -3035,11 +3035,7 @@ void tst_QSqlQuery::nextResult() QCOMPARE( q.record().field( 0 ).type(), QVariant::String ); QCOMPARE( q.record().field( 1 ).name().toUpper(), QString( "NUM" ) ); - - if (dbType == QSqlDriver::MySqlServer) - QCOMPARE( q.record().field( 1 ).type(), QVariant::String ); - else - QCOMPARE( q.record().field( 1 ).type(), QVariant::Double ); + QCOMPARE(q.record().field(1).type(), QVariant::Double); QVERIFY( q.next() ); // Move to first row of the second result set @@ -3289,6 +3285,10 @@ void tst_QSqlQuery::timeStampParsing() QVERIFY_SQL(q, exec(QStringLiteral("CREATE TABLE ") + tableName + QStringLiteral("(" "id serial NOT NULL, " "datefield timestamp, primary key(id));"))); + } else if (dbType == QSqlDriver::MySqlServer) { + QVERIFY_SQL(q, exec(QStringLiteral("CREATE TABLE ") + tableName + QStringLiteral("(" + "id integer NOT NULL AUTO_INCREMENT," + "datefield timestamp, primary key(id));"))); } else { QVERIFY_SQL(q, exec(QStringLiteral("CREATE TABLE ") + tableName + QStringLiteral("(" "\"id\" integer NOT NULL PRIMARY KEY AUTOINCREMENT," |