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

             Bug #: 42713
           Summary: query design view loses SQL comments
    Classification: Unclassified
           Product: LibreOffice
           Version: LibO 3.4.3 release
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: medium
         Component: Database
        AssignedTo: [email protected]
        ReportedBy: [email protected]


SQL comments are lost when going through design view and back.

There would be two ways to fix that:

1) Don't throw comments away to form the SQL parse tree, but introduce a
"comment" node. This is robust against changes to the SQL, but can introduce
all kinds of bugs in code that does not expect a "comment" node.

2) In general, don't touch parts of the SQL string that are not modified. That
is, each SQL parse tree node is decorated with the string that it was parsed
from, and the parse tree -> string transformation function uses these to
regenerate the original string; a new node (that was added directly, not from
parsing a string) would not have this annotation and the parse tree -> string
transformation would then fallback to generating a fresh string. This would at
least not loose comments that are not just before (or after, dependending on
whether the comment is grouped with the node before or after it) a modified
node.

   If we take this route, we will probably need to fork the parse tree ->
string function into two variants:
   1) with the current behaviour;
   2) with the behaviour above.
   Number 1 would be used for generating SQL to be sent to the DB engine, and
number 2 for SQL to show the user and/or being stored.

   It would also be nice to have a UI way to manually force a string -> parse
tree -> string round-trip with the last step being done by number 1, if the
user wishes so. Call it e.g. "canonicalise SQL". For this use, it would be nice
for number 1 to *not* strip off comments, while for sending to DB, comments
stripped off is good. So make it a boolean option in that function.

-- 
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