diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-09-17 15:22:00 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-09-17 15:22:00 (GMT) |
commit | b7923d48fb6d755d4563eeed0e7f3cbc774d69d5 (patch) | |
tree | ec8bb06f58f714d0b799164693e93bf0d51b6bcf /tests/auto/qsqlquery | |
parent | e6dbbd0398d70ee64a3b8129e9621cfa15d70f8c (diff) | |
parent | a62506aae40ede3fd8030312321759f669458909 (diff) | |
download | Qt-b7923d48fb6d755d4563eeed0e7f3cbc774d69d5.zip Qt-b7923d48fb6d755d4563eeed0e7f3cbc774d69d5.tar.gz Qt-b7923d48fb6d755d4563eeed0e7f3cbc774d69d5.tar.bz2 |
Merge branch '4.5' into 4.6
Conflicts:
tests/auto/qimagereader/tst_qimagereader.cpp
tests/auto/qpainter/tst_qpainter.cpp
tests/auto/qtwidgets/tst_qtwidgets.cpp
Diffstat (limited to 'tests/auto/qsqlquery')
-rw-r--r-- | tests/auto/qsqlquery/tst_qsqlquery.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index 4bea26d..eb95d611c 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -191,6 +191,9 @@ private slots: void task_233829_data() { generic_data("QPSQL"); } void task_233829(); + void sqlServerReturn0_data() { generic_data(); } + void sqlServerReturn0(); + private: // returns all database connections @@ -312,6 +315,13 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db ) tablenames << qTableName( "task_250026" ); tablenames << qTableName( "task_234422" ); + if (tst_Databases::isSqlServer( db )) { + QSqlQuery q( db ); + q.exec("DROP PROCEDURE " + qTableName("test141895_proc")); + } + + tablenames << qTableName("test141895"); + tst_Databases::safeDropTables( db, tablenames ); } @@ -2808,5 +2818,33 @@ void tst_QSqlQuery::task_233829() QVERIFY_SQL(q,exec()); } +void tst_QSqlQuery::sqlServerReturn0() +{ + QFETCH( QString, dbName ); + QSqlDatabase db = QSqlDatabase::database( dbName ); + CHECK_DATABASE( db ); + if (!tst_Databases::isSqlServer( db )) + QSKIP("SQL Server specific test", SkipSingle); + + QString tableName(qTableName("test141895")), procName(qTableName("test141895_proc")); + QSqlQuery q( db ); + q.exec("DROP TABLE " + tableName); + q.exec("DROP PROCEDURE " + procName); + QVERIFY_SQL(q, exec("CREATE TABLE "+tableName+" (id integer)")); + QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (1)")); + QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (2)")); + QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (2)")); + QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (3)")); + QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (1)")); + QVERIFY_SQL(q, exec("CREATE PROCEDURE "+procName+ + " AS " + "SELECT * FROM "+tableName+" WHERE ID = 2 " + "RETURN 0")); + + QVERIFY_SQL(q, exec("{CALL "+procName+"}")); + + QVERIFY_SQL(q, next()); +} + QTEST_MAIN( tst_QSqlQuery ) #include "tst_qsqlquery.moc" |