You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Semen Boikov (JIRA)" <ji...@apache.org> on 2016/08/17 12:26:20 UTC
[jira] [Comment Edited] (IGNITE-2208) Queries with object arguments
doesn't work wth BinaryMarshaller.
[ https://issues.apache.org/jira/browse/IGNITE-2208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15424414#comment-15424414 ]
Semen Boikov edited comment on IGNITE-2208 at 8/17/16 12:25 PM:
----------------------------------------------------------------
Reviewed, have some comments:
- for me 'binarizeArgs(final Object[] args)' does not look correct, it should just call cacheContext.toCacheObject
- also in GridH2ValueCacheObject.compareSecure there is special handling for enums, as I remember it was added to resolve the same issue, this code should be removed as part of this fix:
{noformat}
if (o1 instanceof BinaryEnumObjectImpl && o2 instanceof Enum) {
final BinaryEnumObjectImpl bo1 = (BinaryEnumObjectImpl)o1;
if (bo1.isTypeEquals(o2.getClass()))
return Integer.compare(bo1.enumOrdinal(), ((Enum)o2).ordinal());
}
{noformat}
- we need more tests: all tests should test both SqlQuery/SqlFieldsQuery, tests for local queries (i.e. SqlFieldsQuery.setLocal(true)), tests using comparison with with _val field and with some field which is neither _key nor _val, tests for these argument types: UUID, Date, Timestamp, BigDecimal, tests with offheap
was (Author: sboikov):
Reviewed, have some comments:
- for me 'binarizeArgs(final Object[] args)' does not look correct, it should just call cacheContext.toCacheObject
- also in GridH2ValueCacheObject.compareSecure there is special handling for enums, as I remember it was added to resolve the same issue, this code should be removed as part of this fix:
if (o1 instanceof BinaryEnumObjectImpl && o2 instanceof Enum) {
final BinaryEnumObjectImpl bo1 = (BinaryEnumObjectImpl)o1;
if (bo1.isTypeEquals(o2.getClass()))
return Integer.compare(bo1.enumOrdinal(), ((Enum)o2).ordinal());
}
- we need more tests: all tests should test both SqlQuery/SqlFieldsQuery, tests for local queries (i.e. SqlFieldsQuery.setLocal(true)), tests using comparison with with _val field and with some field which is neither _key nor _val,
tests for these argument types: UUID, Date, Timestamp, BigDecimal, tests with offheap
> Queries with object arguments doesn't work wth BinaryMarshaller.
> ----------------------------------------------------------------
>
> Key: IGNITE-2208
> URL: https://issues.apache.org/jira/browse/IGNITE-2208
> Project: Ignite
> Issue Type: Bug
> Components: cache
> Affects Versions: ignite-1.4
> Reporter: Vladimir Ozerov
> Assignee: Dmitry Karachentsev
> Labels: community
> Fix For: 1.8
>
>
> This happens because we cannot compare binary and non-binary objects.
> Problematic code frame:
> {code}
> GridH2ValueCacheObject.compareSecure
> {code}
> Affected tests:
> {code}
> IgniteCacheAbstractQuerySelfTest.testObjectQuery
> IgniteCacheAbstractQuerySelfTest.testBadHashObjectKey
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)