Commit after DDL statement. (firebird-sdbc)
Changes made in a DDL statement are only usable after a commit in firebird, e.g. a created table won't appear etc. Change-Id: I3b537f495b6bc96fa48ebc1a3e46205da60bb2d4
This commit is contained in:
@@ -393,20 +393,20 @@ sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionIgnoredInTransactions()
|
|||||||
sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit()
|
sal_Bool SAL_CALL ODatabaseMetaData::dataDefinitionCausesTransactionCommit()
|
||||||
throw(SQLException, RuntimeException)
|
throw(SQLException, RuntimeException)
|
||||||
{
|
{
|
||||||
return sal_False;
|
return sal_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly()
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsDataManipulationTransactionsOnly()
|
||||||
throw(SQLException, RuntimeException)
|
throw(SQLException, RuntimeException)
|
||||||
{
|
{
|
||||||
return sal_False;
|
return sal_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Bool SAL_CALL ODatabaseMetaData::
|
sal_Bool SAL_CALL ODatabaseMetaData::
|
||||||
supportsDataDefinitionAndDataManipulationTransactions()
|
supportsDataDefinitionAndDataManipulationTransactions()
|
||||||
throw(SQLException, RuntimeException)
|
throw(SQLException, RuntimeException)
|
||||||
{
|
{
|
||||||
return sal_True;
|
return sal_False;
|
||||||
}
|
}
|
||||||
//----- Transaction Support --------------------------------------------------
|
//----- Transaction Support --------------------------------------------------
|
||||||
sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions()
|
sal_Bool SAL_CALL ODatabaseMetaData::supportsTransactions()
|
||||||
|
@@ -139,7 +139,14 @@ uno::Reference< XResultSet > SAL_CALL OStatement::executeQuery(const OUString& s
|
|||||||
|
|
||||||
// TODO: deal with cleanup
|
// TODO: deal with cleanup
|
||||||
// close();
|
// close();
|
||||||
|
|
||||||
evaluateStatusVector(m_statusVector, sql, *this);
|
evaluateStatusVector(m_statusVector, sql, *this);
|
||||||
|
|
||||||
|
if (isDDLStatement(aStatementHandle))
|
||||||
|
{
|
||||||
|
m_pConnection->commit();
|
||||||
|
}
|
||||||
|
|
||||||
return m_xResultSet;
|
return m_xResultSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -321,4 +321,32 @@ uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OStatementC
|
|||||||
return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
|
return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OStatementCommonBase::isDDLStatement(isc_stmt_handle& aStatementHandle)
|
||||||
|
throw (SQLException)
|
||||||
|
{
|
||||||
|
ISC_STATUS_ARRAY aStatusVector;
|
||||||
|
ISC_STATUS aErr;
|
||||||
|
|
||||||
|
char aInfoItems[] = {isc_info_sql_stmt_type};
|
||||||
|
char aResultsBuffer[8];
|
||||||
|
|
||||||
|
aErr = isc_dsql_sql_info(aStatusVector,
|
||||||
|
&aStatementHandle,
|
||||||
|
sizeof(aInfoItems),
|
||||||
|
aInfoItems,
|
||||||
|
sizeof(aResultsBuffer),
|
||||||
|
aResultsBuffer);
|
||||||
|
|
||||||
|
if (!aErr && aResultsBuffer[0] == isc_info_sql_stmt_type)
|
||||||
|
{
|
||||||
|
const short aBytes = (short) isc_vax_integer(aResultsBuffer+1, 2);
|
||||||
|
const short aStatementType = (short) isc_vax_integer(aResultsBuffer+3, aBytes);
|
||||||
|
if (aStatementType == isc_info_sql_stmt_ddl)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
evaluateStatusVector(aStatusVector,
|
||||||
|
"isc_dsq_sql_info",
|
||||||
|
*this);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -87,6 +87,9 @@ namespace connectivity
|
|||||||
isc_stmt_handle& aStatementHandle,
|
isc_stmt_handle& aStatementHandle,
|
||||||
XSQLDA*& pOutSqlda,
|
XSQLDA*& pOutSqlda,
|
||||||
XSQLDA* pInSqlda=0);
|
XSQLDA* pInSqlda=0);
|
||||||
|
bool isDDLStatement(isc_stmt_handle& aStatementHandle)
|
||||||
|
throw (::com::sun::star::sdbc::SQLException);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
::cppu::OBroadcastHelper& rBHelper;
|
::cppu::OBroadcastHelper& rBHelper;
|
||||||
|
Reference in New Issue
Block a user