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

Mike Matrigali resolved DERBY-2350.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 10.3.1.4

fixed in trunk and 10.3 branch.

Fix XML in triggers by changing code generation to generate different code
in the case of XML of the form when referencing old and new column values.:
XMLPARSE(DOCUMENT
CAST (org.apache.derby.iapi.db.Factory::
getTriggerExecutionContext().getNewRow().
getString(<colPosition>) AS CLOB)
PRESERVE WHITESPACE)

Also change XML.setValueFromResult() to validate the character stream and
set the xType as appropriate after parsing the stream.

> 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: 10.3.0.0
>            Reporter: Daniel John Debrunner
>            Assignee: Mike Matrigali
>             Fix For: 10.3.1.4
>
>         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.
> CREATE TRIGGER AIS AFTER INSERT ON T_MAIN 
>                 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.

Reply via email to