ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: IGNITE-6662: SQL: fixed affinity key field name resolution during both parsig and table creation. This closes #2875.
Date Wed, 18 Oct 2017 12:04:45 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-2.3 22100d4f2 -> 5df25fc8a


IGNITE-6662: SQL: fixed affinity key field name resolution during both parsig and table creation.
This closes #2875.


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

Branch: refs/heads/ignite-2.3
Commit: 5df25fc8adf01a8e4999563f3f31b79c195801d4
Parents: 22100d4
Author: devozerov <vozerov@gridgain.com>
Authored: Wed Oct 18 15:03:28 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Wed Oct 18 15:04:06 2017 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/query/h2/opt/GridH2Table.java   | 6 +++++-
 .../internal/processors/query/h2/sql/GridSqlQueryParser.java   | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5df25fc8/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
index 79eed12..0b3462e 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
@@ -141,8 +141,12 @@ public class GridH2Table extends TableBase {
             int affKeyColId = -1;
 
             if (affKey != null) {
-                if (doesColumnExist(affKey))
+                if (doesColumnExist(affKey)) {
                     affKeyColId = getColumn(affKey).getColumnId();
+
+                    if (desc.isKeyColumn(affKeyColId))
+                        affKeyColId = KEY_COL;
+                }
                 else
                     affinityColExists = false;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/5df25fc8/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
index bf72200..280fb2d 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
@@ -1104,7 +1104,7 @@ public class GridSqlQueryParser {
         if (res.affinityKey() == null) {
             LinkedHashSet<String> pkCols0 = res.primaryKeyColumns();
 
-            if (!F.isEmpty(pkCols0) && pkCols0.size() == 1)
+            if (!F.isEmpty(pkCols0) && pkCols0.size() == 1 && wrapKey0)
                 res.affinityKey(pkCols0.iterator().next());
         }
 


Mime
View raw message