diff options
Diffstat (limited to 'connectivity')
21 files changed, 93 insertions, 130 deletions
diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx index 38e94f320e48..0895881d7ee3 100644 --- a/connectivity/source/commontools/DateConversion.cxx +++ b/connectivity/source/commontools/DateConversion.cxx @@ -125,9 +125,9 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, // check if this is really a timestamp or only a date if ( bOk ) { - aRet.append("{ts '"); - aRet.append(DBTypeConversion::toDateTimeString(aDateTime)); - aRet.append("'}"); + aRet.append("{ts '" + + DBTypeConversion::toDateTimeString(aDateTime) + + "'}"); break; } break; @@ -153,9 +153,9 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, else bOk = _rVal >>= aDate; OSL_ENSURE( bOk, "DBTypeConversion::toSQLString: _rVal is not date!"); - aRet.append("{d '"); - aRet.append(DBTypeConversion::toDateString(aDate)); - aRet.append("'}"); + aRet.append("{d '" + + DBTypeConversion::toDateString(aDate) + + "'}"); } break; case DataType::TIME: { @@ -178,9 +178,9 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, else bOk = _rVal >>= aTime; OSL_ENSURE( bOk,"DBTypeConversion::toSQLString: _rVal is not time!"); - aRet.append("{t '"); - aRet.append(DBTypeConversion::toTimeString(aTime)); - aRet.append("'}"); + aRet.append("{t '" + + DBTypeConversion::toTimeString(aTime) + + "'}"); } break; } } diff --git a/connectivity/source/commontools/TIndexes.cxx b/connectivity/source/commontools/TIndexes.cxx index b0998b5b3a79..2ba9124a51b5 100644 --- a/connectivity/source/commontools/TIndexes.cxx +++ b/connectivity/source/commontools/TIndexes.cxx @@ -152,10 +152,10 @@ sdbcx::ObjectType OIndexesHelper::appendObject( const OUString& _rForName, const OUString aComposedName = dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable, true, ::dbtools::EComposeRule::InIndexDefinitions); if (!_rForName.isEmpty() ) { - aSql.append( ::dbtools::quoteName( aQuote, _rForName ) ); - aSql.append(" ON "); - aSql.append(aComposedName); - aSql.append(" ( "); + aSql.append( ::dbtools::quoteName( aQuote, _rForName ) + + " ON " + + aComposedName + + " ( "); Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY); Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY); @@ -192,8 +192,8 @@ sdbcx::ObjectType OIndexesHelper::appendObject( const OUString& _rForName, const xColumns->getByIndex(0) >>= xColProp; - aSql.append("."); - aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))))); + aSql.append("." + + ::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))))); } Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( ); diff --git a/connectivity/source/commontools/TKeys.cxx b/connectivity/source/commontools/TKeys.cxx index 1a73a349b479..e6e50f20a45a 100644 --- a/connectivity/source/commontools/TKeys.cxx +++ b/connectivity/source/commontools/TKeys.cxx @@ -155,12 +155,11 @@ sdbcx::ObjectType OKeysHelper::appendObject( const OUString& _rForName, const Re { // if we're here, we belong to a table which is not new, i.e. already exists in the database. // In this case, really append the new index. - OUStringBuffer aSql; - aSql.append("ALTER TABLE "); + OUStringBuffer aSql("ALTER TABLE "); OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString( ); - aSql.append(composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable, ::dbtools::EComposeRule::InTableDefinitions, true )); - aSql.append(" ADD "); + aSql.append(composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable, ::dbtools::EComposeRule::InTableDefinitions, true ) + + " ADD "); if ( nKeyType == KeyType::PRIMARY ) { @@ -188,9 +187,9 @@ sdbcx::ObjectType OKeysHelper::appendObject( const OUString& _rForName, const Re if ( nKeyType == KeyType::FOREIGN ) { - aSql.append(" REFERENCES "); - aSql.append(::dbtools::quoteTableName(m_pTable->getConnection()->getMetaData(),sReferencedName,::dbtools::EComposeRule::InTableDefinitions)); - aSql.append(" ("); + aSql.append(" REFERENCES " + + ::dbtools::quoteTableName(m_pTable->getConnection()->getMetaData(),sReferencedName,::dbtools::EComposeRule::InTableDefinitions) + + " ("); for(sal_Int32 i=0;i<xColumns->getCount();++i) { @@ -200,9 +199,9 @@ sdbcx::ObjectType OKeysHelper::appendObject( const OUString& _rForName, const Re aSql.append(::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_RELATEDCOLUMN))))); } - aSql.append(")"); - aSql.append(getKeyRuleString(true ,nUpdateRule)); - aSql.append(getKeyRuleString(false ,nDeleteRule)); + aSql.append(")" + + getKeyRuleString(true ,nUpdateRule) + + getKeyRuleString(false ,nDeleteRule)); } Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( ); @@ -272,10 +271,9 @@ void OKeysHelper::dropObject(sal_Int32 _nPos, const OUString& _sElementName) } else { - OUStringBuffer aSql; - aSql.append("ALTER TABLE "); - - aSql.append( composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable,::dbtools::EComposeRule::InTableDefinitions, true )); + OUStringBuffer aSql( + "ALTER TABLE " + + composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable,::dbtools::EComposeRule::InTableDefinitions, true )); sal_Int32 nKeyType = KeyType::PRIMARY; if ( xKey.is() ) diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index efe44974d892..a446e3ced2f4 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -830,8 +830,9 @@ static OUString impl_doComposeTableName( const Reference< XDatabaseMetaData >& _ if ( !_rSchema.isEmpty() && aNameComps.bSchemas ) { - aComposedName.append( _bQuote ? quoteName( sQuoteString, _rSchema ) : _rSchema ); - aComposedName.append( "." ); + aComposedName.append( + (_bQuote ? quoteName( sQuoteString, _rSchema ) : _rSchema ) + + "." ); } aComposedName.append( _bQuote ? quoteName( sQuoteString, _rName ) : _rName ); diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx index 7d0ef100b259..2cee15cd7f6a 100644 --- a/connectivity/source/commontools/dbtools2.cxx +++ b/connectivity/source/commontools/dbtools2.cxx @@ -130,8 +130,7 @@ OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const sal_Int32 nParenPos = sTypeName.indexOf('('); if ( nParenPos == -1 ) { - aSql.append(sTypeName); - aSql.append("("); + aSql.append(sTypeName + "("); } else { @@ -161,10 +160,7 @@ OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const OUString aDefault = ::comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_DEFAULTVALUE))); if ( !aDefault.isEmpty() ) { - aSql.append(" DEFAULT "); - aSql.append(sPrefix); - aSql.append(aDefault); - aSql.append(sPostfix); + aSql.append(" DEFAULT " + sPrefix + aDefault + sPostfix); } // if ( aDefault.getLength() ) return aSql.makeStringAndClear(); @@ -188,17 +184,14 @@ OUString createStandardColumnPart(const Reference< XPropertySet >& xColProp,cons if ( xPropInfo.is() && xPropInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION)) ) xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION)) >>= sAutoIncrementValue; - aSql.append(" "); - - aSql.append(createStandardTypePart(xColProp, _xConnection, _sCreatePattern)); + aSql.append(" " + createStandardTypePart(xColProp, _xConnection, _sCreatePattern)); if(::comphelper::getINT32(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISNULLABLE))) == ColumnValue::NO_NULLS) aSql.append(" NOT NULL"); if ( bIsAutoIncrement && !sAutoIncrementValue.isEmpty()) { - aSql.append(" "); - aSql.append(sAutoIncrementValue); + aSql.append(" " + sAutoIncrementValue); } if ( _pHelper ) @@ -224,8 +217,7 @@ OUString createStandardCreateStatement(const Reference< XPropertySet >& descript if ( sComposedName.isEmpty() ) ::dbtools::throwFunctionSequenceException(_xConnection); - aSql.append(sComposedName); - aSql.append(" ("); + aSql.append(sComposedName + " ("); // columns Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY); @@ -241,8 +233,9 @@ OUString createStandardCreateStatement(const Reference< XPropertySet >& descript { if ( (xColumns->getByIndex(i) >>= xColProp) && xColProp.is() ) { - aSql.append(createStandardColumnPart(xColProp,_xConnection,_pHelper,_sCreatePattern)); - aSql.append(","); + aSql.append( + createStandardColumnPart(xColProp,_xConnection,_pHelper,_sCreatePattern) + + ","); } } return aSql.makeStringAndClear(); @@ -305,8 +298,7 @@ OUString createStandardKeyStatement(const Reference< XPropertySet >& descriptor, if(!xColumns.is() || !xColumns->getCount()) ::dbtools::throwFunctionSequenceException(_xConnection); - aSql.append(" PRIMARY KEY "); - aSql.append(generateColumnNames(xColumns,xMetaData)); + aSql.append(" PRIMARY KEY " + generateColumnNames(xColumns,xMetaData)); } else if(nKeyType == KeyType::UNIQUE) { @@ -315,8 +307,7 @@ OUString createStandardKeyStatement(const Reference< XPropertySet >& descriptor, if(!xColumns.is() || !xColumns->getCount()) ::dbtools::throwFunctionSequenceException(_xConnection); - aSql.append(" UNIQUE "); - aSql.append(generateColumnNames(xColumns,xMetaData)); + aSql.append(" UNIQUE " + generateColumnNames(xColumns,xMetaData)); } else if(nKeyType == KeyType::FOREIGN) { diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx index e2815fa11f79..990085c87fb4 100644 --- a/connectivity/source/commontools/parameters.cxx +++ b/connectivity/source/commontools/parameters.cxx @@ -393,9 +393,7 @@ namespace dbtools if ( !sAdditionalFilter.isEmpty() ) sAdditionalFilter.append(" AND "); - sAdditionalFilter.append("( "); - sAdditionalFilter.append(elem); - sAdditionalFilter.append(" )"); + sAdditionalFilter.append("( " + elem + " )"); } // now set this filter at the filter manager @@ -413,9 +411,7 @@ namespace dbtools if ( !sAdditionalHaving.isEmpty() ) sAdditionalHaving.append(" AND "); - sAdditionalHaving.append("( "); - sAdditionalHaving.append(elem); - sAdditionalHaving.append(" )"); + sAdditionalHaving.append("( " + elem + " )"); } // now set this having clause at the filter manager diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx index 179b8e19ceb4..62e54caa4468 100644 --- a/connectivity/source/drivers/firebird/Connection.cxx +++ b/connectivity/source/drivers/firebird/Connection.cxx @@ -628,22 +628,18 @@ void Connection::runBackupService(const short nAction) OString sFBKPath = OUStringToOString(m_sFBKPath, RTL_TEXTENCODING_UTF8); - OStringBuffer aRequest; // byte array - - - aRequest.append(static_cast<char>(nAction)); - - aRequest.append(char(isc_spb_dbname)); // .fdb sal_uInt16 nFDBLength = sFDBPath.getLength(); - aRequest.append(static_cast<char>(nFDBLength & 0xFF)); // least significant byte first - aRequest.append(static_cast<char>((nFDBLength >> 8) & 0xFF)); - aRequest.append(sFDBPath); - - aRequest.append(char(isc_spb_bkp_file)); // .fbk sal_uInt16 nFBKLength = sFBKPath.getLength(); - aRequest.append(static_cast<char>(nFBKLength & 0xFF)); - aRequest.append(static_cast<char>((nFBKLength >> 8) & 0xFF)); - aRequest.append(sFBKPath); + OStringBuffer aRequest( // byte array + OStringChar(static_cast<char>(nAction)) + + OStringChar(char(isc_spb_dbname)) // .fdb + + OStringChar(static_cast<char>(nFDBLength & 0xFF)) // least significant byte first + + OStringChar(static_cast<char>((nFDBLength >> 8) & 0xFF)) + + sFDBPath + + OStringChar(char(isc_spb_bkp_file)) // .fbk + + OStringChar(static_cast<char>(nFBKLength & 0xFF)) + + OStringChar(static_cast<char>((nFBKLength >> 8) & 0xFF)) + + sFBKPath); if (nAction == isc_action_svc_restore) { diff --git a/connectivity/source/drivers/firebird/Tables.cxx b/connectivity/source/drivers/firebird/Tables.cxx index 936e1465cb10..8b69044bef79 100644 --- a/connectivity/source/drivers/firebird/Tables.cxx +++ b/connectivity/source/drivers/firebird/Tables.cxx @@ -90,9 +90,8 @@ OUString Tables::createStandardColumnPart(const Reference< XPropertySet >& xColP if ( xPropInfo.is() && xPropInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION)) ) xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION)) >>= sAutoIncrementValue; - aSql.append(" "); - - aSql.append(dbtools::createStandardTypePart(xColProp, _xConnection)); + aSql.append(" " + + dbtools::createStandardTypePart(xColProp, _xConnection)); // Add character set for (VAR)BINARY (fix) types: // (VAR) BINARY is distinguished from other CHAR types by its character set. // Octets is a special character set for binary data. @@ -104,15 +103,13 @@ OUString Tables::createStandardColumnPart(const Reference< XPropertySet >& xColP >>= aType; if(aType == DataType::BINARY || aType == DataType::VARBINARY) { - aSql.append(" "); - aSql.append("CHARACTER SET OCTETS"); + aSql.append(" CHARACTER SET OCTETS"); } } if ( bIsAutoIncrement && !sAutoIncrementValue.isEmpty()) { - aSql.append(" "); - aSql.append(sAutoIncrementValue); + aSql.append(" " + sAutoIncrementValue); } // AutoIncrement "IDENTITY" is implicitly "NOT NULL" else if(::comphelper::getINT32(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISNULLABLE))) == ColumnValue::NO_NULLS) @@ -149,8 +146,8 @@ ObjectType Tables::appendObject(const OUString& rName, if ( sComposedName.isEmpty() ) ::dbtools::throwFunctionSequenceException(xConnection); - aSqlBuffer.append(sComposedName); - aSqlBuffer.append(" ("); + aSqlBuffer.append(sComposedName + + " ("); // columns Reference<XColumnsSupplier> xColumnSup(rDescriptor,UNO_QUERY); @@ -166,8 +163,8 @@ ObjectType Tables::appendObject(const OUString& rName, { if ( (xColumns->getByIndex(i) >>= xColProp) && xColProp.is() ) { - aSqlBuffer.append(createStandardColumnPart(xColProp,xConnection)); - aSqlBuffer.append(","); + aSqlBuffer.append(createStandardColumnPart(xColProp,xConnection) + + ","); } } OUString sSql = aSqlBuffer.makeStringAndClear(); diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx index 1fd1bd03e7a2..3cee5dab6e0b 100644 --- a/connectivity/source/drivers/firebird/Util.cxx +++ b/connectivity/source/drivers/firebird/Util.cxx @@ -44,8 +44,8 @@ OUString firebird::StatusVectorToString(const ISC_STATUS_ARRAY& rStatusVector, while(fb_interpret(msg, sizeof(msg), &pStatus)) { // TODO: verify encoding - buf.append("\n*"); - buf.append(OUString(msg, strlen(msg), RTL_TEXTENCODING_UTF8)); + buf.append("\n*" + + OUString(msg, strlen(msg), RTL_TEXTENCODING_UTF8)); } } catch (...) diff --git a/connectivity/source/drivers/hsqldb/HConnection.cxx b/connectivity/source/drivers/hsqldb/HConnection.cxx index bed9f6cdab2a..28feb95fce9b 100644 --- a/connectivity/source/drivers/hsqldb/HConnection.cxx +++ b/connectivity/source/drivers/hsqldb/HConnection.cxx @@ -281,8 +281,7 @@ namespace connectivity::hsqldb ::dbtools::qualifiedNameComponents( xMetaData, _rTableName, sCatalog, sSchema, sName, ::dbtools::EComposeRule::Complete ); // get the table information - OUStringBuffer sSQL; - sSQL.append( "SELECT HSQLDB_TYPE FROM INFORMATION_SCHEMA.SYSTEM_TABLES" ); + OUStringBuffer sSQL( "SELECT HSQLDB_TYPE FROM INFORMATION_SCHEMA.SYSTEM_TABLES" ); HTools::appendTableFilterCrit( sSQL, sCatalog, sSchema, sName, true ); sSQL.append( " AND TABLE_TYPE = 'TABLE'" ); diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx index 1d3f13e5718b..200d9f4bd3fe 100644 --- a/connectivity/source/drivers/hsqldb/HDriver.cxx +++ b/connectivity/source/drivers/hsqldb/HDriver.cxx @@ -864,8 +864,7 @@ namespace connectivity OSL_ENSURE( xStatement.is(), "ODriverDelegator::onConnectedNewDatabase: could not create a statement!" ); if ( xStatement.is() ) { - OUStringBuffer aStatement; - aStatement.append( "SET DATABASE COLLATION \"" ); + OUStringBuffer aStatement( "SET DATABASE COLLATION \"" ); aStatement.appendAscii( lcl_getCollationForLocale( lcl_getSystemLocale( m_xContext ) ) ); aStatement.append( "\"" ); diff --git a/connectivity/source/drivers/hsqldb/HView.cxx b/connectivity/source/drivers/hsqldb/HView.cxx index 60381ea6b0ad..83946ee86f86 100644 --- a/connectivity/source/drivers/hsqldb/HView.cxx +++ b/connectivity/source/drivers/hsqldb/HView.cxx @@ -146,8 +146,8 @@ namespace connectivity::hsqldb OUString HView::impl_getCommand() const { - OUStringBuffer aCommand; - aCommand.append( "SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.SYSTEM_VIEWS " ); + OUStringBuffer aCommand( + "SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.SYSTEM_VIEWS " ); HTools::appendTableFilterCrit( aCommand, m_CatalogName, m_SchemaName, m_Name, false ); ::utl::SharedUNOComponent< XStatement > xStatement; xStatement.set( m_xConnection->createStatement(), UNO_QUERY_THROW ); Reference< XResultSet > xResult( xStatement->executeQuery( aCommand.makeStringAndClear() ), css::uno::UNO_SET_THROW ); diff --git a/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx b/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx index 109ae2c1c8e2..43d277fe0097 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx @@ -812,20 +812,14 @@ Reference<XResultSet> SAL_CALL ODatabaseMetaData::getTables(const Any& /*catalog if (types.getLength() == 1) { - buffer.append("AND TABLE_TYPE LIKE '"); - buffer.append(types[0]); - buffer.append("'"); + buffer.append("AND TABLE_TYPE LIKE '" + types[0] + "'"); } else if (types.getLength() > 1) { - buffer.append("AND (TABLE_TYPE LIKE '"); - buffer.append(types[0]); - buffer.append("'"); + buffer.append("AND (TABLE_TYPE LIKE '" + types[0] + "'"); for (sal_Int32 i = 1; i < types.getLength(); ++i) { - buffer.append(" OR TABLE_TYPE LIKE '"); - buffer.append(types[i]); - buffer.append("'"); + buffer.append(" OR TABLE_TYPE LIKE '" + types[i] + "'"); } buffer.append(")"); } diff --git a/connectivity/source/drivers/odbc/OStatement.cxx b/connectivity/source/drivers/odbc/OStatement.cxx index da50e01f1a2b..3840e914d14b 100644 --- a/connectivity/source/drivers/odbc/OStatement.cxx +++ b/connectivity/source/drivers/odbc/OStatement.cxx @@ -477,8 +477,8 @@ Sequence< sal_Int32 > SAL_CALL OStatement::executeBatch( ) for (auto const& elem : m_aBatchVector) { - aBatchSql.append(OUStringToOString(elem,getOwnConnection()->getTextEncoding())); - aBatchSql.append(";"); + aBatchSql.append(OUStringToOString(elem,getOwnConnection()->getTextEncoding()) + + ";"); } OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx index 99f82a1c3957..1fbcb1aa69f5 100644 --- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx @@ -1406,8 +1406,7 @@ static void columnMetaData2DatabaseTypeDescription( oidMap[row->getInt(12)] = DatabaseTypeDescription(); if( domains ) queryBuf.append( " OR " ); - queryBuf.append( "oid = " ); - queryBuf.append( row->getInt(12 ) ); + queryBuf.append( "oid = " + OUString::number( row->getInt(12 ) ) ); domains ++; } } diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx index dd30a39317ec..4f3faaec419c 100644 --- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx +++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx @@ -263,10 +263,9 @@ void PreparedStatement::close( ) void PreparedStatement::raiseSQLException( const char * errorMsg ) { OUStringBuffer buf(128); - buf.append( "pq_driver: "); - buf.append( - OUString( errorMsg, strlen(errorMsg) , ConnectionSettings::encoding ) ); - buf.append( " (caused by statement '" ); + buf.append( "pq_driver: " + + OUString( errorMsg, strlen(errorMsg) , ConnectionSettings::encoding ) + + " (caused by statement '" ); buf.appendAscii( m_executedStatement.getStr() ); buf.append( "')" ); OUString error = buf.makeStringAndClear(); diff --git a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx index 0b12f3a73d77..26b11de27985 100644 --- a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx @@ -167,8 +167,7 @@ void ResultSetMetaData::checkForTypes() if( i > 0 ) buf.append( " OR " ); int oid = m_colDesc[i].typeOid; - buf.append( "oid=" ); - buf.append( static_cast<sal_Int32>(oid) ); + buf.append( "oid=" + OUString::number(static_cast<sal_Int32>(oid)) ); } Reference< XResultSet > rs = stmt->executeQuery( buf.makeStringAndClear() ); Reference< XRow > xRow( rs, UNO_QUERY ); diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx index 9622bfee6b7a..648faa69811b 100644 --- a/connectivity/source/drivers/postgresql/pq_statement.cxx +++ b/connectivity/source/drivers/postgresql/pq_statement.cxx @@ -253,10 +253,10 @@ static void raiseSQLException( buf.append( "]" ); } buf.append( - OUString( errorMsg, strlen(errorMsg) , ConnectionSettings::encoding ) ); - buf.append( " (caused by statement '" ); - buf.append( OStringToOUString( sql, ConnectionSettings::encoding ) ); - buf.append( "')" ); + OUString( errorMsg, strlen(errorMsg) , ConnectionSettings::encoding ) + + " (caused by statement '" + + OStringToOUString( sql, ConnectionSettings::encoding ) + + "')" ); OUString error = buf.makeStringAndClear(); SAL_WARN("connectivity.postgresql", error); throw SQLException( error, owner, OUString(), 1, Any() ); @@ -607,8 +607,7 @@ Reference< XResultSet > getGeneratedValuesFromLastInsert( bufferQuoteQualifiedIdentifier(buf, schemaName, tableName, pConnectionSettings ); else bufferQuoteIdentifier( buf, lastTableInserted, pConnectionSettings ); - buf.append( " WHERE oid = " ); - buf.append( nLastOid ); + buf.append( " WHERE oid = " + OUString::number(nLastOid) ); query = buf.makeStringAndClear(); } else if ( lastTableInserted.size() && lastQuery.getLength() ) @@ -700,8 +699,7 @@ Reference< XResultSet > getGeneratedValuesFromLastInsert( if( bAdditionalCondition ) buf.append( " AND " ); bufferQuoteIdentifier( buf, columnNameUnicode, pConnectionSettings ); - buf.append( " = " ); - buf.append( value ); + buf.append( " = " + value ); bAdditionalCondition = true; } query = buf.makeStringAndClear(); diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx index b9ff495a5105..222f57f528d2 100644 --- a/connectivity/source/drivers/postgresql/pq_tools.cxx +++ b/connectivity/source/drivers/postgresql/pq_tools.cxx @@ -943,19 +943,17 @@ OUString sqltype2string( const Reference< XPropertySet > & desc ) case css::sdbc::DataType::VARCHAR: case css::sdbc::DataType::CHAR: { - typeName.append( "(" ); - typeName.append( precision ); - typeName.append( ")" ); + typeName.append( "(" + OUString::number(precision) + ")" ); break; } case css::sdbc::DataType::DECIMAL: case css::sdbc::DataType::NUMERIC: { - typeName.append( "(" ); - typeName.append( precision ); - typeName.append( "," ); - typeName.append( extractIntProperty( desc, getStatics().SCALE ) ); - typeName.append( ")" ); + typeName.append( "(" + + OUString::number(precision) + + "," + + OUString::number(extractIntProperty( desc, getStatics().SCALE )) + + ")" ); break; } default: diff --git a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx index 5c1b23e82175..49eb65cd9fbf 100644 --- a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx +++ b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx @@ -296,8 +296,8 @@ void UpdateableResultSet::updateRow( ) buf.append( ", " ); columns ++; - buf.append( m_columnNames[i] ); - buf.append( " = " ); + buf.append( m_columnNames[i] + + " = " ); bufferQuoteAnyConstant( buf, m_updateableField[i].value, *m_ppSettings ); // OUString val; // m_updateableField[i].value >>= val; @@ -342,8 +342,8 @@ void UpdateableResultSet::deleteRow( ) OUStringBuffer buf( 128 ); buf.append( "DELETE FROM " ); bufferQuoteQualifiedIdentifier( buf, m_schema, m_table, *m_ppSettings ); - buf.append( " " ); - buf.append( buildWhereClause() ); + buf.append( " " + + buildWhereClause() ); stmt->executeUpdate( buf.makeStringAndClear() ); diff --git a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx index 0c0a80c44809..b72d569d2256 100644 --- a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx +++ b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx @@ -406,11 +406,10 @@ void alterColumnByDescriptor( bufferQuoteQualifiedIdentifier( buf, schemaName, tableName, settings ); buf.append( "ALTER COLUMN" ); bufferQuoteIdentifier( buf, futureColumnName, settings ); - buf.append( "SET DEFAULT " ); // LEM TODO: check out // default value is not quoted, caller needs to quote himself (otherwise // how to pass e.g. nextval('something' ) ???? - buf.append( futureDefaultValue ); + buf.append( "SET DEFAULT " + futureDefaultValue ); // bufferQuoteConstant( buf, defaultValue, encoding ); transaction.executeUpdate( buf.makeStringAndClear() ); } |