[Libreoffice] [PATCH] new BUG 36594

Eike Rathke ooo at erack.de
Fri Sep 2 01:09:10 PDT 2011


Hi Jenei,

On Thursday, 2011-09-01 22:08:33 +0200, Jenei Gábor wrote:

> LibreOffice Base if you turn on running SQL query in SQL edit view
> it will pass the SQL query directly to HSQL without any type of
> modification, or check, so if you push this button it should work
> totally as a HSQL prompt.

Played a bit with those, while delComment() in parseTree() seems to
work, the getComment()/concatComment() in translateStatement() does not
because

            sTranslatedStmt = m_xComposer->getComposedQuery();

never includes LFs in its normalized return, so the following

            sTranslatedStmt = concatComment( sTranslatedStmt, sComments);

doesnt do anything. This may be what you experienced earlier as well
when you wondered that something was eating the LFs. With the positional
approach not searching for LFs it may have worked accidentally if
original query and composed query were identical except one trailing
comment.

Without messing with the parser itself (and even then we wouldn't know
if following stages would handle the result) I don't see a clean way to
solve this, so I suggest to keep delComment() in parseTree() and discard
getComment()/concatComment(), unfortunately that will lose comments at
some (unimportant?) stage, but the query form seems to remember the
original query at least.

If no objection, I'll commit this evening.

  Eike

-- 
 PGP/OpenPGP/GnuPG encrypted mail preferred in all private communication.
 Key ID: 0x293C05FD - 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110902/bd53040f/attachment.pgp>


More information about the LibreOffice mailing list