Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13588

.NET: Incorrect binary type name is registered for generic query types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.9, 2.8.1
    • 2.11
    • platforms
    • Apache Ignite: v2.8.1

      JDK: v1.8

      .NET Core: v3.1

    • .NET: Fixed SQL type name for generic query types
    • Docs Required, Release Notes Required

    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-13160 changes the string from BinaryUtils.GetSqlTypeName gets passed back to UnmanagedCallbacks.BinaryTypeGet

      Attachments

        1. Untitled.png
          75 kB
          Danut Radoaica

        Issue Links

          Activity

            People

              ptupitsyn Pavel Tupitsyn
              dradoaica Danut Radoaica
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m