diff options
author | Bill King <bill.king@nokia.com> | 2009-12-02 23:49:49 (GMT) |
---|---|---|
committer | Bill King <bill.king@nokia.com> | 2009-12-02 23:49:49 (GMT) |
commit | 1b4ff1bab4ccc4bdc403b84920314f76fbca02c5 (patch) | |
tree | a1149e3e0850f775912a4a1bd3b2c1f7ee9f6a1a /tests/auto/qsqldatabase/tst_qsqldatabase.cpp | |
parent | 82a63405863f527028302ceaeff957f9ee5176e2 (diff) | |
download | Qt-1b4ff1bab4ccc4bdc403b84920314f76fbca02c5.zip Qt-1b4ff1bab4ccc4bdc403b84920314f76fbca02c5.tar.gz Qt-1b4ff1bab4ccc4bdc403b84920314f76fbca02c5.tar.bz2 |
Fixes: OCI QSqlDatabase.tables() does not work with system tables.
Task-number: QTBUG-5298
Reviewed-by: Justin McPherson
Diffstat (limited to 'tests/auto/qsqldatabase/tst_qsqldatabase.cpp')
-rw-r--r-- | tests/auto/qsqldatabase/tst_qsqldatabase.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp index fe7c3ea..f840ca6 100644 --- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp @@ -86,6 +86,8 @@ private slots: void open(); void tables_data() { generic_data(); } void tables(); + void oci_tables_data() { generic_data("QOCI"); } + void oci_tables(); void transaction_data() { generic_data(); } void transaction(); void eventNotification_data() { generic_data(); } @@ -380,6 +382,7 @@ void tst_QSqlDatabase::dropTestTables(QSqlDatabase db) if (db.driverName().startsWith("QOCI")) { q.exec("drop user "+qTableName("CREATOR")+" cascade"); q.exec("drop user "+qTableName("APPUSER")+" cascade"); + q.exec("DROP TABLE system."+qTableName("mypassword")); } } @@ -2481,5 +2484,18 @@ void tst_QSqlDatabase::mysql_savepointtest() QVERIFY_SQL(q, exec("savepoint foo")); } +void tst_QSqlDatabase::oci_tables() +{ + QFETCH(QString, dbName); + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + QSqlQuery q(db); + QString systemTableName("system."+qTableName("mypassword")); + QVERIFY_SQL(q, exec("CREATE TABLE "+systemTableName+"(name VARCHAR(20))")); + QVERIFY(!db.tables().contains(systemTableName.toUpper())); + qDebug() << db.tables(QSql::SystemTables); + QVERIFY(db.tables(QSql::SystemTables).contains(systemTableName.toUpper())); +} + QTEST_MAIN(tst_QSqlDatabase) #include "tst_qsqldatabase.moc" |