ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [09/11] ignite git commit: IGNITE-6662: SQL: fixed affinity key field name resolution during both parsig and table creation. This closes #2875.
Date Thu, 19 Oct 2017 08:30:32 GMT
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/bab8acb4
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bab8acb4
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bab8acb4

Branch: refs/heads/ignite-3478
Commit: bab8acb4cb559dee75e54d86b371b852dbdb22bb
Parents: 5128c25
Author: devozerov <vozerov@gridgain.com>
Authored: Wed Oct 18 15:03:28 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Wed Oct 18 15:03:28 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/bab8acb4/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 93da34e..6c353e9 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
@@ -137,8 +137,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/bab8acb4/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