diff options
author | Bill King <bill.king@nokia.com> | 2009-07-08 22:41:01 (GMT) |
---|---|---|
committer | Bill King <bill.king@nokia.com> | 2009-07-08 22:41:01 (GMT) |
commit | 7b980974b14d246f60d824bab4e069ac8cc2da29 (patch) | |
tree | 68f0d1667760a0e7e27d57fc76c0434dc028502c /tests/auto/q3sqlcursor | |
parent | cfacb284593008094136905a2497843a4bbac639 (diff) | |
parent | 48f049d6fbddd60d99fb6ebc15fd5b52a3b515ec (diff) | |
download | Qt-7b980974b14d246f60d824bab4e069ac8cc2da29.zip Qt-7b980974b14d246f60d824bab4e069ac8cc2da29.tar.gz Qt-7b980974b14d246f60d824bab4e069ac8cc2da29.tar.bz2 |
Merge commit 'origin/4.5'
Conflicts:
src/sql/drivers/ibase/qsql_ibase.cpp
tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp
tests/auto/qsqldatabase/tst_databases.h
tests/auto/qsqldatabase/tst_qsqldatabase.cpp
translations/qt_ru.ts
Diffstat (limited to 'tests/auto/q3sqlcursor')
-rw-r--r-- | tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp index fa786f1..0a2e46e 100644 --- a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp +++ b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp @@ -157,11 +157,9 @@ void tst_Q3SqlCursor::createTestTables( QSqlDatabase db ) } if (tst_Databases::isMSAccess(db)) { - QVERIFY_SQL(q, exec("create table " + qTableName("qtest_precision") + " (col1 number)")); - } else if (db.driverName().startsWith("QIBASE")) { - QVERIFY_SQL(q, exec("create table " + qTableName("qtest_precision") + " (col1 numeric(15, 14))")); + QVERIFY_SQL(q, exec("create table " + qTableName("qtest_precision") + " (col1 number)")); } else { - QVERIFY_SQL(q, exec("create table " + qTableName("qtest_precision") + " (col1 numeric(15, 14))")); + QVERIFY_SQL(q, exec("create table " + qTableName("qtest_precision") + " (col1 numeric(15, 14))")); } } @@ -557,7 +555,7 @@ void tst_Q3SqlCursor::unicode() void tst_Q3SqlCursor::precision() { - static const QString precStr = "1.23456789012345"; + static const QString precStr = QLatin1String("1.23456789012345"); static const double precDbl = 2.23456789012345; QFETCH( QString, dbName ); @@ -576,7 +574,10 @@ void tst_Q3SqlCursor::precision() QVERIFY_SQL(cur, select()); QVERIFY( cur.next() ); - QCOMPARE( cur.value( 0 ).asString(), QString( precStr ) ); + if(!tst_Databases::isSqlServer(db)) + QCOMPARE( cur.value( 0 ).asString(), precStr ); + else + QCOMPARE( cur.value( 0 ).asString(), precStr.left(precStr.size()-1) ); // Sql server fails at counting. QVERIFY( cur.next() ); QCOMPARE( cur.value( 0 ).asDouble(), precDbl ); } @@ -760,9 +761,10 @@ void tst_Q3SqlCursor::insertFieldNameContainsWS() { QSqlQuery q(db); tst_Databases::safeDropTable(db, tableName); - QString query = QString("CREATE TABLE %1 (id int, \"first Name\" varchar(20), " - "lastName varchar(20))").arg(tableName); - QVERIFY_SQL(q, exec(query)); + QString query = "CREATE TABLE %1 (id int, " + + db.driver()->escapeIdentifier("first Name", QSqlDriver::FieldName) + + " varchar(20), lastName varchar(20))"; + QVERIFY_SQL(q, exec(query.arg(tableName))); Q3SqlCursor cur(tableName, true, db); cur.select(); |