diff options
Diffstat (limited to 'connectivity/source/drivers/mysqlc/mysqlc_connection.cxx')
-rw-r--r-- | connectivity/source/drivers/mysqlc/mysqlc_connection.cxx | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx b/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx index 1c654c3e24ed..269113383d8d 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx @@ -29,25 +29,17 @@ #include <com/sun/star/beans/NamedValue.hpp> -#include <comphelper/processfactory.hxx> #include <comphelper/servicehelper.hxx> -#include <comphelper/storagehelper.hxx> - -#include <osl/diagnose.h> -#include <cppuhelper/supportsservice.hxx> using namespace connectivity::mysqlc; using namespace com::sun::star::uno; using namespace com::sun::star::container; -using namespace com::sun::star::lang; using namespace com::sun::star::beans; using namespace com::sun::star::sdbc; using namespace com::sun::star::sdbcx; using ::osl::MutexGuard; -#define MYSQLC_URI_PREFIX "sdbc:mysqlc:" - namespace { void lcl_executeUpdate(MYSQL* pMySql, const OString& sql) @@ -81,7 +73,7 @@ void OConnection::construct(const OUString& url, const Sequence<PropertyValue>& mysql_library_init(0, nullptr, nullptr); mysql_init(&m_mysql); - OString charset_name{ "utf8mb4" }; + OString charset_name{ "utf8mb4"_ostr }; mysql_options(&m_mysql, MYSQL_SET_CHARSET_NAME, charset_name.getStr()); sal_Int32 nIndex; @@ -95,7 +87,7 @@ void OConnection::construct(const OUString& url, const Sequence<PropertyValue>& // parse url. Url has the following format: // external server: sdbc:mysqlc:[hostname]:[port]/[dbname] - if (url.startsWith(MYSQLC_URI_PREFIX)) + if (url.startsWith("sdbc:mysqlc:")) { nIndex = 12; } @@ -200,9 +192,8 @@ void OConnection::construct(const OUString& url, const Sequence<PropertyValue>& *this, OUString(), 0, Any()); } - lcl_executeUpdate(&m_mysql, - OString{ "SET session sql_mode='ANSI_QUOTES,NO_AUTO_VALUE_ON_ZERO'" }); - lcl_executeUpdate(&m_mysql, OString{ "SET NAMES utf8mb4" }); + lcl_executeUpdate(&m_mysql, "SET session sql_mode='ANSI_QUOTES,NO_AUTO_VALUE_ON_ZERO'"_ostr); + lcl_executeUpdate(&m_mysql, "SET NAMES utf8mb4"_ostr); } OUString OConnection::getImplementationName() @@ -265,8 +256,6 @@ Reference<XPreparedStatement> SAL_CALL OConnection::prepareCall(const OUString& OUString SAL_CALL OConnection::nativeSQL(const OUString& /*_sSql*/) { - MutexGuard aGuard(m_aMutex); - // const OUString sSqlStatement = transFormPreparedStatement( _sSql ); // TODO return OUString(); @@ -473,7 +462,7 @@ OUString OConnection::transFormPreparedStatement(const OUString& _sSQL) try { Reference<XConnection> xCon = this; - Sequence<Any> aArgs{ Any(NamedValue("ActiveConnection", makeAny(xCon))) }; + Sequence<Any> aArgs{ Any(NamedValue("ActiveConnection", Any(xCon))) }; m_xParameterSubstitution.set( m_xDriver->getFactory()->createInstanceWithArguments( @@ -505,7 +494,7 @@ sal_Int64 SAL_CALL OConnection::getSomething(const css::uno::Sequence<sal_Int8>& } // static -Sequence<sal_Int8> OConnection::getUnoTunnelId() +const Sequence<sal_Int8>& OConnection::getUnoTunnelId() { static const comphelper::UnoIdInit implId; return implId.getSeq(); |