[ 
https://issues.apache.org/jira/browse/IGNITE-4312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15700432#comment-15700432
 ] 

Alexander Paschenko commented on IGNITE-4312:
---------------------------------------------

I am working on a (non hacking and adequate) workaround for this - the only 
thing to sacrifice will be a bit of performance (some otherwise unnecessary 
field values copying), but there's another problem: when I build new value from 
all old field values on SQL *UPDATE*, builder refuses to work with binary enum 
value retrieved from another binary object via {{field}} method call - it's 
simple to reproduce: if you add following simple code to example,

{code:java}
{ // Weird binary enum operations showcase
    BinaryObject bval = ig.binary().toBinary(val);

    Object enumVal = bval.field("enumCol"); // enumVal is BinaryEnumObjectImpl 
at this point

    BinaryObjectBuilder bldr = ig.binary().builder(bval.type().typeName());

    bldr.setField("enumCol", enumVal);

    bldr.build();
}
{code}

it fails as follows:

{code}
Exception in thread "main" class 
org.apache.ignite.binary.BinaryObjectException: Wrong value has been set 
[typeName=org.apache.ignite.testtools.model.AllTypes, fieldName=enumCol, 
fieldType=Enum, assignedValueType=Object]
        at 
org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl.checkMetadata(BinaryObjectBuilderImpl.java:408)
        at 
org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl.serializeTo(BinaryObjectBuilderImpl.java:320)
        at 
org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl.build(BinaryObjectBuilderImpl.java:186)
        at 
org.apache.ignite.examples.datagrid.ExtSqlExample.main(ExtSqlExample.java:199)
{code}

Probably we have to file another issue for this as this is not SQL/DML related 
as well. [~vozerov] what do you say?

> DML: update causes IgniteCheckedException: Invalid flag value: -2
> -----------------------------------------------------------------
>
>                 Key: IGNITE-4312
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4312
>             Project: Ignite
>          Issue Type: Bug
>          Components: general
>    Affects Versions: 1.8
>            Reporter: Sergey Kozlov
>            Assignee: Alexander Paschenko
>             Fix For: 1.8
>
>         Attachments: IGNITE-4312.zip
>
>
> {noformat}
> [15:58:04] Ignite node stopped OK [uptime=00:00:00:111]
> Exception in thread "main" javax.cache.CacheException: class 
> org.apache.ignite.IgniteException: Invalid flag value: -2
>       at 
> org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:761)
>       at 
> org.apache.ignite.examples.datagrid.ExtSqlExample.main(ExtSqlExample.java:201)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:606)
>       at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
> Caused by: class org.apache.ignite.IgniteException: Invalid flag value: -2
>       at 
> org.apache.ignite.internal.processors.query.GridQueryProcessor.queryTwoStep(GridQueryProcessor.java:817)
>       at 
> org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:749)
>       ... 6 more
> Caused by: class org.apache.ignite.IgniteCheckedException: Invalid flag 
> value: -2
>       at 
> org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:1788)
>       at 
> org.apache.ignite.internal.processors.query.GridQueryProcessor.queryTwoStep(GridQueryProcessor.java:810)
>       ... 7 more
> Caused by: class org.apache.ignite.binary.BinaryObjectException: Invalid flag 
> value: -2
>       at 
> org.apache.ignite.internal.binary.builder.BinaryBuilderReader.parseValue(BinaryBuilderReader.java:761)
>       at 
> org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl.serializeTo(BinaryObjectBuilderImpl.java:285)
>       at 
> org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl.build(BinaryObjectBuilderImpl.java:186)
>       at 
> org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.doUpdate(DmlStatementsProcessor.java:524)
>       at 
> org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.executeUpdateStatement(DmlStatementsProcessor.java:256)
>       at 
> org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.updateSqlFields(DmlStatementsProcessor.java:134)
>       at 
> org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.updateSqlFieldsTwoStep(DmlStatementsProcessor.java:160)
>       at 
> org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryTwoStep(IgniteH2Indexing.java:1266)
>       at 
> org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:812)
>       at 
> org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:810)
>       at 
> org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
>       at 
> org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:1765)
>       ... 8 more
> Process finished with exit code 1
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to