You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2017/05/29 15:40:59 UTC

ignite git commit: IGNITE-5334

Repository: ignite
Updated Branches:
  refs/heads/ignite-5334 [created] 71c7b7846


IGNITE-5334


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

Branch: refs/heads/ignite-5334
Commit: 71c7b7846ed2b531fc5a6bc2ac45fccde35774e2
Parents: f9c96de
Author: devozerov <vo...@gridgain.com>
Authored: Mon May 29 18:40:50 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Mon May 29 18:40:50 2017 +0300

----------------------------------------------------------------------
 .../internal/processors/query/GridQueryProcessor.java |  2 +-
 .../ignite/internal/processors/query/QueryUtils.java  | 14 +++++++++++---
 .../processors/query/IgniteSqlSplitterSelfTest.java   |  2 --
 3 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/71c7b784/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index f3da6d0..4187e2b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -677,7 +677,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
 
                 String cacheName = cctx.name();
 
-                String schemaName = QueryUtils.normalizeSchemaName(cacheName, cctx.config().getSqlSchema(), escape);
+                String schemaName = QueryUtils.normalizeSchemaName(cacheName, cctx.config().getSqlSchema());
 
                 // Prepare candidates.
                 List<Class<?>> mustDeserializeClss = new ArrayList<>();

http://git-wip-us.apache.org/repos/asf/ignite/blob/71c7b784/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java
index c327820..b4feea4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java
@@ -268,10 +268,11 @@ public class QueryUtils {
      *
      * @param cacheName Cache name.
      * @param schemaName Schema name.
-     * @param escape Whether to perform escape.
      * @return Proper schema name according to ANSI-99 standard.
      */
-    public static String normalizeSchemaName(String cacheName, @Nullable String schemaName, boolean escape) {
+    public static String normalizeSchemaName(String cacheName, @Nullable String schemaName) {
+        boolean escape = false;
+
         String res = schemaName;
 
         if (res == null) {
@@ -282,6 +283,13 @@ public class QueryUtils {
             // SQL synthax perspective. We do not want node to fail on startup due to this.
             escape = true;
         }
+        else {
+            if (res.startsWith("\"") && res.endsWith("\"")) {
+                res = res.substring(1, res.length() - 1);
+
+                escape = true;
+            }
+        }
 
         if (!escape)
             res = normalizeObjectName(res, false);
@@ -308,7 +316,7 @@ public class QueryUtils {
      * Normalize object name.
      *
      * @param str String.
-     * @param replace Whether to perform replace.
+     * @param replace Whether to perform replace of special characters.
      * @return Escaped string.
      */
     public static @Nullable String normalizeObjectName(@Nullable String str, boolean replace) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/71c7b784/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
index 6b984bf..9b5c17a 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
@@ -1125,14 +1125,12 @@ public class IgniteSqlSplitterSelfTest extends GridCommonAbstractTest {
     /**
      */
     public void testSchemaQuoted() {
-        assert false; // TODO test hangs
         doTestSchemaName("\"ppAf\"");
     }
 
     /**
      */
     public void testSchemaQuotedUpper() {
-        assert false; // TODO test hangs
         doTestSchemaName("\"PPAF\"");
     }