https://bugs.freedesktop.org/show_bug.cgi?id=46841

--- Comment #3 from Lionel Elie Mamane <[email protected]> 2012-05-30 03:33:33 
PDT ---
>From what I remember from the top of my head, the whole SQL code is regenerated
from its abstract "design view"; not only are carriage returns removed, but the
whole code is canonicalised: column names are escaped (within double quotes),
order of clauses is fixed, a single fixed choice is made among syntactical
variants of SQL, etc.

I see two different reasonable ways to handle this:

 - If one just switches to design view and back to SQL view, not having done
ANY CHANGE in the design view, do not regenerate the SQL code, just take the
exact string as it is.

OR/AND

 - when generating SQL code from design view abstraction, put newlines at
reasonable places; for example between clauses, like that:

   SELECT "t"."foo", "t"."bar", "t"."baz", "t"."qux"
   FROM table AS t
   WHERE condition1
   GROUP BY "t"."foo"
   HAVING condition2

   In this solution, there are still details to be filled in, such as whether
and where to put newlines within clauses: e.g. mutliple joins in FROM clause,
long WHERE clause (put newlines at "high" points of the boolean expression,
respecting the structure of the formula), ...

   E.g. in "WHERE (long1 OR long2) AND long3", but a newline before/after the
AND as in:

   WHERE (long1 OR long2) 
               AND long3

  but avoid

   WHERE (long1 OR
               long2) AND long3

   Also OK:

   WHERE (long1 OR
                long2)
              AND long3

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to