Kaydet (Commit) 86ef5f6f authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

remove impossible case

nCount == 5 is impossible; the grammar has changed since this code was written.
It used to refer to case '(' joined_table ')' range_variable op_column_commalist
which has become just '(' joined_table ')'
which thus has (by definition) no table range (alias).

Case changed in mega-(merge-)commit:

commit c41efc6d
Author: Jens-Heiner Rechtien <hr@openoffice.org>
Date:   Wed Nov 19 17:43:08 2008 +0000

    CWS-TOOLING: integrate CWS dba301a_DEV300

which seems to have done the other necessary adaptations to this code
and elsewhere.

Change-Id: I96ddbefbf34d6c155435b78aa9e5037a760232ed
üst d42b1afc
...@@ -2695,7 +2695,7 @@ OUString OSQLParseNode::getTableRange(const OSQLParseNode* _pTableRef) ...@@ -2695,7 +2695,7 @@ OUString OSQLParseNode::getTableRange(const OSQLParseNode* _pTableRef)
OSL_ENSURE(_pTableRef && _pTableRef->count() > 1 && _pTableRef->getKnownRuleID() == OSQLParseNode::table_ref,"Invalid node give, only table ref is allowed!"); OSL_ENSURE(_pTableRef && _pTableRef->count() > 1 && _pTableRef->getKnownRuleID() == OSQLParseNode::table_ref,"Invalid node give, only table ref is allowed!");
const sal_uInt32 nCount = _pTableRef->count(); const sal_uInt32 nCount = _pTableRef->count();
OUString sTableRange; OUString sTableRange;
if ( nCount == 2 || (nCount == 3 && !_pTableRef->getChild(0)->isToken()) || nCount == 5 ) if ( nCount == 2 || (nCount == 3 && !_pTableRef->getChild(0)->isToken()) )
{ {
const OSQLParseNode* pNode = _pTableRef->getChild(nCount - (nCount == 2 ? 1 : 2)); const OSQLParseNode* pNode = _pTableRef->getChild(nCount - (nCount == 2 ? 1 : 2));
OSL_ENSURE(pNode && (pNode->getKnownRuleID() == OSQLParseNode::table_primary_as_range_column OSL_ENSURE(pNode && (pNode->getKnownRuleID() == OSQLParseNode::table_primary_as_range_column
...@@ -2703,7 +2703,7 @@ OUString OSQLParseNode::getTableRange(const OSQLParseNode* _pTableRef) ...@@ -2703,7 +2703,7 @@ OUString OSQLParseNode::getTableRange(const OSQLParseNode* _pTableRef)
,"SQL grammar changed!"); ,"SQL grammar changed!");
if ( !pNode->isLeaf() ) if ( !pNode->isLeaf() )
sTableRange = pNode->getChild(1)->getTokenValue(); sTableRange = pNode->getChild(1)->getTokenValue();
} // if ( nCount == 2 || nCount == 3 || nCount == 5) } // if ( nCount == 2 || nCount == 3 )
return sTableRange; return sTableRange;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment