ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [21/50] [abbrv] ignite git commit: IGNITE-4372 Ids quoting fix
Date Wed, 01 Mar 2017 14:33:04 GMT
IGNITE-4372 Ids quoting fix


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

Branch: refs/heads/master
Commit: 14290d3fe44af7e2269d42361f2bb1207b0ee8c3
Parents: 166e65c
Author: Alexander Paschenko <alexander.a.paschenko@gmail.com>
Authored: Tue Feb 21 14:00:45 2017 +0300
Committer: Alexander Paschenko <alexander.a.paschenko@gmail.com>
Committed: Tue Feb 21 14:00:45 2017 +0300

----------------------------------------------------------------------
 .../internal/processors/query/h2/sql/DmlAstUtils.java     | 10 ++++++----
 .../internal/processors/query/h2/sql/GridSqlFunction.java |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/14290d3f/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/DmlAstUtils.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/DmlAstUtils.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/DmlAstUtils.java
index 35f0983..f96e5e3 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/DmlAstUtils.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/DmlAstUtils.java
@@ -25,6 +25,7 @@ import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.internal.processors.query.IgniteSQLException;
 import org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing;
+import org.apache.ignite.internal.processors.query.h2.dml.FastUpdateArgument;
 import org.apache.ignite.internal.processors.query.h2.dml.FastUpdateArguments;
 import org.apache.ignite.internal.processors.query.h2.opt.GridH2AbstractKeyValueRow;
 import org.apache.ignite.internal.processors.query.h2.opt.GridH2RowDescriptor;
@@ -33,6 +34,7 @@ import org.apache.ignite.internal.util.lang.IgnitePair;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgnitePredicate;
+import org.h2.command.Parser;
 import org.h2.expression.Expression;
 import org.h2.table.Column;
 import org.h2.table.Table;
@@ -47,8 +49,6 @@ import org.h2.value.ValueTimestamp;
 import org.h2.value.ValueTimestampUtc;
 import org.jetbrains.annotations.Nullable;
 
-import org.apache.ignite.internal.processors.query.h2.dml.FastUpdateArgument;
-
 /**
  * AST utils for DML
  */
@@ -85,7 +85,7 @@ public final class DmlAstUtils {
             for (int i = 0; i < cols.length; i++) {
                 GridSqlArray arr = new GridSqlArray(rows.size());
 
-                String colName = IgniteH2Indexing.escapeName(cols[i].columnName(), desc.quoteAllIdentifiers());
+                String colName = cols[i].columnName();
 
                 GridSqlAlias alias = new GridSqlAlias(colName, arr);
 
@@ -109,6 +109,8 @@ public final class DmlAstUtils {
                     args[i].addChild(row[i]);
             }
 
+            sel.getSQL();
+
             return sel;
         }
         else {
@@ -339,7 +341,7 @@ public final class DmlAstUtils {
         mapQry.addColumn(valCol, true);
 
         for (GridSqlColumn c : update.cols()) {
-            String newColName = "_upd_" + c.columnName();
+            String newColName = Parser.quoteIdentifier("_upd_" + c.columnName());
             // We have to use aliases to cover cases when the user
             // wants to update _val field directly (if it's a literal)
             GridSqlAlias alias = new GridSqlAlias(newColName, elementOrDefault(update.set().get(c.columnName()),
c), true);

http://git-wip-us.apache.org/repos/asf/ignite/blob/14290d3f/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlFunction.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlFunction.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlFunction.java
index f194b07..46a558a 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlFunction.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlFunction.java
@@ -143,7 +143,7 @@ public class GridSqlFunction extends GridSqlElement {
                     GridSqlElement e = child(i);
 
                     // id int = ?, name varchar = ('aaa', 'bbb')
-                    buff.append(((GridSqlAlias)e).alias())
+                    buff.append(Parser.quoteIdentifier(((GridSqlAlias)e).alias()))
                         .append(' ')
                         .append(e.resultType().sql())
                         .append('=')


Mime
View raw message