[PUSHED] Re: [PATCH] [REVIEW:3-5] fdo#45249 cannot use aggregate functions in with PostgreSQL

Radek Doulik rodo at novell.com
Mon Feb 13 07:36:36 PST 2012


Hi,

looks OK to me. Pushed. Thanks.

Cheers
Radek

On Thu, 2012-02-09 at 18:44 +0100, Lionel Elie Mamane wrote:
> With a PostgreSQL-SDBC database, Base query design does not allow the
> user to use groupings and aggregate functions.
> 
> Change PostgreSQL-SDBC so that it declares to support Core SQL.
> 
> Please apply to libreoffice-3-5
> 
> See dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
> 
> OSelectionBrowseBox::initialize
> 
>         if ( lcl_SupportsCoreSQLGrammar(xConnection) )
>         {
>             xub_StrLen nCount   = m_aFunctionStrings.GetTokenCount();
>             for (xub_StrLen nIdx = 0; nIdx < nCount; nIdx++)
>                 m_pFunctionCell->InsertEntry(m_aFunctionStrings.GetToken(nIdx));
>         }
> 
> where m_aFunctionStrings has been prepopulated by:
> 
>         IParseContext::InternationalKeyCode eFunctions[] = { IParseContext::KEY_AVG,IParseContext::KEY_COUNT,IParseContext::KEY_MAX
>             ,IParseContext::KEY_MIN,IParseContext::KEY_SUM
>             ,IParseContext::KEY_EVERY
>             ,IParseContext::KEY_ANY
>             ,IParseContext::KEY_SOME
>             ,IParseContext::KEY_STDDEV_POP
>             ,IParseContext::KEY_STDDEV_SAMP
>             ,IParseContext::KEY_VAR_SAMP
>             ,IParseContext::KEY_VAR_POP
>             ,IParseContext::KEY_COLLECT
>             ,IParseContext::KEY_FUSION
>             ,IParseContext::KEY_INTERSECTION
>         };
> 
>        for (size_t i = 0; i < SAL_N_ELEMENTS(eFunctions); ++i)
>         {
>             m_aFunctionStrings += String(RTL_CONSTASCII_USTRINGPARAM(";"));
>             m_aFunctionStrings += String(ByteString(rContext.getIntlKeywordAscii(eFunctions[i])),RTL_TEXTENCODING_UTF8);
> 
>         }
> 
> and also
> 
> OSelectionBrowseBox::setFunctionCell:
> 
>     if ( xConnection.is() )
>     {
>         // Diese Funktionen stehen nur unter CORE zur Verf�gung
>         }
>         else
>         {
>             // nur COUNT(*) erlaubt
>     }
> 
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice




More information about the LibreOffice mailing list