diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-10-13 17:35:11 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-10-13 17:40:33 +0200 |
commit | 7ea5ad6e46b92bc9020c6332b46b20671fa85c5b (patch) | |
tree | 2027c3e078465cdb4ca1da78adfb5992cce6a24f /dbaccess | |
parent | 2c5f5976b2afe22589244802e1f3b2e47811fdbe (diff) |
Assumed fix of a clang-analyzer-deadcode.DeadStores
...where the "bOk = false" from the leading "if" is always overwritten in the
following check of "bOk = sTableRange == _sUpdateTableName". The code had been
effectively like that ever since it got introduced with
4ae41a466ad659524809c23c9086df70c5456a39 "INTEGRATION: CWS dba30," but it looks
broken. I assume the two checks of "sTableRange == _sUpdateTableName" for
pNode->GetChild(0) and pNode->GetChild(2) shall only be done if the leading "if"
is not hit. (And one remaining uncertainty is if really only one of those
"sTableRange == _sUpdateTableName" checks needs to be true or if both should be
true for bOk to be true.)
Change-Id: I453690d65326ed67d7a074d4e4783a743a60d454
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/RowSetCache.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index bbc30b3fd5cb..0a713d830ceb 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -1551,13 +1551,16 @@ bool ORowSetCache::checkInnerJoin(const ::connectivity::OSQLParseNode *pNode,con { bOk = false; } - OUString sColumnName,sTableRange; - OSQLParseTreeIterator::getColumnRange( pNode->getChild(0), _xConnection, sColumnName, sTableRange ); - bOk = sTableRange == _sUpdateTableName; - if ( !bOk ) + else { - OSQLParseTreeIterator::getColumnRange( pNode->getChild(2), _xConnection, sColumnName, sTableRange ); - bOk = sTableRange == _sUpdateTableName; + OUString sColumnName,sTableRange; + OSQLParseTreeIterator::getColumnRange( pNode->getChild(0), _xConnection, sColumnName, sTableRange ); + bOk = sTableRange == _sUpdateTableName; + if ( !bOk ) + { + OSQLParseTreeIterator::getColumnRange( pNode->getChild(2), _xConnection, sColumnName, sTableRange ); + bOk = sTableRange == _sUpdateTableName; + } } } return bOk; |