[Libreoffice-commits] core.git: connectivity/source
Julien Nabet
serval2412 at yahoo.fr
Fri May 16 10:21:05 PDT 2014
connectivity/source/drivers/odbc/ODatabaseMetaData.cxx | 23 +++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
New commits:
commit 224002ee63b043404ecb3b594e6d9dddd02e5cd7
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Sat Apr 5 10:30:54 2014 +0200
Use SQL_DEFAULT_TXN_ISOLATION to get getDefaultTransactionIsolation
Change-Id: I7f4785088151490ae1d55d2bb78bce28357d5c45
Reviewed-on: https://gerrit.libreoffice.org/8863
Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>
Tested-by: Lionel Elie Mamane <lionel at mamane.lu>
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx
index ab62346..6a98544 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/sdbc/DataType.hpp>
#include <com/sun/star/sdbc/ResultSetType.hpp>
#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
+#include <com/sun/star/sdbc/TransactionIsolation.hpp>
#include "odbc/OFunctiondefs.hxx"
#include "stdio.h"
#include "TPrivilegesResultSet.hxx"
@@ -1252,8 +1253,26 @@ sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMajorVersion( ) throw(RuntimeExc
sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException, std::exception)
{
SQLUINTEGER nValue;
- OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this);
- return nValue;
+ sal_Int32 nValueTranslated;
+ OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_DEFAULT_TXN_ISOLATION,nValue,*this);
+ switch(nValue)
+ {
+ case SQL_TXN_READ_UNCOMMITTED:
+ nValueTranslated = com::sun::star::sdbc::TransactionIsolation::READ_UNCOMMITTED;
+ break;
+ case SQL_TXN_READ_COMMITTED:
+ nValueTranslated = com::sun::star::sdbc::TransactionIsolation::READ_COMMITTED;
+ break;
+ case SQL_TXN_REPEATABLE_READ:
+ nValueTranslated = com::sun::star::sdbc::TransactionIsolation::REPEATABLE_READ;
+ break;
+ case SQL_TXN_SERIALIZABLE:
+ nValueTranslated = com::sun::star::sdbc::TransactionIsolation::SERIALIZABLE;
+ break;
+ default:
+ nValueTranslated = 0;
+ }
+ return nValueTranslated;
}
sal_Int32 SAL_CALL ODatabaseMetaData::getDriverMinorVersion( ) throw(RuntimeException, std::exception)
More information about the Libreoffice-commits
mailing list