summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-14 19:22:47 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-14 20:27:33 +0000
commitfffb674c1e5352048caeae325ecdc6428cb210bc (patch)
tree52e4a6988549c8168acac2ee7ae8a86d449dae89 /connectivity
parent2b407adc78c97863223653cb24e7a7226ae1e6cf (diff)
coverity#1371289 avoid the need for an assignment
Change-Id: I7f9b8d21652c79642f9a2f916ad0609c8abd430b
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/postgresql/pq_statement.cxx2
-rw-r--r--connectivity/source/drivers/postgresql/pq_xcolumns.cxx6
-rw-r--r--connectivity/source/drivers/postgresql/pq_xtables.cxx4
3 files changed, 6 insertions, 6 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx
index 55715b0504b1..805c7b9f963d 100644
--- a/connectivity/source/drivers/postgresql/pq_statement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_statement.cxx
@@ -797,7 +797,7 @@ Reference< XResultSet > getGeneratedValuesFromLastInsert(
{
// it even was no autovalue, no sense to continue as we can't query the
// inserted row
- buf.setLength(0);
+ buf.truncate();
break;
}
}
diff --git a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
index cfb4bc5af733..36f3a4f8744c 100644
--- a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
@@ -404,7 +404,7 @@ void alterColumnByDescriptor(
OUString pastDefaultValue = extractStringProperty( past, st.DEFAULT_VALUE );
if( futureDefaultValue != pastDefaultValue )
{
- buf = OUStringBuffer( 128 );
+ buf.truncate();
buf.append( "ALTER TABLE" );
bufferQuoteQualifiedIdentifier( buf, schemaName, tableName, settings );
buf.append( "ALTER COLUMN" );
@@ -422,7 +422,7 @@ void alterColumnByDescriptor(
sal_Int32 pastNullable = extractIntProperty( past, st.IS_NULLABLE );
if( futureNullable != pastNullable )
{
- buf = OUStringBuffer( 128 );
+ buf.truncate();
buf.append( "ALTER TABLE" );
bufferQuoteQualifiedIdentifier( buf, schemaName, tableName, settings );
buf.append( "ALTER COLUMN" );
@@ -449,7 +449,7 @@ void alterColumnByDescriptor(
if( futureComment != pastComment )
{
- buf = OUStringBuffer( 128 );
+ buf.truncate();
buf.append( "COMMENT ON COLUMN" );
bufferQuoteQualifiedIdentifier( buf, schemaName, tableName , futureColumnName, settings );
buf.append( "IS " );
diff --git a/connectivity/source/drivers/postgresql/pq_xtables.cxx b/connectivity/source/drivers/postgresql/pq_xtables.cxx
index 63e6c6aeebf9..cbd5c3f2b695 100644
--- a/connectivity/source/drivers/postgresql/pq_xtables.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xtables.cxx
@@ -270,7 +270,7 @@ void Tables::appendByDescriptor(
OUString description = extractStringProperty( descriptor, st.DESCRIPTION );
if( !description.isEmpty() )
{
- buf = OUStringBuffer( 128 );
+ buf.truncate();
buf.append( "COMMENT ON TABLE" );
bufferQuoteQualifiedIdentifier( buf, schema, name, m_pSettings );
buf.append( "IS " );
@@ -292,7 +292,7 @@ void Tables::appendByDescriptor(
description = extractStringProperty( column,st.DESCRIPTION );
if( !description.isEmpty() )
{
- buf = OUStringBuffer( 128 );
+ buf.truncate();
buf.append( "COMMENT ON COLUMN " );
bufferQuoteQualifiedIdentifier(
buf, schema, name, extractStringProperty( column, st.NAME ), m_pSettings );