summaryrefslogtreecommitdiffstats
path: root/tests/auto/qsqldatabase/tst_databases.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qsqldatabase/tst_databases.h')
-rw-r--r--tests/auto/qsqldatabase/tst_databases.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/auto/qsqldatabase/tst_databases.h b/tests/auto/qsqldatabase/tst_databases.h
index 9c8c313..f1e9d28 100644
--- a/tests/auto/qsqldatabase/tst_databases.h
+++ b/tests/auto/qsqldatabase/tst_databases.h
@@ -219,7 +219,7 @@ public:
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 3307 );
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 3308, "CLIENT_COMPRESS=1;CLIENT_SSL=1" ); // MySQL 4.1.1
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 3309, "CLIENT_COMPRESS=1;CLIENT_SSL=1" ); // MySQL 5.0.18 Linux
-// addDb( "QMYSQL3", "testdb", "troll", "trond", "iceblink.nokia.troll.no" ); // MySQL 5.0.13 Windows
+// addDb( "QMYSQL3", "testdb", "troll", "trond", "silence.nokia.troll.no" ); // MySQL 5.1.36 Windows
// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "mysql4-nokia.trolltech.com.au" ); // MySQL 4.1.22-2.el4 linux
// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "mysql5-nokia.trolltech.com.au" ); // MySQL 5.0.45-7.el5 linux
@@ -335,7 +335,7 @@ public:
if(table2.compare(table.section('.', -1, -1), Qt::CaseInsensitive) == 0) {
table=db.driver()->escapeIdentifier(table2, QSqlDriver::TableName);
wasDropped = q.exec( "drop table " + table);
- dbtables.removeAll(table);
+ dbtables.removeAll(table2);
}
}
}
@@ -430,8 +430,8 @@ public:
return "IDENTITY";
/* if ( db.driverName().startsWith( "QPSQL" ) )
return "SERIAL";*/
- if ( db.driverName().startsWith( "QDB2" ) )
- return "GENERATED BY DEFAULT AS IDENTITY";
+// if ( db.driverName().startsWith( "QDB2" ) )
+// return "GENERATED BY DEFAULT AS IDENTITY";
return QString();
}
@@ -483,6 +483,10 @@ public:
{
return db.driverName().startsWith("QMYSQL") || (db.driverName().startsWith("QODBC") && db.databaseName().contains("MySQL") );
}
+ static bool isDB2( QSqlDatabase db )
+ {
+ return db.driverName().startsWith("QDB2") || (db.driverName().startsWith("QODBC") && db.databaseName().contains("db2") );
+ }
// -1 on fail, else Oracle version
static int getOraVersion( QSqlDatabase db )
@@ -514,6 +518,16 @@ public:
return QString();
}
+ static QString getPSQLVersion( const QSqlDatabase &db )
+ {
+ QSqlQuery q(db);
+ q.exec( "select version()" );
+ if(q.next())
+ return q.value( 0 ).toString();
+ else
+ return QString();
+ }
+
QStringList dbNames;
int counter;
};