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

Pavel Tupitsyn edited comment on IGNITE-13588 at 1/27/21, 1:13 PM:
-------------------------------------------------------------------

[~dradoaica] [~isapego] please review:
https://github.com/apache/ignite/pull/8708


was (Author: ptupitsyn):
[~dradoaica] [~isapego] please review.

> .NET: Incorrect binary type name is registered for generic query types
> ----------------------------------------------------------------------
>
>                 Key: IGNITE-13588
>                 URL: https://issues.apache.org/jira/browse/IGNITE-13588
>             Project: Ignite
>          Issue Type: Bug
>          Components: platforms
>    Affects Versions: 2.9, 2.8.1
>         Environment: Apache Ignite: v2.8.1
> JDK: v1.8
> .NET Core: v3.1
>            Reporter: Danut Radoaica
>            Assignee: Pavel Tupitsyn
>            Priority: Major
>              Labels: .NET, 2.9.1-rc
>             Fix For: 2.11
>
>         Attachments: Untitled.png
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Using a generic type as a QueryEntity value type results in a wrong type name 
> being registered in QueryEntities and a wrong typeId being calculated for the 
> binary metadata:
> {code}
>             var ignite = Ignition.Start(TestUtils.GetTestConfiguration());
>             var cfg = new CacheConfiguration(TestUtils.TestName)
>             {
>                 QueryEntities = new[] {new QueryEntity(typeof(int), 
> typeof(GenericTest<string>))}
>             };
>             var cache = ignite.GetOrCreateCache<int, 
> GenericTest<string>>(cfg);
>             cache[1] = new GenericTest<string> {Prop = "foo"};
>             var binType = ignite.GetBinary().GetBinaryTypes().Single();
>             Assert.AreEqual(-590542188, binType.TypeId); // 945954881 with 
> QueryEntity
>             Assert.AreEqual(
>                 
> "Apache.Ignite.Core.Tests.Cache.Query.CacheQueriesCodeConfigurationTest+GenericTest`1[[System.String]]",
>                 
> cache.GetConfiguration().QueryEntities.Single().ValueTypeName); // Includes 
> assembly name with query entity
> {code}
> {{BinaryUtils.GetSqlTypeName}} returns Type.FullName, which includes 
> assembly-qualified type names for all generic type arguments.
> This causes the following problems:
> * SQL type name includes assembly versions, so queries stop working if there 
> is a version change
> * Incorrect binary type id is registered, because due to IGNITE-13160 changes 
> the string from {{BinaryUtils.GetSqlTypeName}} gets passed back to 
> {{UnmanagedCallbacks.BinaryTypeGet}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to