diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2011-08-05 15:58:37 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2011-11-17 21:15:20 +0100 |
commit | 7d3a6de0ed12c3b0165a49131a307594e8c22d8e (patch) | |
tree | a23d5875d5d18ae92a774724fb107b00de79ca8a /connectivity/source/drivers/postgresql/pq_statement.cxx | |
parent | c4fc6b22b3af76eb1ae1df8f2e739df46cc3e1a0 (diff) |
Janitorial clean-up
- fix a bunch of compiler warnings
- Copyright statement on files I modified
Diffstat (limited to 'connectivity/source/drivers/postgresql/pq_statement.cxx')
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_statement.cxx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx index 1d2bb896d00d..881c038bfad6 100644 --- a/connectivity/source/drivers/postgresql/pq_statement.cxx +++ b/connectivity/source/drivers/postgresql/pq_statement.cxx @@ -52,6 +52,7 @@ * The Initial Developer of the Original Code is: Joerg Budischewski * * Copyright: 2000 by Sun Microsystems, Inc. + * 2011 Lionel Elie Mamane <lionel@mamane.lu> * * All Rights Reserved. * @@ -190,9 +191,9 @@ Statement::Statement( const ::rtl::Reference< RefCountedMutex > & refMutex, struct ConnectionSettings *pSettings ) : OComponentHelper( refMutex->mutex ), OPropertySetHelper( OComponentHelper::rBHelper ), - m_refMutex( refMutex ), m_connection( conn ), m_pSettings( pSettings ), + m_refMutex( refMutex ), m_lastOidInserted( InvalidOid ) { m_props[STATEMENT_QUERY_TIME_OUT] = makeAny( (sal_Int32)0 ); @@ -746,6 +747,8 @@ static void getAutoValues( "WHERE pg_attribute.attrelid = pg_class.oid AND " "pg_class.relnamespace = pg_namespace.oid AND " "pg_namespace.nspname = ? AND " + // LEM TODO: this is weird; why "LIKE" and not "="? + // Most probably gives problems if tableName contains '%' "pg_class.relname LIKE ? AND " "pg_attrdef.adsrc != ''" ) ); @@ -807,7 +810,7 @@ Reference< XResultSet > getGeneratedValuesFromLastInsert( // buf.append( "," ); // } // buf.append( "]\n" ); -// printf( buf.makeStringAndClear() ); +// printf( "%s", buf.makeStringAndClear() ); // TODO: make also unqualified tables names work here. Have a look at 2.8.3. The Schema Search Path // in postgresql doc @@ -844,29 +847,29 @@ Reference< XResultSet > getGeneratedValuesFromLastInsert( getAutoValues( autoValues, connection, schemaName, tableName ); } // this could mean, that the column is a default or auto value, check this ... - String2StringMap::iterator ii = autoValues.begin(); - for( ; ii != autoValues.end() ; ++ii ) + String2StringMap::iterator j = autoValues.begin(); + for( ; j != autoValues.end() ; ++j ) { - if( columnName.equalsIgnoreAsciiCase( ii->first ) ) + if( columnName.equalsIgnoreAsciiCase( j->first ) ) { // it is indeed an auto value. - value = OStringToOUString(ii->second, RTL_TEXTENCODING_ASCII_US ); + value = OStringToOUString(j->second, RTL_TEXTENCODING_ASCII_US ); // check, whether it is a sequence if( rtl_str_shortenedCompare_WithLength( - ii->second.getStr(), ii->second.getLength(), + j->second.getStr(), j->second.getLength(), RTL_CONSTASCII_STRINGPARAM( "nextval(" ), 8 ) == 0 ) { // retrieve current sequence value: OUStringBuffer myBuf(128 ); myBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "SELECT currval(" ) ); - myBuf.appendAscii( &(ii->second.getStr()[8])); + myBuf.appendAscii( &(j->second.getStr()[8])); value = querySingleValue( connection, myBuf.makeStringAndClear() ); } break; } } - if( ii == autoValues.end() ) + if( j == autoValues.end() ) { // it even was no autovalue, no sense to continue as we can't query the // inserted row |