db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4903) Plan exporter tool produces broken output if query contains less-than operator
Date Wed, 24 Nov 2010 17:41:14 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12935413#action_12935413

Knut Anders Hatlen commented on DERBY-4903:

> 1) A way to add a pointer to the XSL style sheet

I think the org.w3c.dom.Document.createProcessingInstruction() method
could do that. The following code fragment seems to create a pointer
to the style sheet for me, and it automatically escapes the '<', '>'
and '&' characters in the query text:

        Document doc =

                        "type=\"text/xsl\" href=\"...\""));

        Element plan = doc.createElement("plan");

        Element statement = doc.createElement("statement");
        statement.setTextContent("SELECT * FROM T WHERE X <> 'a & b'");

        Element time = doc.createElement("time");
        time.setTextContent("2010-11-24 18:27:14.466");

        Source source = new DOMSource(doc);
        Result result = new StreamResult(System.out);

        Transformer trans = TransformerFactory.newInstance().newTransformer();
        trans.transform(source, result);

> 2) Difficulty of finding all classes needed, in all JREs. 

That's what I thought too, and that's why I was surprised to see that
the generation of HTML files used those classes. But since the tool
now appears to depend on these classes being available, wouldn't it
make sense to use them for generating the XML too?

> Plan exporter tool produces broken output if query contains less-than operator
> ------------------------------------------------------------------------------
>                 Key: DERBY-4903
>                 URL: https://issues.apache.org/jira/browse/DERBY-4903
>             Project: Derby
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions:
>            Reporter: Knut Anders Hatlen
>            Assignee: C.S. Nirmal J. Fernando
>         Attachments: derby-4903-a.diff
> The plan exporter tool fails to produce well-formed output for the following query:
> ij> select * from sysibm.sysdummy1 where ibmreqd < 'Z';
> The generation of XML doesn't fail, but when I open the file in Firefox, I see this message:
> XML Parsing Error: not well-formed
> Location: file:///tmp/plan.xml
> Line Number 9, Column 11:
> Operator: <
> ----------^
> HTML generation prints the following error, and produces an empty file:
> ERROR:  'The value of attribute "scan_qualifiers" associated with an element type "null"
must not contain the '<' character.'

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message