diff options
author | Bill King <bking@trolltech.com> | 2009-07-06 15:57:41 +1000 |
---|---|---|
committer | Bill King <bking@trolltech.com> | 2009-07-06 15:57:41 +1000 |
commit | 8915977e56b58c4631dfb2b8616585b664e55f38 (patch) | |
tree | 2749523142ef9fa1ebb532ea301bb26b3bba1f23 /tests | |
parent | 8fa9744b1b18f97b98fc434b8b8057434118e3db (diff) | |
download | qt4-tools-8915977e56b58c4631dfb2b8616585b664e55f38.tar.gz |
Fix more sql autotest failures.
Sql server fails at numeric field calculations. (Confirmed by running
against MySql via odbc). Also, quote fields properly. The drivers know
how to do it correctly, so let them handle it.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp index 812c862ade..360c3b74e1 100644 --- a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp +++ b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp @@ -575,7 +575,7 @@ void tst_Q3SqlCursor::precision() if(!tst_Databases::isSqlServer(db)) QCOMPARE( cur.value( 0 ).asString(), precStr ); else - QCOMPARE( cur.value( 0 ).asString(), precStr.left(precStr.size()-1) ); + QCOMPARE( cur.value( 0 ).asString(), precStr.left(precStr.size()-1) ); // Sql server fails at counting. QVERIFY( cur.next() ); QCOMPARE( cur.value( 0 ).asDouble(), precDbl ); } @@ -759,8 +759,9 @@ void tst_Q3SqlCursor::insertFieldNameContainsWS() { QSqlQuery q(db); q.exec(QString("DROP TABLE %1").arg(tableName)); - QString query = QString("CREATE TABLE %1 (id int, \"first Name\" varchar(20), " - "lastName varchar(20))"); + 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(QString("%1").arg(tableName), true, db); |