ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Tupitsyn (Jira)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-13957) GridQueryProcessor.validateKeyAndValue attempts to deserialize key and value when QueryEntity.fields is not set
Date Tue, 05 Jan 2021 08:28:00 GMT
Pavel Tupitsyn created IGNITE-13957:
---------------------------------------

             Summary: GridQueryProcessor.validateKeyAndValue attempts to deserialize key and
value when QueryEntity.fields is not set
                 Key: IGNITE-13957
                 URL: https://issues.apache.org/jira/browse/IGNITE-13957
             Project: Ignite
          Issue Type: Bug
          Components: sql
    Affects Versions: 2.9.1, 2.9
            Reporter: Pavel Tupitsyn
            Assignee: Pavel Tupitsyn
             Fix For: 2.10


{{GridQueryProcessor.validateKeyAndValue}} attempts to deserialize cache key and value on
{{put}} when {{QueryEntity.fields}} is not set, and fails when corresponding classes can't
be found.

* The bug was introduced in 2.9
* There is no problem when some query entity fields are defined

Reproducer in .NET (TODO: add both .NET and Java tests for this)
{code}
// CacheQueriesCodeConfigurationTest

        /// <summary>
        /// Tests query entity validation when no <see cref="QuerySqlFieldAttribute"/>
has been set.
        /// </summary>
        [Test]
        public void TestMissingQueryAttributes()
        {
            using (var ignite = Ignition.Start(TestUtils.GetTestConfiguration()))
            {
                var cfg = new CacheConfiguration(
                    TestUtils.TestName,
                    new QueryEntity(typeof(string), typeof(MissingAttributesTest)));

                var cache = ignite.GetOrCreateCache<string, MissingAttributesTest>(cfg);

                cache["1"] = new MissingAttributesTest {Foo = "Bar"};
            }
        }

        /// <summary>
        /// Class without any <see cref="QuerySqlFieldAttribute"/> attributes.
        /// </summary>
        private class MissingAttributesTest
        {
            /** */
            public string Foo { get; set; }
        }
{code}



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

Mime
View raw message