[ 
https://issues.apache.org/jira/browse/IGNITE-14064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pavel Tupitsyn updated IGNITE-14064:
------------------------------------
    Description: 
Using a generic type as a QueryEntity value type results in a broken SQL table 
name:

{code}
            var ignite = Ignition.Start(TestUtils.GetTestConfiguration());

            var cfg = new CacheConfiguration(
                TestUtils.TestName,
                new QueryEntity(typeof(int), typeof(GenericTest<string>)));

            var cache = ignite.GetOrCreateCache<int, GenericTest<string>>(cfg);
            cache[1] = new GenericTest<string> {Prop = "1"};

            var tables = cache.Query(new SqlFieldsQuery("SELECT TABLE_NAME FROM 
INFORMATION_SCHEMA.TABLES"))
                .Select(x => (string) x.Single()).ToArray();
{code}

Resulting table name is *0, CULTURE=NEUTRAL, PUBLICKEYTOKEN=7CEC85D7BEA7798E]]*.
We should add .NET generics support to 
{{org.apache.ignite.internal.processors.query.QueryUtils.typeName}}.


  was:
Using a generic type as a QueryEntity value type results in a broken SQL table 
name:

{code}
            var ignite = Ignition.Start(TestUtils.GetTestConfiguration());

            var cfg = new CacheConfiguration(
                TestUtils.TestName,
                new QueryEntity(typeof(int), typeof(GenericTest<string>)));

            var cache = ignite.GetOrCreateCache<int, GenericTest<string>>(cfg);
            cache[1] = new GenericTest<string> {Prop = "1"};

            var tables = cache.Query(new SqlFieldsQuery("SELECT TABLE_NAME FROM 
INFORMATION_SCHEMA.TABLES"))
                .Select(x => (string) x.Single()).ToArray();
{code}

Resulting table name is *0, CULTURE=NEUTRAL, PUBLICKEYTOKEN=7CEC85D7BEA7798E]]*.
We should clean up the generic type name in {{BinaryUtils.GetSqlTypeName}}.



> .NET: Incorrect table name when query type is generic
> -----------------------------------------------------
>
>                 Key: IGNITE-14064
>                 URL: https://issues.apache.org/jira/browse/IGNITE-14064
>             Project: Ignite
>          Issue Type: Bug
>          Components: platforms
>            Reporter: Pavel Tupitsyn
>            Assignee: Pavel Tupitsyn
>            Priority: Minor
>              Labels: .NET
>
> Using a generic type as a QueryEntity value type results in a broken SQL 
> table name:
> {code}
>             var ignite = Ignition.Start(TestUtils.GetTestConfiguration());
>             var cfg = new CacheConfiguration(
>                 TestUtils.TestName,
>                 new QueryEntity(typeof(int), typeof(GenericTest<string>)));
>             var cache = ignite.GetOrCreateCache<int, 
> GenericTest<string>>(cfg);
>             cache[1] = new GenericTest<string> {Prop = "1"};
>             var tables = cache.Query(new SqlFieldsQuery("SELECT TABLE_NAME 
> FROM INFORMATION_SCHEMA.TABLES"))
>                 .Select(x => (string) x.Single()).ToArray();
> {code}
> Resulting table name is *0, CULTURE=NEUTRAL, 
> PUBLICKEYTOKEN=7CEC85D7BEA7798E]]*.
> We should add .NET generics support to 
> {{org.apache.ignite.internal.processors.query.QueryUtils.typeName}}.



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

Reply via email to