Description
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:
INSERT INTO Integer (str, ts, guid, _val) VALUES (?, ?, ?, ?)
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:
"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)
Obviously enough, it gets deserialized wrong because of the header byte and as a result, we get wrong key instance in the cache.
Attachments
Issue Links
- is related to
-
IGNITE-4046 C++: Support DML API
- Resolved
- links to