diff options
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/calc/CTable.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx | 44 | ||||
-rw-r--r-- | connectivity/source/drivers/odbc/OResultSet.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/drivers/writer/WTable.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/parse/PColumn.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/parse/sqliterator.cxx | 2 |
6 files changed, 40 insertions, 18 deletions
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx index 37920acc88ba..9aea3b9fa549 100644 --- a/connectivity/source/drivers/calc/CTable.cxx +++ b/connectivity/source/drivers/calc/CTable.cxx @@ -487,7 +487,7 @@ void OCalcTable::fillColumns() sal_Int32 nExprCnt = 0; while(aFind != m_aColumns->get().end()) { - (aAlias = aColumnName) += OUString::number(++nExprCnt); + aAlias = aColumnName + OUString::number(++nExprCnt); aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase); } diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx index 215b75577c25..e68a0290e893 100644 --- a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx +++ b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx @@ -1151,13 +1151,32 @@ void ODatabaseMetaDataResultSet::openForeignKeys( const Any& catalog, const OUSt if ( catalog2.hasValue() ) aFKQ = OUStringToOString(comphelper::getString(catalog2),m_nTextEncoding); - const char *pPKQ = catalog.hasValue() && !aPKQ.isEmpty() ? aPKQ.getStr() : nullptr, - *pPKO = schema && !schema->isEmpty() ? (aPKO = OUStringToOString(*schema,m_nTextEncoding)).getStr() : nullptr, - *pPKN = table ? (aPKN = OUStringToOString(*table,m_nTextEncoding)).getStr(): nullptr, - *pFKQ = catalog2.hasValue() && !aFKQ.isEmpty() ? aFKQ.getStr() : nullptr, - *pFKO = schema2 && !schema2->isEmpty() ? (aFKO = OUStringToOString(*schema2,m_nTextEncoding)).getStr() : nullptr, - *pFKN = table2 ? (aFKN = OUStringToOString(*table2,m_nTextEncoding)).getStr() : nullptr; - + const char *pPKQ = catalog.hasValue() && !aPKQ.isEmpty() ? aPKQ.getStr() : nullptr; + const char *pPKO = nullptr; + if (schema && !schema->isEmpty()) + { + aPKO = OUStringToOString(*schema,m_nTextEncoding); + pPKO = aPKO.getStr(); + } + const char *pPKN = nullptr; + if (table) + { + aPKN = OUStringToOString(*table,m_nTextEncoding); + pPKN = aPKN.getStr(); + } + const char *pFKQ = catalog2.hasValue() && !aFKQ.isEmpty() ? aFKQ.getStr() : nullptr; + const char *pFKO = nullptr; + if (schema2 && !schema2->isEmpty()) + { + aFKO = OUStringToOString(*schema2,m_nTextEncoding); + pFKO = aFKO.getStr(); + } + const char *pFKN = nullptr; + if (table2) + { + aFKN = OUStringToOString(*table2,m_nTextEncoding); + pFKN = aFKN.getStr(); + } SQLRETURN nRetcode = N3SQLForeignKeys(m_aStatementHandle, reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKQ)), (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0, @@ -1199,10 +1218,11 @@ void ODatabaseMetaDataResultSet::openPrimaryKeys(const Any& catalog, const OUStr if ( catalog.hasValue() ) aPKQ = OUStringToOString(comphelper::getString(catalog),m_nTextEncoding); aPKO = OUStringToOString(schema,m_nTextEncoding); + aPKN = OUStringToOString(table,m_nTextEncoding); const char *pPKQ = catalog.hasValue() && !aPKQ.isEmpty() ? aPKQ.getStr() : nullptr, *pPKO = pSchemaPat && !pSchemaPat->isEmpty() && !aPKO.isEmpty() ? aPKO.getStr() : nullptr, - *pPKN = (aPKN = OUStringToOString(table,m_nTextEncoding)).getStr(); + *pPKN = aPKN.getStr(); SQLRETURN nRetcode = N3SQLPrimaryKeys(m_aStatementHandle, @@ -1228,11 +1248,11 @@ void ODatabaseMetaDataResultSet::openTablePrivileges(const Any& catalog, const O if ( catalog.hasValue() ) aPKQ = OUStringToOString(comphelper::getString(catalog),m_nTextEncoding); aPKO = OUStringToOString(schemaPattern,m_nTextEncoding); + aPKN = OUStringToOString(tableNamePattern,m_nTextEncoding); const char *pPKQ = catalog.hasValue() && !aPKQ.isEmpty() ? aPKQ.getStr() : nullptr, *pPKO = pSchemaPat && !pSchemaPat->isEmpty() && !aPKO.isEmpty() ? aPKO.getStr() : nullptr, - *pPKN = (aPKN = OUStringToOString(tableNamePattern,m_nTextEncoding)).getStr(); - + *pPKN = aPKN.getStr(); SQLRETURN nRetcode = N3SQLTablePrivileges(m_aStatementHandle, reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKQ)), (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0, @@ -1257,11 +1277,11 @@ void ODatabaseMetaDataResultSet::openIndexInfo( const Any& catalog, const OUStri if ( catalog.hasValue() ) aPKQ = OUStringToOString(comphelper::getString(catalog),m_nTextEncoding); aPKO = OUStringToOString(schema,m_nTextEncoding); + aPKN = OUStringToOString(table,m_nTextEncoding); const char *pPKQ = catalog.hasValue() && !aPKQ.isEmpty() ? aPKQ.getStr() : nullptr, *pPKO = pSchemaPat && !pSchemaPat->isEmpty() && !aPKO.isEmpty() ? aPKO.getStr() : nullptr, - *pPKN = (aPKN = OUStringToOString(table,m_nTextEncoding)).getStr(); - + *pPKN = aPKN.getStr(); SQLRETURN nRetcode = N3SQLStatistics(m_aStatementHandle, reinterpret_cast<SDB_ODBC_CHAR *>(const_cast<char *>(pPKQ)), (catalog.hasValue() && !aPKQ.isEmpty()) ? SQL_NTS : 0, diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx index 0f77f92c3a00..4c5de705124b 100644 --- a/connectivity/source/drivers/odbc/OResultSet.cxx +++ b/connectivity/source/drivers/odbc/OResultSet.cxx @@ -915,14 +915,16 @@ void SAL_CALL OResultSet::updateRow( ) &nRealLen ); OTools::ThrowException(m_pStatement->getOwnConnection(),nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this); - fillNeededData(nRet = N3SQLBulkOperations(m_aStatementHandle, SQL_UPDATE_BY_BOOKMARK)); + nRet = N3SQLBulkOperations(m_aStatementHandle, SQL_UPDATE_BY_BOOKMARK); + fillNeededData(nRet); // the driver should not have touched this // (neither the contents of aBookmark FWIW) assert(nRealLen == aBookmark.getLength()); } else { - fillNeededData(nRet = N3SQLSetPos(m_aStatementHandle,1,SQL_UPDATE,SQL_LOCK_NO_CHANGE)); + nRet = N3SQLSetPos(m_aStatementHandle,1,SQL_UPDATE,SQL_LOCK_NO_CHANGE); + fillNeededData(nRet); } OTools::ThrowException(m_pStatement->getOwnConnection(),nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this); // unbind all columns so we can fetch all columns again with SQLGetData diff --git a/connectivity/source/drivers/writer/WTable.cxx b/connectivity/source/drivers/writer/WTable.cxx index cad61b502730..91842be9e88d 100644 --- a/connectivity/source/drivers/writer/WTable.cxx +++ b/connectivity/source/drivers/writer/WTable.cxx @@ -164,7 +164,7 @@ void OWriterTable::fillColumns() sal_Int32 nExprCnt = 0; while (aFind != m_aColumns->get().end()) { - (aAlias = aColumnName) += OUString::number(++nExprCnt); + aAlias = aColumnName + OUString::number(++nExprCnt); aFind = connectivity::find(m_aColumns->get().begin(), m_aColumns->get().end(), aAlias, aCase); } diff --git a/connectivity/source/parse/PColumn.cxx b/connectivity/source/parse/PColumn.cxx index db3f12d11eec..0e08f785ab26 100644 --- a/connectivity/source/parse/PColumn.cxx +++ b/connectivity/source/parse/PColumn.cxx @@ -136,7 +136,7 @@ OParseColumn* OParseColumn::createColumnForResultSet( const Reference< XResultSe sal_Int32 searchIndex=1; while(_rColumns.find(sAlias) != _rColumns.end()) { - (sAlias = sLabel) += OUString::number(searchIndex++); + sAlias = sLabel + OUString::number(searchIndex++); } sLabel = sAlias; } diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index 0f7170143cad..872750c3cc80 100644 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -1737,7 +1737,7 @@ OUString OSQLParseTreeIterator::getUniqueColumnName(const OUString & rColumnName sal_Int32 i=1; while(aIter != m_aSelectColumns->get().end()) { - (aAlias = rColumnName) += OUString::number(i++); + aAlias = rColumnName + OUString::number(i++); aIter = find( m_aSelectColumns->get().begin(), m_aSelectColumns->get().end(), |