Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hello,

Here is a patch for the mentioned bug, actually the problem mentioned in
the bug info was just the minority, wizard didn't work for all the
queries where I wanted to sort by an aggregate field. I did several
tries,and it seems to be ok now, however without "group by" in an
aggregate query it seems to be silly to sort by anything, I must notice
Oracle even handles it as an error, it seems that for HSQL it's not a
problem. Please review the patch and push it to git.

Thanks,

Gabor
From 3210fcf363e242ecca3bfca686ef9b8ac91305ee Mon Sep 17 00:00:00 2001
From: Gabor Jenei <jengab@elte.hu>
Date: Fri, 12 Aug 2011 10:15:24 +0200
Subject: [PATCH] Bug 38486 SQL fix

---
 .../com/sun/star/wizards/db/SQLQueryComposer.java  |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java 
b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java
index a6d2c2b..3f595f2 100644
--- a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java
+++ b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java
@@ -205,7 +205,7 @@ public class SQLQueryComposer
                 {
                     sOrder += ", ";
                 }
-                sOrder += CurDBMetaData.AggregateFieldNames[iAggregate][1] + "(" + 
CurDBMetaData.AggregateFieldNames[iAggregate][0] + ")";
+                sOrder += CurDBMetaData.AggregateFieldNames[iAggregate][1] + "(" + 
getComposedAliasFieldName(CurDBMetaData.AggregateFieldNames[iAggregate][0]) + ")";
                 sOrder += " " + CurDBMetaData.getSortFieldNames()[i][1];
                 m_queryComposer.setOrder(sOrder);
             }
-- 
1.7.2.5


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.