diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2015-01-28 18:24:40 +0100 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2015-01-28 18:29:30 +0100 |
commit | d613f6e00cbd315f21d49e58d18178f00bda83c5 (patch) | |
tree | b66bd6354fabce278b7f9b467ea82e9662af65af /dbaccess | |
parent | abb5e84c74b781f3615862695db4e5eaadc12cfe (diff) |
Query Design: use correct name for columns that come from another query.
Change-Id: I25b4ccdc2f50ba89687e1f4c871f286251a28e21
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/querydesign/QueryDesignView.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index be2840818d70..8acc4115413f 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -3079,10 +3079,23 @@ OSQLParseNode* OQueryDesignView::getPredicateTreeFromEntry(OTableFieldDescRef pE } OUString sTest(_sCriteria); + // _rxColumn, if it is a "lookup" column, not a computed column, + // is guaranteed to be the column taken from the *source* of the column, + // that is either a table or another query. + // _rxColumn is *not* taken from the columns of the query we are constructing + // (and rightfully so, since it may not be part of these columns; SELECT A FROM t WHERE B = foo) + // If it is a computed column, we just constructed it above, with same Name and RealName. + // In all cases, we should use the "external" name of the column, not the "RealName"; + // the latter is the name that the column had in the source of the source query. + // An example: we are designing "SELECT A, B FROM q WHERE C='foo'" + // q itself is query "SELECT aye AS A, bee as B, cee as C FROM t" + // We are currently treating the entry "C='foo'" + // Then _rxColumn has Name "C" and RealName "cee". We should *obviously* use "C", not "cee". OSQLParseNode* pParseNode = rParser.predicateTree( _rsErrorMessage, sTest, static_cast<OQueryController&>(getController()).getNumberFormatter(), - _rxColumn); + _rxColumn, + false); return pParseNode; } |