You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Chris Wang (JIRA)" <ji...@apache.org> on 2017/06/08 10:15:18 UTC

[jira] [Commented] (IGNITE-5204) The Unicode character in the value of a field which are included in an un-unique index will cause "stack overhead" exception

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

Chris Wang commented on IGNITE-5204:
------------------------------------

Dear,
I found the things that might reproduce the problem. in the class "org.apache.ignite.internal.processors.query.h2.database.InlineIndexHelper" line 444:
"size = (short)(s.length | 0x8000);"
when the "s" is null, the logic will cause exception (NullReferenceException) cause problem when querying on the cache.
case Value.STRING_IGNORECASE: {
                short size;

                byte[] s = val.getString().getBytes(CHARSET);
                if (s.length + 3 <= maxSize)
                    size = (short)s.length;
                else {
                    s = trimUTF8(s, maxSize - 3);
                    size = (short)(s.length | 0x8000);
                }

                if (s == null) {
                    // Can't fit anything to
                    PageUtils.putByte(pageAddr, off, (byte)Value.UNKNOWN);
                    return 0;
                }
                else {
                    PageUtils.putByte(pageAddr, off, (byte)val.getType());
                    PageUtils.putShort(pageAddr, off + 1, size);
                    PageUtils.putBytes(pageAddr, off + 3, s);
                    return s.length + 3;
                }
            }

> The Unicode character in the value of a field which are included in an un-unique index will cause "stack overhead" exception
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-5204
>                 URL: https://issues.apache.org/jira/browse/IGNITE-5204
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache, sql
>    Affects Versions: 2.0
>         Environment: windows server 2012, JDK 1.8, X64
>            Reporter: Chris Wang
>            Assignee: Sergey Kalashnikov
>            Priority: Critical
>             Fix For: 2.1
>
>
> When put  "草DX009090" as the value of BillId, which is a field of entity Bill. If I define a index includes the BillId, and execute the query like "select * from Bill where BillId=’草DX009090‘ in the H2 debug console, there throws an exception by the H2 with a code 5000. 
> another scenario is, I have two entities, "Bill" and "Detail", both have field "BillId". If either of them have value like "草DX009090" and execute the query like "select bill.* from bill left join detail on bill.billid=detail.billid", the whole ignite cache node will halt ( suppose there should be an stack overhead exception, dead loop).
> ======================
> I think the issue should relate to hash computing on the unicode character.



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