[Libreoffice-commits] core.git: 6 commits - connectivity/source
Andrzej J.R. Hunt
andrzej at ahunt.org
Fri Aug 23 02:39:27 PDT 2013
connectivity/source/drivers/firebird/PreparedStatement.cxx | 20 -
connectivity/source/drivers/firebird/ResultSet.cxx | 244 -------------
connectivity/source/drivers/firebird/ResultSet.hxx | 112 -----
connectivity/source/drivers/firebird/Table.cxx | 37 +
connectivity/source/drivers/firebird/Table.hxx | 5
5 files changed, 59 insertions(+), 359 deletions(-)
New commits:
commit 19cb39f0ffafaaa2f016035bd4ec297b87652681
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date: Fri Aug 23 10:19:27 2013 +0100
Close cursors in PreparedStatement. (firebird-sdbc)
Trying to reuse a statement that still has an open cursor leads to
errors -- in this usage isc_free_statement doesn't actually free
the statement but simply closes the db-internal cursor used by
that statement previously.
Change-Id: Iedbe42bc46e6b6f972b7b19f17a60d5f59bae28c
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index 024c9ae..ddb10e0 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -265,6 +265,19 @@ sal_Bool SAL_CALL OPreparedStatement::execute()
ISC_STATUS aErr;
+ if (m_xResultSet.is()) // Checks whether we have already run the statement.
+ {
+ disposeResultSet();
+ // Closes the cursor from the last run.
+ aErr = isc_dsql_free_statement(m_statusVector,
+ &m_aStatementHandle,
+ DSQL_close);
+ if (aErr)
+ evaluateStatusVector(m_statusVector,
+ "isc_dsql_free_statement: close cursor",
+ *this);
+ }
+
aErr = isc_dsql_execute(m_statusVector,
&m_pConnection->getTransaction(),
&m_aStatementHandle,
commit ddc3818322b07793ae398a46d6cf9fc71f7bbff7
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date: Thu Aug 22 13:05:32 2013 +0100
Use correct sqlda for number of parameters. (firebird-sdbc)
Change-Id: Ief966fb9bd9f3344cfe9f3b4c4b37540e00ad063
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index 70d6d36..024c9ae 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -199,9 +199,8 @@ void SAL_CALL OPreparedStatement::setString(sal_Int32 nParameterIndex,
const OUString& x)
throw(SQLException, RuntimeException)
{
- SAL_INFO("connectivity.firebird", "setString(). "
- "parameterIndex: " << nParameterIndex << " , "
- "x: " << x);
+ SAL_INFO("connectivity.firebird",
+ "setString(" << nParameterIndex << " , " << x << ")");
MutexGuard aGuard( m_pConnection->getMutex() );
checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
@@ -570,7 +569,7 @@ void OPreparedStatement::checkParameterIndex(sal_Int32 nParameterIndex)
throw(SQLException)
{
ensurePrepared();
- if ((nParameterIndex == 0) || (nParameterIndex > m_pOutSqlda->sqld))
+ if ((nParameterIndex == 0) || (nParameterIndex > m_pInSqlda->sqld))
throw SQLException();
// TODO: sane error message here.
}
commit 33b011e6ff908f5b0a4eec43d89284b0cf631b21
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date: Thu Aug 22 12:54:23 2013 +0100
RefreshRow is unuspported. (firebird-sdbc)
Change-Id: Iec8e72a6236de83a1698e2d6e9dbcb609f0f858f
diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx
index 2c29b94..edd1836 100644
--- a/connectivity/source/drivers/firebird/ResultSet.cxx
+++ b/connectivity/source/drivers/firebird/ResultSet.cxx
@@ -630,12 +630,11 @@ Any SAL_CALL OResultSet::getWarnings( ) throw(SQLException, RuntimeException)
return Any();
}
-// -------------------------------------------------------------------------
-void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException)
+void SAL_CALL OResultSet::refreshRow() throw(SQLException, RuntimeException)
{
- MutexGuard aGuard(m_pConnection->getMutex());
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
+ ::dbtools::throwFunctionNotSupportedException("refreshRow not supported in firebird",
+ *this,
+ Any());
}
// -------------------------------------------------------------------------
IPropertyArrayHelper* OResultSet::createArrayHelper( ) const
commit ab59b7176fcb82ffe16c9200169c2a897387c056
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date: Thu Aug 22 12:19:49 2013 +0100
Remove unsupported XRowLocate/XDeleteRows (firebird-sdbc)
Change-Id: I74bf84c8aae4d4ba6b9a2a9ca497ed0cbc092d35
diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx
index a86afaf..2c29b94 100644
--- a/connectivity/source/drivers/firebird/ResultSet.cxx
+++ b/connectivity/source/drivers/firebird/ResultSet.cxx
@@ -638,67 +638,6 @@ void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException)
}
// -------------------------------------------------------------------------
-// XRowLocate
-Any SAL_CALL OResultSet::getBookmark( ) throw( SQLException, RuntimeException)
-{
- MutexGuard aGuard(m_pConnection->getMutex());
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- // if you don't want to support bookmark you must remove the XRowLocate interface
-
- return Any();
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::moveToBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
-{
- (void) bookmark;
- MutexGuard aGuard(m_pConnection->getMutex());
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw( SQLException, RuntimeException)
-{
- (void) bookmark;
- (void) rows;
- MutexGuard aGuard(m_pConnection->getMutex());
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSet::compareBookmarks( const Any& aFirst, const Any& aSecond ) throw( SQLException, RuntimeException)
-{
- (void) aFirst;
- (void) aSecond;
- MutexGuard aGuard(m_pConnection->getMutex());
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return CompareBookmark::NOT_EQUAL;
-}
-// -------------------------------------------------------------------------
-sal_Bool SAL_CALL OResultSet::hasOrderedBookmarks( ) throw( SQLException, RuntimeException)
-{
- return sal_False;
-}
-// -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OResultSet::hashBookmark( const Any& bookmark ) throw( SQLException, RuntimeException)
-{
- (void) bookmark;
- throw SQLException();
-}
-// -------------------------------------------------------------------------
-// XDeleteRows
-Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const Sequence< Any >& rows ) throw( SQLException, RuntimeException)
-{
- (void) rows;
- MutexGuard aGuard(m_pConnection->getMutex());
- checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
-
- return Sequence< sal_Int32 >();
-}
-// -------------------------------------------------------------------------
IPropertyArrayHelper* OResultSet::createArrayHelper( ) const
{
Sequence< Property > aProps(6);
diff --git a/connectivity/source/drivers/firebird/ResultSet.hxx b/connectivity/source/drivers/firebird/ResultSet.hxx
index 5f05cde..68c59a1 100644
--- a/connectivity/source/drivers/firebird/ResultSet.hxx
+++ b/connectivity/source/drivers/firebird/ResultSet.hxx
@@ -25,7 +25,7 @@
#include <ibase.h>
#include <connectivity/OSubComponent.hxx>
-#include <cppuhelper/compbase10.hxx>
+#include <cppuhelper/compbase8.hxx>
#include <com/sun/star/util/XCancellable.hpp>
#include <com/sun/star/sdbc/XCloseable.hpp>
@@ -33,12 +33,7 @@
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
-#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
-#include <com/sun/star/sdbc/XRowUpdate.hpp>
#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
-#include <com/sun/star/sdbcx/XDeleteRows.hpp>
-#include <com/sun/star/sdbcx/XRowLocate.hpp>
-
namespace connectivity
{
@@ -47,13 +42,11 @@ namespace connectivity
/*
** OResultSet
*/
- typedef ::cppu::WeakComponentImplHelper10< ::com::sun::star::sdbc::XResultSet,
+ typedef ::cppu::WeakComponentImplHelper8< ::com::sun::star::sdbc::XResultSet,
::com::sun::star::sdbc::XRow,
::com::sun::star::sdbc::XResultSetMetaDataSupplier,
::com::sun::star::util::XCancellable,
::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::sdbcx::XRowLocate,
- ::com::sun::star::sdbcx::XDeleteRows,
::com::sun::star::sdbc::XCloseable,
::com::sun::star::sdbc::XColumnLocate,
::com::sun::star::lang::XServiceInfo> OResultSet_BASE;
@@ -198,15 +191,6 @@ namespace connectivity
throw(::com::sun::star::sdbc::SQLException,
::com::sun::star::uno::RuntimeException);
- // XRowLocate
- virtual ::com::sun::star::uno::Any SAL_CALL getBookmark( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL compareBookmarks( const ::com::sun::star::uno::Any& first, const ::com::sun::star::uno::Any& second ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XDeleteRows
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
};
// Specialisations have to be in the namespace and can't be within the class.
commit f69b198ded406ed07b91c79e243cdd28298d6dad
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date: Thu Aug 22 10:26:05 2013 +0100
Remove unsupporte XRowUpdate/XResultSetUpdate. (firebird-sdbc)
Change-Id: I3b9f8c7199e66f90e1573069996962294793d95e
diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx
index aac6622..a86afaf 100644
--- a/connectivity/source/drivers/firebird/ResultSet.cxx
+++ b/connectivity/source/drivers/firebird/ResultSet.cxx
@@ -629,181 +629,7 @@ Any SAL_CALL OResultSet::getWarnings( ) throw(SQLException, RuntimeException)
{
return Any();
}
-// ---- XResultSetUpdate - UNSUPPORTED ---------------------------------------
-void SAL_CALL OResultSet::insertRow() throw(SQLException, RuntimeException)
-{
- throwFunctionNotSupportedException("XResultSetUpdate::insertRow", *this);
-}
-
-void SAL_CALL OResultSet::updateRow() throw(SQLException, RuntimeException)
-{
- throwFunctionNotSupportedException("XResultSetUpdate::updateRow", *this);
-}
-
-void SAL_CALL OResultSet::deleteRow() throw(SQLException, RuntimeException)
-{
- throwFunctionNotSupportedException("XResultSetUpdate::deleteRow", *this);
-}
-
-void SAL_CALL OResultSet::cancelRowUpdates() throw(SQLException, RuntimeException)
-{
- throwFunctionNotSupportedException("XResultSetUpdate::cancelRowUpdates", *this);
-}
-
-void SAL_CALL OResultSet::moveToInsertRow() throw(SQLException, RuntimeException)
-{
- throwFunctionNotSupportedException("XResultSetUpdate::moveToInsertRow", *this);
-}
-
-void SAL_CALL OResultSet::moveToCurrentRow() throw(SQLException, RuntimeException)
-{
- throwFunctionNotSupportedException("XResultSetUpdate::moveToCurrentRow", *this);
-}
-// ---- XRowUpdate - UNSUPPORTED ---------------------------------------------
-void SAL_CALL OResultSet::updateNull(sal_Int32 columnIndex)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- throwFunctionNotSupportedException("XRowUpdate::updateNull", *this);
-}
-
-void SAL_CALL OResultSet::updateBoolean(sal_Int32 columnIndex, sal_Bool x)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- throwFunctionNotSupportedException("XRowUpdate::updateBoolean", *this);
-}
-
-void SAL_CALL OResultSet::updateByte(sal_Int32 columnIndex, sal_Int8 x)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- throwFunctionNotSupportedException("XRowUpdate::updateByte", *this);
-}
-
-void SAL_CALL OResultSet::updateShort(sal_Int32 columnIndex, sal_Int16 x)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- throwFunctionNotSupportedException("XRowUpdate::updateShort", *this);
-}
-
-void SAL_CALL OResultSet::updateInt(sal_Int32 columnIndex, sal_Int32 x)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- throwFunctionNotSupportedException("XRowUpdate::updateInt", *this);
-}
-
-void SAL_CALL OResultSet::updateLong(sal_Int32 columnIndex, sal_Int64 x)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- throwFunctionNotSupportedException("XRowUpdate::updateLong", *this);
-}
-
-void SAL_CALL OResultSet::updateFloat(sal_Int32 columnIndex, float x)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- throwFunctionNotSupportedException("XRowUpdate::updateFloat", *this);
-}
-
-void SAL_CALL OResultSet::updateDouble(sal_Int32 columnIndex, double x)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- throwFunctionNotSupportedException("XRowUpdate::updateDouble", *this);
-}
-
-void SAL_CALL OResultSet::updateString(sal_Int32 columnIndex, const OUString& x)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- throwFunctionNotSupportedException("XRowUpdate::updateString", *this);
-}
-
-void SAL_CALL OResultSet::updateBytes(sal_Int32 columnIndex, const Sequence< sal_Int8 >& x)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- throwFunctionNotSupportedException("XRowUpdate::updateBytes", *this);
-}
-
-void SAL_CALL OResultSet::updateDate(sal_Int32 columnIndex, const Date& x)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- throwFunctionNotSupportedException("XRowUpdate::updateDate", *this);
-}
-
-void SAL_CALL OResultSet::updateTime(sal_Int32 columnIndex, const Time& x)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- throwFunctionNotSupportedException("XRowUpdate::updateTime", *this);
-}
-
-void SAL_CALL OResultSet::updateTimestamp(sal_Int32 columnIndex, const DateTime& x)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- throwFunctionNotSupportedException("XRowUpdate::updateTimeStamp", *this);
-}
-
-void SAL_CALL OResultSet::updateBinaryStream(sal_Int32 columnIndex,
- const uno::Reference< XInputStream >& x,
- sal_Int32 length)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- (void) length;
- throwFunctionNotSupportedException("XRowUpdate::updateBinaryStream", *this);
-}
-
-void SAL_CALL OResultSet::updateCharacterStream(sal_Int32 columnIndex,
- const uno::Reference< XInputStream >& x,
- sal_Int32 length)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- (void) length;
- throwFunctionNotSupportedException("XRowUpdate::updateCharacterStream", *this);
-}
-
-void SAL_CALL OResultSet::updateObject(sal_Int32 columnIndex, const Any& x)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- throwFunctionNotSupportedException("XRowUpdate::updateObject", *this);
-}
-
-void SAL_CALL OResultSet::updateNumericObject(sal_Int32 columnIndex,
- const Any& x,
- sal_Int32 scale)
- throw(SQLException, RuntimeException)
-{
- (void) columnIndex;
- (void) x;
- (void) scale;
- throwFunctionNotSupportedException("XRowUpdate::updateNumericObject", *this);
-}
// -------------------------------------------------------------------------
void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException)
{
diff --git a/connectivity/source/drivers/firebird/ResultSet.hxx b/connectivity/source/drivers/firebird/ResultSet.hxx
index 6cfec8d..5f05cde 100644
--- a/connectivity/source/drivers/firebird/ResultSet.hxx
+++ b/connectivity/source/drivers/firebird/ResultSet.hxx
@@ -25,7 +25,7 @@
#include <ibase.h>
#include <connectivity/OSubComponent.hxx>
-#include <cppuhelper/compbase12.hxx>
+#include <cppuhelper/compbase10.hxx>
#include <com/sun/star/util/XCancellable.hpp>
#include <com/sun/star/sdbc/XCloseable.hpp>
@@ -47,13 +47,11 @@ namespace connectivity
/*
** OResultSet
*/
- typedef ::cppu::WeakComponentImplHelper12< ::com::sun::star::sdbc::XResultSet,
+ typedef ::cppu::WeakComponentImplHelper10< ::com::sun::star::sdbc::XResultSet,
::com::sun::star::sdbc::XRow,
::com::sun::star::sdbc::XResultSetMetaDataSupplier,
::com::sun::star::util::XCancellable,
::com::sun::star::sdbc::XWarningsSupplier,
- ::com::sun::star::sdbc::XResultSetUpdate,
- ::com::sun::star::sdbc::XRowUpdate,
::com::sun::star::sdbcx::XRowLocate,
::com::sun::star::sdbcx::XDeleteRows,
::com::sun::star::sdbc::XCloseable,
@@ -195,96 +193,6 @@ namespace connectivity
virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- // XResultSetUpdate - UNSUPPORTED
- virtual void SAL_CALL insertRow()
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateRow()
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deleteRow()
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL cancelRowUpdates()
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToInsertRow()
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL moveToCurrentRow()
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
-
- // XRowUpdate - UNSUPPORTED
- virtual void SAL_CALL updateNull(sal_Int32 columnIndex)
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBoolean(sal_Int32 columnIndex,
- sal_Bool x)
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateByte(sal_Int32 columnIndex,
- sal_Int8 x)
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateShort(sal_Int32 columnIndex,
- sal_Int16 x)
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateInt(sal_Int32 columnIndex,
- sal_Int32 x)
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateLong(sal_Int32 columnIndex,
- sal_Int64 x )
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateFloat(sal_Int32 columnIndex,
- float x)
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDouble(sal_Int32 columnIndex,
- double x )
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateString(sal_Int32 columnIndex,
- const ::rtl::OUString& x )
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBytes(sal_Int32 columnIndex,
- const ::com::sun::star::uno::Sequence< sal_Int8 >& x)
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateDate(sal_Int32 columnIndex,
- const ::com::sun::star::util::Date& x)
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTime(sal_Int32 columnIndex,
- const ::com::sun::star::util::Time& x)
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateTimestamp(sal_Int32 columnIndex,
- const ::com::sun::star::util::DateTime& x)
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateBinaryStream(sal_Int32 columnIndex,
- const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x,
- sal_Int32 length)
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateCharacterStream(sal_Int32 columnIndex,
- const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& x,
- sal_Int32 length)
- throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateObject(sal_Int32 columnIndex, const ::com::sun::star::uno::Any& x)
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL updateNumericObject(sal_Int32 columnIndex,
- const ::com::sun::star::uno::Any& x,
- sal_Int32 scale )
- throw(::com::sun::star::sdbc::SQLException,
- ::com::sun::star::uno::RuntimeException);
-
// XColumnLocate
virtual sal_Int32 SAL_CALL findColumn(const ::rtl::OUString& columnName)
throw(::com::sun::star::sdbc::SQLException,
commit 7a3eff265280d311816f4bc180ef2ec74400e57d
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date: Thu Aug 22 09:19:17 2013 +0100
Set Table privileges. (firebird-sdbc)
Change-Id: Ia73f2f2107e17c03bc568075a0a99bc7a21fb8a7
diff --git a/connectivity/source/drivers/firebird/Table.cxx b/connectivity/source/drivers/firebird/Table.cxx
index abc57af..98e446b 100644
--- a/connectivity/source/drivers/firebird/Table.cxx
+++ b/connectivity/source/drivers/firebird/Table.cxx
@@ -11,11 +11,14 @@
#include "Keys.hxx"
#include "Table.hxx"
+#include <TConnection.hxx>
+
#include <comphelper/sequence.hxx>
#include <connectivity/dbtools.hxx>
#include <connectivity/TIndexes.hxx>
#include <com/sun/star/sdbc/ColumnValue.hpp>
+#include <com/sun/star/sdbcx/Privilege.hpp>
using namespace ::connectivity;
using namespace ::connectivity::firebird;
@@ -28,6 +31,7 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::uno;
Table::Table(Tables* pTables,
@@ -36,9 +40,10 @@ Table::Table(Tables* pTables,
OTableHelper(pTables,
rConnection,
sal_True),
- m_rMutex(rMutex)
+ m_rMutex(rMutex),
+ m_nPrivileges(0)
{
- OTableHelper::construct();
+ construct();
}
Table::Table(Tables* pTables,
@@ -55,11 +60,34 @@ Table::Table(Tables* pTables,
rDescription,
"",
""),
- m_rMutex(rMutex)
+ m_rMutex(rMutex),
+ m_nPrivileges(0)
{
- OTableHelper::construct();
+ construct();
}
+void Table::construct()
+{
+ OTableHelper::construct();
+ if (!isNew())
+ {
+ // TODO: get privileges when in non-embedded mode.
+ m_nPrivileges = Privilege::DROP |
+ Privilege::REFERENCE |
+ Privilege::ALTER |
+ Privilege::CREATE |
+ Privilege::READ |
+ Privilege::DELETE |
+ Privilege::UPDATE |
+ Privilege::INSERT |
+ Privilege::SELECT;
+ registerProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRIVILEGES),
+ PROPERTY_ID_PRIVILEGES,
+ PropertyAttribute::READONLY,
+ &m_nPrivileges,
+ ::getCppuType(&m_nPrivileges));
+ }
+}
//----- OTableHelper ---------------------------------------------------------
OCollection* Table::createColumns(const TStringVector& rNames)
{
@@ -228,4 +256,5 @@ OUString Table::getAlterTableColumn(const OUString& rColumn)
{
return ("ALTER TABLE \"" + getName() + "\" ALTER COLUMN \"" + rColumn + "\" ");
}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/connectivity/source/drivers/firebird/Table.hxx b/connectivity/source/drivers/firebird/Table.hxx
index 41f12c3..d6354bc 100644
--- a/connectivity/source/drivers/firebird/Table.hxx
+++ b/connectivity/source/drivers/firebird/Table.hxx
@@ -27,6 +27,7 @@ namespace connectivity
{
private:
::osl::Mutex& m_rMutex;
+ sal_Int32 m_nPrivileges;
/**
* Get the ALTER TABLE [TABLE] ALTER [COLUMN] String.
@@ -34,6 +35,9 @@ namespace connectivity
*/
::rtl::OUString getAlterTableColumn(const ::rtl::OUString& rColumn);
+ protected:
+ void construct();
+
public:
Table(Tables* pTables,
::osl::Mutex& rMutex,
@@ -81,7 +85,6 @@ namespace connectivity
SAL_CALL getTypes()
throw(::com::sun::star::uno::RuntimeException);
-
};
} // namespace firebird
More information about the Libreoffice-commits
mailing list