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

Sergey Kalashnikov commented on IGNITE-5204:
--------------------------------------------

[~wal...@sohu.com],
Thank you. This is valueable info. I did not know you use .NET API.
I rewrote my test for .NET. However, the issue is not reproduced for me. 
Some configuration details might be missing then.
Is it possible that you share your cache configuration?

Here is my .NET test (I have modified one of .NET examples for that purpose)
{code}
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

namespace Apache.Ignite.Examples.Datagrid
{
    using System;
    using System.Text;
    using Apache.Ignite.Core;
    using Apache.Ignite.Core.Cache;
    using Apache.Ignite.Core.Cache.Configuration;
    using Apache.Ignite.Core.Cache.Query;
    using Apache.Ignite.ExamplesDll.Binary;

    /// <summary>
    /// This example showcases DML capabilities of Ignite's SQL engine.
    /// <para />
    /// 1) Build the project Apache.Ignite.ExamplesDll (select it -> 
right-click -> Build).
    ///    Apache.Ignite.ExamplesDll.dll must appear in 
%IGNITE_HOME%/platforms/dotnet/examples/Apache.Ignite.ExamplesDll/bin/${Platform]/${Configuration}
 folder.
    /// 2) Set this class as startup object (Apache.Ignite.Examples project -> 
right-click -> Properties ->
    ///     Application -> Startup object);
    /// 3) Start example (F5 or Ctrl+F5).
    /// <para />
    /// This example can be run with standalone Apache Ignite.NET node:
    /// 1) Run %IGNITE_HOME%/platforms/dotnet/bin/Apache.Ignite.exe:
    /// Apache.Ignite.exe 
-configFileName=platforms\dotnet\examples\apache.ignite.examples\app.config 
-assembly=[path_to_Apache.Ignite.ExamplesDll.dll]
    /// 2) Start example.
    /// </summary>
    public class Ignite5204Example
    {
        private const string BillCacheName = "bill_cache";

        public class Bill
        {
            [QuerySqlField(IsIndexed = true)]
            public string BillId { get; set; }
        }

        public class Detail
        {
            [QuerySqlField(IsIndexed = true)]
            public string BillId { get; set; }
        }

        [STAThread]
        public static void Main()
        {
            using (var ignite = Ignition.StartFromApplicationConfiguration())
            {
                Console.WriteLine();
                Console.WriteLine(">>> Example started.");

                var billCache = ignite.GetOrCreateCache<string, Bill>(
                    new CacheConfiguration(BillCacheName, 
                        new QueryEntity(typeof(string), typeof(Bill)),
                        new QueryEntity(typeof(string), typeof(Detail)) ));

                billCache.Clear();

                Insert(billCache);
                Select(billCache, "Test");

                Console.WriteLine();
            }

            Console.WriteLine();
            Console.WriteLine(">>> Example finished, press any key to exit 
...");
            Console.ReadKey();
        }

        private static void Select(ICache<string, Bill> billCache, string 
message)
        {
            Console.WriteLine("\n>>> {0}", message);

            var qry = new SqlFieldsQuery("select * from Bill where BillId = 
'草DX009090'");

            using (var cursor = billCache.QueryFields(qry))
            {
                foreach (var row in cursor)
                {
                    Console.WriteLine(">>> {0}", row[0]);
                }
            }
            
            qry = new SqlFieldsQuery("select bill.*from bill left join detail 
on bill.billid = detail.billid");
            
            using (var cursor = billCache.QueryFields(qry))
            {
                foreach (var row in cursor)
                {
                    Console.WriteLine(">>> {0}", row[0]);
                }
            }
        }

        private static void Insert(ICache<string, Bill> billCache)
        {
            var qry = new SqlFieldsQuery("insert into Bill (_key, BillId) 
values (?, ?)");

            qry.Arguments = new object[] {"Bill_1", "DX0000000"};
            billCache.QueryFields(qry);

            qry.Arguments = new object[] {"Bill_2", "草DX009090" };
            billCache.QueryFields(qry);

            qry = new SqlFieldsQuery("insert into Detail (_key, BillId) values 
(?, ?)");

            qry.Arguments = new object[] {"Detail_1", "DX0000000"};
            billCache.QueryFields(qry);

            qry.Arguments = new object[] {"Detail_2", "草DX009090"};
            billCache.QueryFields(qry);
        }
    }
}
{code}

> 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)

Reply via email to