diff options
author | Bill King <bking@trolltech.com> | 2009-07-08 11:17:40 +1000 |
---|---|---|
committer | Bill King <bking@trolltech.com> | 2009-07-08 11:17:40 +1000 |
commit | b2e62931f1b2968a69aa013b27a50d2e6beb4e27 (patch) | |
tree | 81e01b6ad99c48fd90ac797a07870f8522327312 /tests/auto/qsqlquery | |
parent | 5ff22b1ed4da11dc16a236825c939b5ae38d27cc (diff) | |
download | qt4-tools-b2e62931f1b2968a69aa013b27a50d2e6beb4e27.tar.gz |
Cleanup more SQL autotest failures.
Diffstat (limited to 'tests/auto/qsqlquery')
-rw-r--r-- | tests/auto/qsqlquery/tst_qsqlquery.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index 30b85e84ec..5e782caccc 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -188,7 +188,7 @@ private slots: void task_205701_data() { generic_data("QMYSQL"); } void task_205701(); - void task_233829_data() { generic_data(); } + void task_233829_data() { generic_data("QPSQL"); } void task_233829(); @@ -322,7 +322,10 @@ void tst_QSqlQuery::createTestTables( QSqlDatabase db ) // in the MySQL server startup script q.exec( "set table_type=innodb" ); - QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest" ) + " (id int "+tst_Databases::autoFieldName(db) +" NOT NULL, t_varchar varchar(20), t_char char(20), primary key(id))" ) ); + if(tst_Databases::isPostgreSQL(db)) + QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest" ) + " (id serial NOT NULL, t_varchar varchar(20), t_char char(20), primary key(id)) WITH OIDS" ) ); + else + QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest" ) + " (id int "+tst_Databases::autoFieldName(db) +" NOT NULL, t_varchar varchar(20), t_char char(20), primary key(id))" ) ); if ( tst_Databases::isSqlServer( db ) || db.driverName().startsWith( "QTDS" ) ) QVERIFY_SQL( q, exec( "create table " + qTableName( "qtest_null" ) + " (id int null, t_varchar varchar(20) null)" ) ); @@ -1874,7 +1877,7 @@ void tst_QSqlQuery::invalidQuery() QVERIFY( !q.next() ); QVERIFY( !q.isActive() ); - if ( !db.driverName().startsWith( "QOCI" ) && !db.driverName().startsWith( "QDB2" ) ) { + if ( !db.driverName().startsWith( "QOCI" ) && !db.driverName().startsWith( "QDB2" ) && !db.driverName().startsWith( "QODBC" ) ) { // oracle and db2 just prepares everything without complaining if ( db.driver()->hasFeature( QSqlDriver::PreparedQueries ) ) QVERIFY( !q.prepare( "blahfasel" ) ); @@ -2034,7 +2037,7 @@ void tst_QSqlQuery::oraArrayBind() q.bindValue( 0, list, QSql::In ); - QVERIFY_SQL( q, execBatch( QSqlQuery::ValuesAsRows ) ); + QVERIFY_SQL( q, execBatch( QSqlQuery::ValuesAsColumns ) ); QVERIFY_SQL( q, prepare( "BEGIN " "ora_array_test.get_table(?); " @@ -2046,7 +2049,7 @@ void tst_QSqlQuery::oraArrayBind() q.bindValue( 0, list, QSql::Out ); - QVERIFY_SQL( q, execBatch( QSqlQuery::ValuesAsRows ) ); + QVERIFY_SQL( q, execBatch( QSqlQuery::ValuesAsColumns ) ); QVariantList out_list = q.boundValue( 0 ).toList(); @@ -2593,7 +2596,7 @@ void tst_QSqlQuery::blobsPreparedQuery() if ( db.driverName().startsWith( "QPSQL" ) ) typeName = "BYTEA"; - else if ( db.driverName().startsWith( "QODBC" ) ) + else if ( db.driverName().startsWith( "QODBC" ) && tst_Databases::isSqlServer( db )) typeName = "IMAGE"; QVERIFY_SQL( q, exec( QString( "CREATE TABLE %1(id INTEGER, data %2)" ).arg( tableName ).arg( typeName ) ) ); @@ -2826,13 +2829,8 @@ void tst_QSqlQuery::task_233829() QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); - if (!db.driverName().startsWith( "QPSQL" )) { - QSKIP( "This is a PostgreSQL specific test", SkipSingle ); - } - QSqlQuery q( db ); QString tableName = qTableName("task_233829"); - q.exec("DROP TABLE " + tableName); QVERIFY_SQL(q,exec("CREATE TABLE " + tableName + " (dbl1 double precision,dbl2 double precision) without oids;")); QString queryString("INSERT INTO " + tableName +"(dbl1, dbl2) VALUES(?,?)"); |