You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vladimir Ozerov (JIRA)" <ji...@apache.org> on 2017/02/08 11:43:41 UTC

[jira] [Updated] (IGNITE-4409) UUID fields of the key class deserialized in a wrong way on INSERT.

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

Vladimir Ozerov updated IGNITE-4409:
------------------------------------
    Fix Version/s:     (was: 2.0)
                   1.9

> UUID fields of the key class deserialized in a wrong way on INSERT.
> -------------------------------------------------------------------
>
>                 Key: IGNITE-4409
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4409
>             Project: Ignite
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.8
>            Reporter: Igor Sapego
>             Fix For: 1.9
>
>
> Consider the following case. There is a class which is used as Key on C++ side. It contains 3 fields: String, Timestamp and UUID. There is also a value of the type Integer. Record of the cache is being inserted with {{SqlFieldsQuery}}:
> {noformat}
> INSERT INTO Integer (str, ts, guid, _val) VALUES (?, ?, ?, ?)
> {noformat}
> String, Timestamp and Integer values serialized and desirialized just fine, but UUID value is passed further just like byte array of 17 bytes, first of which is 10 (UUID type header in  Binary format), so later it gets converted here:
> {noformat}
> "main@1" prio=5 tid=0x1 nid=NA runnable
>   java.lang.Thread.State: RUNNABLE
>       at org.h2.value.ValueUuid.get(ValueUuid.java:68)
>       at org.h2.value.Value.convertTo(Value.java:861)
>       at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.convert(DmlStatementsProcessor.java:637)
>       at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.rowToKeyValue(DmlStatementsProcessor.java:868)
>       at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.doInsert(DmlStatementsProcessor.java:745)
>       at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.executeUpdateStatement(DmlStatementsProcessor.java:286)
>       at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.updateSqlFields(DmlStatementsProcessor.java:159)
>       at org.apache.ignite.internal.processors.query.h2.DmlStatementsProcessor.updateSqlFieldsTwoStep(DmlStatementsProcessor.java:189)
>       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:1777)
>       at org.apache.ignite.internal.processors.query.GridQueryProcessor.queryTwoStep(GridQueryProcessor.java:810)
>       at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:749)
>       at org.apache.ignite.internal.processors.platform.cache.PlatformCache.runFieldsQuery(PlatformCache.java:1205)
>       at org.apache.ignite.internal.processors.platform.cache.PlatformCache.processInStreamOutObject(PlatformCache.java:837)
>       at org.apache.ignite.internal.processors.platform.PlatformAbstractTarget.inStreamOutObject(PlatformAbstractTarget.java:90)
> {noformat}
> Obviously enough, it gets deserialized wrong because of the header byte and as a result, we get wrong key instance in the cache.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)