diff options
author | Andy Shaw <andy.shaw@qt.io> | 2018-02-22 13:45:34 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2018-03-17 23:14:34 +0000 |
commit | 9b68dc19bf3973d3a46439c4b8667ad3beba167d (patch) | |
tree | e908f4ae759d26a4b117ca578da6f76ef8fb762e /tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp | |
parent | 44137dc65ab1121fc360f6f006b7515648f0bae3 (diff) |
MySQL: Fix tests
This fixes the following:
- tst_QSqlDatabase::recordMySQL() to account for performance
improvements done for small integral types
- tst_QSqlQuery::nextResult() so that NUMERIC results are seen
as doubles
- tst_QSqlQuery::timeStampParsing() so that MySQL accepts the
CREATE TABLE statement
Change-Id: I68fb1d06dac12d500bb4596463f5bdd65cc9c226
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp')
-rw-r--r-- | tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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," |