db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel John Debrunner (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2350) Use of XML values in the action statement of a trigger throw exceptions.
Date Sun, 15 Jul 2007 17:28:04 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512810

Daniel John Debrunner commented on DERBY-2350:

The issue might be that the patch only addresses (I think) row level triggers, but the test
uses statement level and row level triggers.
That would lead to the error seen, as only a statement trigger will end up calling the setValueFromResultSet

Bryan wrote:
> What about "sniffing" the first few bytes of the string? To be a valid document,
> it should either start with <?xml , possibly preceded by a bytemark, or < and a

> Not a perfect test by any means, but vastly less expensive than cranking up the XML parser.

I might be missing something here, but how does this help? Are you saying that would be the
only test?
As you point out it's not sufficient, so we would need to use the parser anyway. It seems
it would only help kick out
invalid values earlier, which is not really a case we want to optimize for.

> Use of XML values in the action statement of a trigger throw exceptions.
> ------------------------------------------------------------------------
>                 Key: DERBY-2350
>                 URL: https://issues.apache.org/jira/browse/DERBY-2350
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions:
>            Reporter: Daniel John Debrunner
>         Attachments: d2350_v2.patch, derby-2350.diff
> A  trigger like, where V, V1 and V2 are columns of type XML will thrown an exception
when fired.
>                 REFERENCING NEW_TABLE AS N
>                 FOR EACH STATEMENT  
>                 INSERT INTO T_ACTION_STATEMENT(A, V1, ID, V2) 
>                 SELECT 'I', V, ID, V FROM N
> ERROR 38000: The exception 'java.sql.SQLException: An attempt was made to get a data
value of type 'java.lang.Object' from a data value of type 'XML'.' was thrown while evaluating
an expression.
> Most likely because triggers are implementing using VTIs and hence JDBC ResultSets and
XML is not supported through JDBC yet.
> TriggerTest shows this issue, see the comment with the bug number to reproduce.

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

View raw message