Details
Description
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:
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
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-13160changes the string from BinaryUtils.GetSqlTypeName gets passed back to UnmanagedCallbacks.BinaryTypeGet
Attachments
Attachments
Issue Links
- is caused by
-
IGNITE-13160 .NET: wrong affinity key registration with AffinityKeyMapped attribute
- Resolved
- is related to
-
IGNITE-14064 .NET: Incorrect table name when query type is generic
- Resolved
- links to