summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2011-10-22 11:26:20 +0200
committerJulien Nabet <serval2412@yahoo.fr>2011-10-22 11:26:20 +0200
commit48cdc0318b348c51742339b243dc05546148b335 (patch)
tree639db65a9e265cbc211e35206bd7b0a3af4674da /dbaccess
parent63354873b7e2fb9e51abee45082e415cd438d8b2 (diff)
Fix fdo#38286. Perhaps it could be simplified
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 8fc9e70e313b..44c250383c66 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -3213,7 +3213,18 @@ void OQueryDesignView::fillFunctionInfo( const ::connectivity::OSQLParseNode* p
OQueryController& rController = static_cast<OQueryController&>(getController());
sal_Int32 nDataType = DataType::DOUBLE;
::rtl::OUString sFieldName = sFunctionTerm;
- OSQLParseNode* pFunctionName = pNode->getChild(0);
+ const OSQLParseNode* pFunctionName;
+ // Fix fdo#38286 : crash when constant in the query
+ // TODO : is it possible to have a child or children in the pNode ?
+ // if not this part could be simplified
+ if (pNode->count())
+ {
+ pFunctionName = pNode->getChild(0);
+ }
+ else
+ {
+ pFunctionName = pNode;
+ }
if ( !SQL_ISPUNCTUATION(pFunctionName,"{") )
{
if ( SQL_ISRULEOR2(pNode,length_exp,char_value_fct) )