summaryrefslogtreecommitdiffstats
path: root/connectivity
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2020-03-19 11:23:31 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2020-03-19 11:23:31 +0100
commit59ac7623101c6c728819291199d8683d49d5f95e (patch)
tree57899effb14693299d48a217b7e1689c42a4b6b1 /connectivity
parentMerge branch 'libreoffice-6-4' (diff)
parentAdapt o3tl::span to removal of std::span::cbegin et al (diff)
downloadcore-59ac7623101c6c728819291199d8683d49d5f95e.tar.gz
core-59ac7623101c6c728819291199d8683d49d5f95e.zip
Merge branch 'libreoffice-6-4' into
distro/lhm/libreoffice-6-4+backports Change-Id: I6ce433221ed737d2783c4518d9884d6a82e04e77
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/Catalog.cxx4
-rw-r--r--connectivity/source/drivers/firebird/DatabaseMetaData.cxx16
-rw-r--r--connectivity/source/drivers/firebird/User.cxx11
-rw-r--r--connectivity/source/drivers/firebird/User.hxx7
-rw-r--r--connectivity/source/drivers/firebird/Users.cxx4
-rw-r--r--connectivity/source/drivers/postgresql/pq_connection.cxx2
6 files changed, 27 insertions, 17 deletions
diff --git a/connectivity/source/drivers/firebird/Catalog.cxx b/connectivity/source/drivers/firebird/Catalog.cxx
index 7dc3593d577a..6207625296f6 100644
--- a/connectivity/source/drivers/firebird/Catalog.cxx
+++ b/connectivity/source/drivers/firebird/Catalog.cxx
@@ -71,8 +71,8 @@ void Catalog::refreshUsers()
{
OUString const sSql("SELECT DISTINCT RDB$USER FROM RDB$USER_PRIVILEGES");
- uno::Reference< XResultSet > xUsers = m_xMetaData->getConnection()
- ->createStatement()->executeQuery(sSql);
+ Reference<XStatement> xStmt= m_xMetaData->getConnection()->createStatement();
+ uno::Reference< XResultSet > xUsers = xStmt->executeQuery(sSql);
if (!xUsers.is())
return;
diff --git a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
index c152694a5963..3d0401678d60 100644
--- a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
@@ -934,16 +934,16 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTypeInfo()
// Numeric
aRow[1] = new ORowSetValueDecorator(OUString("NUMERIC"));
aRow[2] = new ORowSetValueDecorator(DataType::NUMERIC);
- aRow[3] = new ORowSetValueDecorator(sal_Int16(15)); // Precision
- aRow[14] = new ORowSetValueDecorator(sal_Int16(1)); // Minimum scale
- aRow[15] = new ORowSetValueDecorator(sal_Int16(15)); // Max scale
+ aRow[3] = new ORowSetValueDecorator(sal_Int16(18)); // Precision
+ aRow[14] = new ORowSetValueDecorator(sal_Int16(0)); // Minimum scale
+ aRow[15] = new ORowSetValueDecorator(sal_Int16(18)); // Max scale
tmp.push_back(aRow);
// Decimal
aRow[1] = new ORowSetValueDecorator(OUString("DECIMAL"));
aRow[2] = new ORowSetValueDecorator(DataType::DECIMAL);
- aRow[3] = new ORowSetValueDecorator(sal_Int16(15)); // Precision
- aRow[14] = new ORowSetValueDecorator(sal_Int16(1)); // Minimum scale
- aRow[15] = new ORowSetValueDecorator(sal_Int16(15)); // Max scale
+ aRow[3] = new ORowSetValueDecorator(sal_Int16(18)); // Precision
+ aRow[14] = new ORowSetValueDecorator(sal_Int16(0)); // Minimum scale
+ aRow[15] = new ORowSetValueDecorator(sal_Int16(18)); // Max scale
tmp.push_back(aRow);
aRow[6] = new ORowSetValueDecorator(); // Create Params
@@ -1247,7 +1247,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
if (xDescriptionBlob.is())
{
sal_Int32 aBlobLength = static_cast<sal_Int32>(xDescriptionBlob->length());
- aDescription = OUString(reinterpret_cast<char*>(xDescriptionBlob->getBytes(0, aBlobLength).getArray()),
+ aDescription = OUString(reinterpret_cast<char*>(xDescriptionBlob->getBytes(1, aBlobLength).getArray()),
aBlobLength,
RTL_TEXTENCODING_UTF8);
}
@@ -1414,7 +1414,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables(
// TODO: we should actually be using CLOB here instead.
// However we haven't implemented CLOB yet, so use BLOB.
sal_Int32 aBlobLength = static_cast<sal_Int32>(xBlob->length());
- sDescription = OUString(reinterpret_cast<char*>(xBlob->getBytes(0, aBlobLength).getArray()),
+ sDescription = OUString(reinterpret_cast<char*>(xBlob->getBytes(1, aBlobLength).getArray()),
aBlobLength,
RTL_TEXTENCODING_UTF8);
}
diff --git a/connectivity/source/drivers/firebird/User.cxx b/connectivity/source/drivers/firebird/User.cxx
index 024d7eb4958a..a2e6f71e3bed 100644
--- a/connectivity/source/drivers/firebird/User.cxx
+++ b/connectivity/source/drivers/firebird/User.cxx
@@ -16,15 +16,22 @@ using namespace ::connectivity::sdbcx;
using namespace ::com::sun::star;
using namespace ::com::sun::star::sdbc;
-User::User():
+User::User(const css::uno::Reference< css::sdbc::XConnection >& rConnection):
OUser(true) // Case Sensitive
+ , m_xConnection(rConnection)
{}
-User::User(const OUString& rName):
+User::User(const css::uno::Reference< css::sdbc::XConnection >& rConnection, const OUString& rName):
OUser(rName,
true) // Case Sensitive
+ , m_xConnection(rConnection)
{}
+void User::changePassword(const OUString&, const OUString& newPassword)
+{
+ m_xConnection->createStatement()->execute("ALTER USER " + m_Name + " PASSWORD '" + newPassword + "'");
+}
+
//----- IRefreshableGroups ----------------------------------------------------
void User::refreshGroups()
{
diff --git a/connectivity/source/drivers/firebird/User.hxx b/connectivity/source/drivers/firebird/User.hxx
index d2cc091000b9..ff1de34ea5fb 100644
--- a/connectivity/source/drivers/firebird/User.hxx
+++ b/connectivity/source/drivers/firebird/User.hxx
@@ -11,6 +11,7 @@
#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_FIREBIRD_USER_HXX
#include <connectivity/sdbcx/VUser.hxx>
+#include <com/sun/star/sdbc/XConnection.hpp>
namespace connectivity
{
@@ -22,17 +23,19 @@ namespace connectivity
*/
class User: public ::connectivity::sdbcx::OUser
{
+ css::uno::Reference< css::sdbc::XConnection > m_xConnection;
public:
/**
* Create a "new" descriptor, which isn't yet in the database.
*/
- User();
+ User(const css::uno::Reference< css::sdbc::XConnection >& rConnection);
/**
* For a user that already exists in the db.
*/
- User(const OUString& rName);
+ User(const css::uno::Reference< css::sdbc::XConnection >& rConnection, const OUString& rName);
+ virtual void SAL_CALL changePassword(const OUString&, const OUString& newPassword) override;
// IRefreshableGroups::
virtual void refreshGroups() override;
};
diff --git a/connectivity/source/drivers/firebird/Users.cxx b/connectivity/source/drivers/firebird/Users.cxx
index 0423d9c33181..061200fde5d3 100644
--- a/connectivity/source/drivers/firebird/Users.cxx
+++ b/connectivity/source/drivers/firebird/Users.cxx
@@ -47,7 +47,7 @@ void Users::impl_refresh()
ObjectType Users::createObject(const OUString& rName)
{
- return new User(rName);
+ return new User(m_xMetaData->getConnection(), rName);
}
uno::Reference< XPropertySet > Users::createDescriptor()
@@ -55,7 +55,7 @@ uno::Reference< XPropertySet > Users::createDescriptor()
// There is some internal magic so that the same class can be used as either
// a descriptor or as a normal user. See VUser.cxx for the details. In our
// case we just need to ensure we use the correct constructor.
- return new User;
+ return new User(m_xMetaData->getConnection());
}
//----- XAppend ---------------------------------------------------------------
diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx
index 56670cef1aa5..89baa0799202 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.cxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.cxx
@@ -131,7 +131,7 @@ static LogLevel readLogLevelFromConfiguration()
OUString fileName;
osl_getModuleURLFromFunctionAddress(
reinterpret_cast<oslGenericFunction>(readLogLevelFromConfiguration), &fileName.pData );
- fileName = fileName.copy( fileName.lastIndexOf( '/' )+1 ) +
+ fileName = fileName.copy( 0, fileName.lastIndexOf( '/' )+1 ) +
#ifdef MACOSX
"../Resources/"
#endif