summaryrefslogtreecommitdiffstats
path: root/tests/auto/qsqlquery
diff options
context:
space:
mode:
authorCharles Yin <charles.yin@nokia.com>2010-10-27 12:05:52 +1000
committerCharles Yin <charles.yin@nokia.com>2010-10-29 13:47:17 +1000
commitcb2a108d79b09ec6ea91106e7f33826dceac4a42 (patch)
treede9892e0406c621294ddd3acf4eef12525ba1b78 /tests/auto/qsqlquery
parent28bd0c6568aefa552c5e37a4e2ef98969c68d0b4 (diff)
Fix QTBUG-14132 oracle (xe) stored procedures with bind variables get errors
Strange Oracle bug: some Oracle servers crash the server process with non-zero error handle (mostly for 10g). So pass null error handle pointer to OCIAttrSet when setting OCI_ATTR_CHARSET_FORM to bypass this bug. Change-Id: Ifcf65994a22783e69a89bebe1adb882cdf36bdbb Task-number:QTBUG-14132 Reviewed-by: Michael Goddard
Diffstat (limited to 'tests/auto/qsqlquery')
-rw-r--r--tests/auto/qsqlquery/tst_qsqlquery.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp
index c7a61a5fdd..7c93c7a3ee 100644
--- a/tests/auto/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp
@@ -209,6 +209,8 @@ private slots:
void QTBUG_6852();
void QTBUG_5765_data() { generic_data("QMYSQL"); }
void QTBUG_5765();
+ void QTBUG_14132_data() { generic_data("QOCI"); }
+ void QTBUG_14132();
void sqlite_constraint_data() { generic_data("QSQLITE"); }
void sqlite_constraint();
@@ -2933,6 +2935,25 @@ void tst_QSqlQuery::QTBUG_551()
QCOMPARE(res_outLst[2].toString(), QLatin1String("3. Value is 2"));
}
+void tst_QSqlQuery::QTBUG_14132()
+{
+ QFETCH( QString, dbName );
+ QSqlDatabase db = QSqlDatabase::database( dbName );
+ CHECK_DATABASE( db );
+ QSqlQuery q(db);
+ const QString procedureName(qTableName("procedure", __FILE__));
+ QVERIFY_SQL(q, exec("CREATE OR REPLACE PROCEDURE "+ procedureName + " (outStr OUT varchar2) \n\
+ is \n\
+ begin \n\
+ outStr := 'OUTSTRING'; \n\
+ end;"));
+ QString outValue = "XXXXXXXXX";
+ q.prepare("CALL "+procedureName+"(?)");
+ q.addBindValue(outValue, QSql::Out);
+ QVERIFY_SQL(q, exec());
+ QCOMPARE(outValue, QLatin1String("OUTSTRING"));
+}
+
void tst_QSqlQuery::QTBUG_5251()
{
QFETCH( QString, dbName );