summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-03-19 20:42:00 +0000
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-03-19 20:42:00 +0000
commite1c1dca297055631876827d94e6a73683a68ae18 (patch)
tree72d504093222aea34517ac72a5e8e4a589dfbdd2
parentd0a9f440e6860a225c5a0ae6222fa96bbc312dbe (diff)
firebird-sdbc: Allow describe-bind for Sqlda wrapper.
Is needed to handle input XSQLDAs. Change-Id: I7b57dd97e0ff5cebedae245e5a609f2aac1a5820
-rw-r--r--connectivity/source/drivers/firebird/wrapper/Sqlda.cxx20
-rw-r--r--connectivity/source/drivers/firebird/wrapper/Sqlda.hxx7
2 files changed, 23 insertions, 4 deletions
diff --git a/connectivity/source/drivers/firebird/wrapper/Sqlda.cxx b/connectivity/source/drivers/firebird/wrapper/Sqlda.cxx
index 9cca23dddf52..f3c520c100f1 100644
--- a/connectivity/source/drivers/firebird/wrapper/Sqlda.cxx
+++ b/connectivity/source/drivers/firebird/wrapper/Sqlda.cxx
@@ -152,7 +152,9 @@ Sqlda::~Sqlda()
}
}
-void Sqlda::describeStatement(isc_stmt_handle& aStatementHandle)
+void Sqlda::describeStatement(
+ isc_stmt_handle& aStatementHandle,
+ bool bDescribeBind)
{
if (!mpSqlda)
{
@@ -169,7 +171,13 @@ void Sqlda::describeStatement(isc_stmt_handle& aStatementHandle)
{
ISC_STATUS_ARRAY aStatusVector;
- if (isc_dsql_describe(aStatusVector,
+ if (!bDescribeBind ?
+ isc_dsql_describe(aStatusVector,
+ &aStatementHandle,
+ FIREBIRD_SQL_DIALECT,
+ mpSqlda)
+ :
+ isc_dsql_describe_bind(aStatusVector,
&aStatementHandle,
FIREBIRD_SQL_DIALECT,
mpSqlda))
@@ -184,7 +192,13 @@ void Sqlda::describeStatement(isc_stmt_handle& aStatementHandle)
mpSqlda = lcl_allocateSqlda(mpSqlda->sqld);
}
- if (isc_dsql_describe(aStatusVector,
+ if (!bDescribeBind ?
+ isc_dsql_describe(aStatusVector,
+ &aStatementHandle,
+ FIREBIRD_SQL_DIALECT,
+ mpSqlda)
+ :
+ isc_dsql_describe_bind(aStatusVector,
&aStatementHandle,
FIREBIRD_SQL_DIALECT,
mpSqlda))
diff --git a/connectivity/source/drivers/firebird/wrapper/Sqlda.hxx b/connectivity/source/drivers/firebird/wrapper/Sqlda.hxx
index 0c395dbe429b..f51252b68d74 100644
--- a/connectivity/source/drivers/firebird/wrapper/Sqlda.hxx
+++ b/connectivity/source/drivers/firebird/wrapper/Sqlda.hxx
@@ -37,8 +37,13 @@ namespace connectivity
* Set up the Sqlda for a given statement, is equivalent to
* using isc_dsql_describe, but with all the details handled
* within.
+ *
+ * Use bDescribeBind if we are binding an input sqlda, i.e.
+ * if we want isc_dsql_describe_bind instead of isc_dsql_describe.
*/
- void describeStatement(isc_stmt_handle& aStatementHandle);
+ void describeStatement(
+ isc_stmt_handle& aStatementHandle,
+ bool bDescribeBind = false);
};
}
}