ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [08/50] [abbrv] ignite git commit: IGNITE-1495 Uppercase index fields in metadata. This closes #1474.
Date Thu, 02 Mar 2017 11:30:45 GMT
IGNITE-1495 Uppercase index fields in metadata. This closes #1474.


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

Branch: refs/heads/ignite-4565-ddl
Commit: 7d3c046e58a160132655a7b8f90830d69a16e2ab
Parents: d8ad967
Author: Sergey Kalashnikov <skalashnikov@gridgain.com>
Authored: Tue Feb 14 14:56:24 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Tue Feb 14 14:56:24 2017 +0300

----------------------------------------------------------------------
 .../cache/query/GridCacheQueryManager.java      | 11 +++++++---
 .../IgniteCacheAbstractFieldsQuerySelfTest.java | 21 ++++++++++++++++++++
 2 files changed, 29 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7d3c046e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 2b31e2d..c434401 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -2484,12 +2484,17 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
 
                             // Add only SQL indexes.
                             if (desc.type() == GridQueryIndexType.SORTED) {
-                                Collection<String> idxFields = e.getValue().fields();
+                                Collection<String> idxFields = new LinkedList<>();
                                 Collection<String> descendings = new LinkedList<>();
 
-                                for (String idxField : idxFields)
+                                for (String idxField : e.getValue().fields()) {
+                                    String idxFieldUpper = idxField.toUpperCase();
+
+                                    idxFields.add(idxFieldUpper);
+
                                     if (desc.descending(idxField))
-                                        descendings.add(idxField);
+                                        descendings.add(idxFieldUpper);
+                                }
 
                                 indexesCol.add(new CacheSqlIndexMetadata(e.getKey().toUpperCase(),
                                     idxFields, descendings, false));

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d3c046e/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
index d5f02eb..0170fc7 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
@@ -326,8 +326,29 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends
GridCommonA
 
                     Collection<GridCacheSqlIndexMetadata> indexes = meta.indexes("Person");
 
+                    assertNotNull("Indexes should be defined", indexes);
                     assertEquals(2, indexes.size());
 
+                    Iterator<GridCacheSqlIndexMetadata> it = indexes.iterator();
+
+                    Collection<String> indFlds = it.next().fields();
+
+                    assertNotNull("Fields for first index should be defined", indFlds);
+                    assertEquals("First index should have one field", indFlds.size(), 1);
+
+                    Iterator<String> indFldIt = indFlds.iterator();
+
+                    assertEquals(indFldIt.next(), "AGE");
+
+                    indFlds = it.next().fields();
+
+                    assertNotNull("Fields for second index should be defined", indFlds);
+                    assertEquals("Second index should have one field", indFlds.size(), 1);
+
+                    indFldIt = indFlds.iterator();
+
+                    assertEquals(indFldIt.next(), "ORGID");
+
                     wasNull = true;
                 }
                 else if (CACHE.equals(meta.cacheName()))


Mime
View raw message