ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [14/41] ignite git commit: IGNITE-5204: Fixed NPE on certain data with index inlining. This closes #2115.
Date Mon, 10 Jul 2017 12:00:30 GMT
IGNITE-5204: Fixed NPE on certain data with index inlining. This closes #2115.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0d6fb1ad
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0d6fb1ad
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0d6fb1ad

Branch: refs/heads/ignite-5578-1
Commit: 0d6fb1ad73e8ed448dabe7c0cc631222835b52c4
Parents: ea4420e
Author: Sergey Kalashnikov <skalashnikov@gridgain.com>
Authored: Fri Jul 7 15:54:52 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Fri Jul 7 15:54:52 2017 +0300

----------------------------------------------------------------------
 .../internal/processors/query/h2/database/InlineIndexHelper.java | 2 +-
 .../processors/query/h2/database/InlineIndexHelperTest.java      | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0d6fb1ad/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java
index 1fd45f3..19cf857 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java
@@ -441,7 +441,7 @@ public class InlineIndexHelper {
                     size = (short)s.length;
                 else {
                     s = trimUTF8(s, maxSize - 3);
-                    size = (short)(s.length | 0x8000);
+                    size = (short)(s == null ? 0 : s.length | 0x8000);
                 }
 
                 if (s == null) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/0d6fb1ad/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java
index 2579023..a2a3a72 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java
@@ -167,6 +167,10 @@ public class InlineIndexHelperTest extends TestCase {
             assertTrue(ih.isValueFull(pageAddr, off));
 
             assertEquals("aaa", ih.get(pageAddr, off, 3 + 5).getString());
+
+            ih.put(pageAddr, off, ValueString.get("\u20acaaa"), 3 + 2);
+
+            assertNull(ih.get(pageAddr, off, 3 + 2));
         }
         finally {
             if (page != 0L)


Mime
View raw message