MySQL: Fix test so it expects the right integer type

Change-Id: Idd90d7881c6458fac7602bf02dad0f794d3b98c9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
This commit is contained in:
Andy Shaw 2015-03-13 15:00:51 +01:00
parent 392d861790
commit b6c14bca65

View File

@ -3829,7 +3829,7 @@ void tst_QSqlQuery::aggregateFunctionTypes()
QVariant::Type intType = QVariant::Int;
// QPSQL uses LongLong for manipulation of integers
const QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db);
if (dbType == QSqlDriver::MySqlServer || dbType == QSqlDriver::PostgreSQL)
if (dbType == QSqlDriver::PostgreSQL)
intType = QVariant::LongLong;
else if (dbType == QSqlDriver::Oracle)
intType = QVariant::Double;
@ -3875,7 +3875,7 @@ void tst_QSqlQuery::aggregateFunctionTypes()
QVERIFY_SQL(q, exec("SELECT COUNT(id) FROM " + tableName));
QVERIFY(q.next());
QCOMPARE(q.value(0).toInt(), 2);
QCOMPARE(q.record().field(0).type(), intType);
QCOMPARE(q.record().field(0).type(), dbType != QSqlDriver::MySqlServer ? intType : QVariant::LongLong);
QVERIFY_SQL(q, exec("SELECT MIN(id) FROM " + tableName));
QVERIFY(q.next());
@ -3918,7 +3918,7 @@ void tst_QSqlQuery::aggregateFunctionTypes()
QVERIFY_SQL(q, exec("SELECT COUNT(id) FROM " + tableName));
QVERIFY(q.next());
QCOMPARE(q.value(0).toInt(), 2);
QCOMPARE(q.record().field(0).type(), intType);
QCOMPARE(q.record().field(0).type(), dbType != QSqlDriver::MySqlServer ? intType : QVariant::LongLong);
QVERIFY_SQL(q, exec("SELECT MIN(id) FROM " + tableName));
QVERIFY(q.next());