[Libreoffice-commits] core.git: 3 commits - connectivity/source
Andrzej J.R. Hunt
andrzej at ahunt.org
Fri Aug 16 13:24:00 PDT 2013
connectivity/source/drivers/firebird/DatabaseMetaData.cxx | 22 ++++++-----
connectivity/source/drivers/firebird/Statement.cxx | 4 ++
connectivity/source/drivers/firebird/StatementCommonBase.cxx | 14 +++++++
3 files changed, 30 insertions(+), 10 deletions(-)
New commits:
commit 985df3aa867a5ebba22e3d7805baa53022c1ee2a
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date: Fri Aug 16 12:18:15 2013 +0100
Free SQLDA if statement preparation fails. (firebird-sdbc)
Otherwise we are left with an invalid sqlda which cannot be safely
used later.
Change-Id: I506a17266da798fa6ed46c65f3838bb8fafbe241
diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.cxx b/connectivity/source/drivers/firebird/StatementCommonBase.cxx
index 632962a..f7a3a3c 100644
--- a/connectivity/source/drivers/firebird/StatementCommonBase.cxx
+++ b/connectivity/source/drivers/firebird/StatementCommonBase.cxx
@@ -145,9 +145,13 @@ void OStatementCommonBase::prepareAndDescribeStatement(const OUString& sql,
&m_aStatementHandle);
if (aErr)
+ {
+ free(pOutSqlda);
+ pOutSqlda = 0;
evaluateStatusVector(m_statusVector,
"isc_dsql_allocate_statement",
*this);
+ }
aErr = isc_dsql_prepare(m_statusVector,
&m_pConnection->getTransaction(),
@@ -158,9 +162,14 @@ void OStatementCommonBase::prepareAndDescribeStatement(const OUString& sql,
pInSqlda);
if (aErr)
+ {
+ // TODO: free statement handle?
+ free(pOutSqlda);
+ pOutSqlda = 0;
evaluateStatusVector(m_statusVector,
"isc_dsql_prepare",
*this);
+ }
aErr = isc_dsql_describe(m_statusVector,
&m_aStatementHandle,
@@ -169,9 +178,14 @@ void OStatementCommonBase::prepareAndDescribeStatement(const OUString& sql,
if (aErr)
+ {
+ // TODO: free statement handle, etc.?
+ free(pOutSqlda);
+ pOutSqlda = 0;
evaluateStatusVector(m_statusVector,
"isc_dsql_describe",
*this);
+ }
// Ensure we have enough space in pOutSqlda
if (pOutSqlda->sqld > pOutSqlda->sqln)
commit 23cb9490087776c0d594465d86576853550872f9
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date: Fri Aug 16 12:12:53 2013 +0100
Add some debug output. (firebird-sdbc)
Change-Id: I72a9992005b42a7a9ef86946bbd3301a7100001d
diff --git a/connectivity/source/drivers/firebird/Statement.cxx b/connectivity/source/drivers/firebird/Statement.cxx
index 5a6d85f..32b6243 100644
--- a/connectivity/source/drivers/firebird/Statement.cxx
+++ b/connectivity/source/drivers/firebird/Statement.cxx
@@ -100,6 +100,8 @@ sal_Int32 SAL_CALL OStatement::executeUpdate(const OUString& sql)
MutexGuard aGuard(m_pConnection->getMutex());
checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
+ SAL_INFO("connectivity.firebird", "executeUpdate(" << sql << ")");
+
int aErr = isc_dsql_execute_immediate(m_statusVector,
&m_pConnection->getDBHandle(),
&m_pConnection->getTransaction(),
@@ -124,6 +126,8 @@ uno::Reference< XResultSet > SAL_CALL OStatement::executeQuery(const OUString& s
MutexGuard aGuard(m_pConnection->getMutex());
checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
+ SAL_INFO("connectivity.firebird", "executeQuery(" << sql << ")");
+
ISC_STATUS aErr = 0;
disposeResultSet();
commit 4365e13a0cde6934c07b64c4e9dc1b91e3614958
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date: Fri Aug 16 12:08:54 2013 +0100
Enable Core SQL Grammar. (firebird-sdbc)
This is needed e.g. to enable primary keys.
Change-Id: I400637550b96d6e0aa880edea9678024f300f616
diff --git a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
index 664144e..6aac8e7 100644
--- a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
@@ -292,6 +292,18 @@ sal_Bool SAL_CALL ODatabaseMetaData::storesUpperCaseIdentifiers()
}
// ---- SQL Feature Support ---------------------------------------------------
+sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar()
+ throw(SQLException, RuntimeException)
+{
+ return sal_True;
+}
+
+sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar()
+ throw(SQLException, RuntimeException)
+{
+ return sal_True;
+}
+
sal_Bool SAL_CALL ODatabaseMetaData::supportsAlterTableWithAddColumn()
throw(SQLException, RuntimeException)
{
@@ -705,16 +717,6 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsExtendedSQLGrammar( ) throw(SQLExc
return sal_False;
}
// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsCoreSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMinimumSQLGrammar( ) throw(SQLException, RuntimeException)
-{
- return sal_True;
-}
-// -------------------------------------------------------------------------
sal_Bool SAL_CALL ODatabaseMetaData::supportsFullOuterJoins( ) throw(SQLException, RuntimeException)
{
return sal_False;
More information about the Libreoffice-commits
mailing list