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:
parent
392d861790
commit
b6c14bca65
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user