ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [02/12] ignite git commit: IGNITE-4531: SQL: Use correct property name in BinaryProperty. This closes 1419.
Date Mon, 16 Jan 2017 15:21:28 GMT
IGNITE-4531: SQL: Use correct property name in BinaryProperty. This closes 1419.


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

Branch: refs/heads/ignite-comm-balance-master
Commit: abc8b9091e9eda8cc43f398939bf1fb6035f7a3f
Parents: 1f358db
Author: Alexander Paschenko <alexander.a.paschenko@gmail.com>
Authored: Thu Jan 12 10:50:14 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Thu Jan 12 10:50:14 2017 +0300

----------------------------------------------------------------------
 .../processors/query/GridQueryProcessor.java      |  2 +-
 ...IgniteCacheAbstractInsertSqlQuerySelfTest.java | 14 +++++++-------
 .../IgniteCacheAbstractSqlDmlQuerySelfTest.java   |  6 +++---
 .../cache/IgniteCacheInsertSqlQuerySelfTest.java  | 18 ++++++++++--------
 .../cache/IgniteCacheMergeSqlQuerySelfTest.java   | 14 +++++++-------
 .../cache/IgniteCacheUpdateSqlQuerySelfTest.java  |  4 ++--
 6 files changed, 30 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/abc8b909/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 58f94f4..3286bac 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
@@ -2147,7 +2147,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
             if (!(obj instanceof BinaryObjectBuilder))
                 throw new UnsupportedOperationException("Individual properties can be set
for binary builders only");
 
-            setValue0((BinaryObjectBuilder) obj, name(), propVal, type());
+            setValue0((BinaryObjectBuilder) obj, propName, propVal, type());
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/abc8b909/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractInsertSqlQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractInsertSqlQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractInsertSqlQuerySelfTest.java
index df4259e..86d01c7 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractInsertSqlQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractInsertSqlQuerySelfTest.java
@@ -151,7 +151,7 @@ public abstract class IgniteCacheAbstractInsertSqlQuerySelfTest extends
GridComm
             LinkedHashMap<String, String> flds = new LinkedHashMap<>();
 
             flds.put("id", Integer.class.getName());
-            flds.put("name", String.class.getName());
+            flds.put("firstName", String.class.getName());
 
             s2p.setFields(flds);
 
@@ -172,7 +172,7 @@ public abstract class IgniteCacheAbstractInsertSqlQuerySelfTest extends
GridComm
             LinkedHashMap<String, String> flds = new LinkedHashMap<>();
 
             flds.put("id", Integer.class.getName());
-            flds.put("name", String.class.getName());
+            flds.put("firstName", String.class.getName());
 
             i2p.setFields(flds);
 
@@ -194,7 +194,7 @@ public abstract class IgniteCacheAbstractInsertSqlQuerySelfTest extends
GridComm
 
             flds.put("key", Integer.class.getName());
             flds.put("id", Integer.class.getName());
-            flds.put("name", String.class.getName());
+            flds.put("firstName", String.class.getName());
 
             k2p.setFields(flds);
 
@@ -216,7 +216,7 @@ public abstract class IgniteCacheAbstractInsertSqlQuerySelfTest extends
GridComm
 
             flds.put("Id", Integer.class.getName());
             flds.put("id", Integer.class.getName());
-            flds.put("name", String.class.getName());
+            flds.put("firstName", String.class.getName());
             flds.put("IntVal", Integer.class.getName());
 
             k22p.setFields(flds);
@@ -240,7 +240,7 @@ public abstract class IgniteCacheAbstractInsertSqlQuerySelfTest extends
GridComm
             flds.put("key", Integer.class.getName());
             flds.put("strKey", String.class.getName());
             flds.put("id", Integer.class.getName());
-            flds.put("name", String.class.getName());
+            flds.put("firstName", String.class.getName());
 
             k32p.setFields(flds);
 
@@ -263,7 +263,7 @@ public abstract class IgniteCacheAbstractInsertSqlQuerySelfTest extends
GridComm
             flds.put("key", Integer.class.getName());
             flds.put("strKey", String.class.getName());
             flds.put("id", Integer.class.getName());
-            flds.put("name", String.class.getName());
+            flds.put("firstName", String.class.getName());
 
             k42p.setFields(flds);
 
@@ -515,7 +515,7 @@ public abstract class IgniteCacheAbstractInsertSqlQuerySelfTest extends
GridComm
         protected int id;
 
         /** */
-        @QuerySqlField
+        @QuerySqlField(name = "firstName")
         protected String name;
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/abc8b909/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractSqlDmlQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractSqlDmlQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractSqlDmlQuerySelfTest.java
index 7f79ec4..649012f 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractSqlDmlQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractSqlDmlQuerySelfTest.java
@@ -139,7 +139,7 @@ public abstract class IgniteCacheAbstractSqlDmlQuerySelfTest extends GridCommonA
         BinaryObjectBuilder bldr = ignite(0).binary().builder("Person");
 
         bldr.setField("id", id);
-        bldr.setField("name", name);
+        bldr.setField("firstName", name);
         bldr.setField("secondName", secondName);
 
         return bldr.build();
@@ -186,7 +186,7 @@ public abstract class IgniteCacheAbstractSqlDmlQuerySelfTest extends GridCommonA
         LinkedHashMap<String, String> flds = new LinkedHashMap<>();
 
         flds.put("id", Integer.class.getName());
-        flds.put("name", String.class.getName());
+        flds.put("firstName", String.class.getName());
         flds.put("secondName", String.class.getName());
 
         e.setFields(flds);
@@ -214,7 +214,7 @@ public abstract class IgniteCacheAbstractSqlDmlQuerySelfTest extends GridCommonA
         protected int id;
 
         /** */
-        @QuerySqlField
+        @QuerySqlField(name = "firstName")
         protected final String name;
 
         /** */

http://git-wip-us.apache.org/repos/asf/ignite/blob/abc8b909/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInsertSqlQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInsertSqlQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInsertSqlQuerySelfTest.java
index 04a352f..e9c21dc 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInsertSqlQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInsertSqlQuerySelfTest.java
@@ -56,7 +56,7 @@ public class IgniteCacheInsertSqlQuerySelfTest extends IgniteCacheAbstractInsert
     public void testInsertWithExplicitKey() {
         IgniteCache<String, Person> p = ignite(0).cache("S2P").withKeepBinary();
 
-        p.query(new SqlFieldsQuery("insert into Person (_key, id, name) values ('s', ?, ?),
" +
+        p.query(new SqlFieldsQuery("insert into Person (_key, id, firstName) values ('s',
?, ?), " +
             "('a', 2, 'Alex')").setArgs(1, "Sergi"));
 
         assertEquals(createPerson(1, "Sergi"), p.get("s"));
@@ -76,7 +76,7 @@ public class IgniteCacheInsertSqlQuerySelfTest extends IgniteCacheAbstractInsert
         assertEquals("Sergi", p.get("s"));
         assertEquals("Alex", p.get("a"));
 
-        p.query(new SqlFieldsQuery("insert into Person(_key, id, name) " +
+        p.query(new SqlFieldsQuery("insert into Person(_key, id, firstName) " +
             "(select substring(lower(_val), 0, 2), cast(length(_val) as int), _val from String)"));
 
         assertEquals(createPerson(5, "Sergi"), p.get("se"));
@@ -91,7 +91,7 @@ public class IgniteCacheInsertSqlQuerySelfTest extends IgniteCacheAbstractInsert
         IgniteCache<Integer, Person> p = ignite(0).cache("I2P").withKeepBinary();
 
         p.query(new SqlFieldsQuery(
-            "insert into Person (_key, id, name) values (cast('1' as int), ?, ?), (2, (5
- 3), 'Alex')")
+            "insert into Person (_key, id, firstName) values (cast('1' as int), ?, ?), (2,
(5 - 3), 'Alex')")
             .setArgs(1, "Sergi"));
 
         assertEquals(createPerson(1, "Sergi"), p.get(1));
@@ -106,7 +106,7 @@ public class IgniteCacheInsertSqlQuerySelfTest extends IgniteCacheAbstractInsert
         IgniteCache<Key, Person> p = ignite(0).cache("K2P").withKeepBinary();
 
         p.query(new SqlFieldsQuery(
-            "insert into Person (key, id, name) values (1, ?, ?), (2, 2, 'Alex')").setArgs(1,
"Sergi"));
+            "insert into Person (key, id, firstName) values (1, ?, ?), (2, 2, 'Alex')").setArgs(1,
"Sergi"));
 
         assertEquals(createPerson(1, "Sergi"), p.get(new Key(1)));
 
@@ -119,8 +119,8 @@ public class IgniteCacheInsertSqlQuerySelfTest extends IgniteCacheAbstractInsert
     public void testFieldsCaseSensitivity() {
         IgniteCache<Key2, Person> p = ignite(0).cache("K22P").withKeepBinary();
 
-        p.query(new SqlFieldsQuery("insert into \"Person2\" (\"Id\", \"id\", \"name\", \"IntVal\")
values (1, ?, ?, 5), " +
-            "(2, 3, 'Alex', 6)").setArgs(4, "Sergi"));
+        p.query(new SqlFieldsQuery("insert into \"Person2\" (\"Id\", \"id\", \"firstName\",
\"IntVal\") " +
+            "values (1, ?, ?, 5),  (2, 3, 'Alex', 6)").setArgs(4, "Sergi"));
 
         assertEquals(createPerson2(4, "Sergi", 5), p.get(new Key2(1)));
 
@@ -177,7 +177,8 @@ public class IgniteCacheInsertSqlQuerySelfTest extends IgniteCacheAbstractInsert
         IgniteCache<Key3, Person> p = ignite(0).cache("K32P").withKeepBinary();
 
         p.query(new SqlFieldsQuery(
-            "insert into Person (key, strKey, id, name) values (1, 'aa', ?, ?), (2, 'bb',
2, 'Alex')").setArgs(1, "Sergi"));
+            "insert into Person (key, strKey, id, firstName) values (1, 'aa', ?, ?), (2,
'bb', 2, 'Alex')")
+            .setArgs(1, "Sergi"));
 
         assertEquals(createPerson(1, "Sergi"), p.get(new Key3(1)));
 
@@ -194,7 +195,8 @@ public class IgniteCacheInsertSqlQuerySelfTest extends IgniteCacheAbstractInsert
         IgniteCache<Key4, Person> p = ignite(0).cache("K42P").withKeepBinary();
 
         p.query(new SqlFieldsQuery(
-            "insert into Person (key, strKey, id, name) values (1, 'aa', ?, ?), (2, 'bb',
2, 'Alex')").setArgs(1, "Sergi"));
+            "insert into Person (key, strKey, id, firstName) values (1, 'aa', ?, ?), (2,
'bb', 2, 'Alex')")
+            .setArgs(1, "Sergi"));
 
         assertEquals(createPerson(1, "Sergi"), p.get(new Key4(1)));
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/abc8b909/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheMergeSqlQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheMergeSqlQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheMergeSqlQuerySelfTest.java
index 0ff3fda..58d07af 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheMergeSqlQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheMergeSqlQuerySelfTest.java
@@ -32,7 +32,7 @@ public class IgniteCacheMergeSqlQuerySelfTest extends IgniteCacheAbstractInsertS
     public void testMergeWithExplicitKey() {
         IgniteCache<String, Person> p = ignite(0).cache("S2P").withKeepBinary();
 
-        p.query(new SqlFieldsQuery("merge into Person (_key, id, name) values ('s', ?, ?),
" +
+        p.query(new SqlFieldsQuery("merge into Person (_key, id, firstName) values ('s',
?, ?), " +
             "('a', 2, 'Alex')").setArgs(1, "Sergi"));
 
         assertEquals(createPerson(1, "Sergi"), p.get("s"));
@@ -52,7 +52,7 @@ public class IgniteCacheMergeSqlQuerySelfTest extends IgniteCacheAbstractInsertS
         assertEquals("Sergi", p.get("s"));
         assertEquals("Alex", p.get("a"));
 
-        p.query(new SqlFieldsQuery("merge into Person(_key, id, name) " +
+        p.query(new SqlFieldsQuery("merge into Person(_key, id, firstName) " +
             "(select substring(lower(_val), 0, 2), cast(length(_val) as int), _val from String)"));
 
         assertEquals(createPerson(5, "Sergi"), p.get("se"));
@@ -67,7 +67,7 @@ public class IgniteCacheMergeSqlQuerySelfTest extends IgniteCacheAbstractInsertS
         IgniteCache<Integer, Person> p = ignite(0).cache("I2P").withKeepBinary();
 
         p.query(new SqlFieldsQuery(
-            "merge into Person (_key, id, name) values (cast(? as int), ?, ?), (2, (5 - 3),
'Alex')")
+            "merge into Person (_key, id, firstName) values (cast(? as int), ?, ?), (2, (5
- 3), 'Alex')")
             .setArgs("1", 1, "Sergi"));
 
         assertEquals(createPerson(1, "Sergi"), p.get(1));
@@ -82,7 +82,7 @@ public class IgniteCacheMergeSqlQuerySelfTest extends IgniteCacheAbstractInsertS
         IgniteCache<Key, Person> p = ignite(0).cache("K2P").withKeepBinary();
 
         p.query(new SqlFieldsQuery(
-            "merge into Person (key, id, name) values (1, ?, ?), (2, 2, 'Alex')").setArgs(1,
"Sergi"));
+            "merge into Person (key, id, firstName) values (1, ?, ?), (2, 2, 'Alex')").setArgs(1,
"Sergi"));
 
         assertEquals(createPerson(1, "Sergi"), p.get(new Key(1)));
 
@@ -95,7 +95,7 @@ public class IgniteCacheMergeSqlQuerySelfTest extends IgniteCacheAbstractInsertS
     public void testFieldsCaseSensitivity() {
         IgniteCache<Key2, Person> p = ignite(0).cache("K22P").withKeepBinary();
 
-        p.query(new SqlFieldsQuery("merge into \"Person2\" (\"Id\", \"id\", \"name\", \"IntVal\")
values (1, ?, ?, 5), " +
+        p.query(new SqlFieldsQuery("merge into \"Person2\" (\"Id\", \"id\", \"firstName\",
\"IntVal\") values (1, ?, ?, 5), " +
             "(2, 3, 'Alex', 6)").setArgs(4, "Sergi"));
 
         assertEquals(createPerson2(4, "Sergi", 5), p.get(new Key2(1)));
@@ -127,7 +127,7 @@ public class IgniteCacheMergeSqlQuerySelfTest extends IgniteCacheAbstractInsertS
         IgniteCache<Key3, Person> p = ignite(0).cache("K32P").withKeepBinary();
 
         p.query(new SqlFieldsQuery(
-            "merge into Person (key, strKey, id, name) values (1, 'aa', ?, ?), (2, 'bb',
2, 'Alex')").setArgs(1, "Sergi"));
+            "merge into Person (key, strKey, id, firstName) values (1, 'aa', ?, ?), (2, 'bb',
2, 'Alex')").setArgs(1, "Sergi"));
 
         assertEquals(createPerson(1, "Sergi"), p.get(new Key3(1)));
 
@@ -144,7 +144,7 @@ public class IgniteCacheMergeSqlQuerySelfTest extends IgniteCacheAbstractInsertS
         IgniteCache<Key4, Person> p = ignite(0).cache("K42P").withKeepBinary();
 
         p.query(new SqlFieldsQuery(
-            "merge into Person (key, strKey, id, name) values (1, 'aa', ?, ?), (2, 'bb',
2, 'Alex')").setArgs(1, "Sergi"));
+            "merge into Person (key, strKey, id, firstName) values (1, 'aa', ?, ?), (2, 'bb',
2, 'Alex')").setArgs(1, "Sergi"));
 
         assertEquals(createPerson(1, "Sergi"), p.get(new Key4(1)));
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/abc8b909/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheUpdateSqlQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheUpdateSqlQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheUpdateSqlQuerySelfTest.java
index 332a082..58bcaac 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheUpdateSqlQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheUpdateSqlQuerySelfTest.java
@@ -61,8 +61,8 @@ public class IgniteCacheUpdateSqlQuerySelfTest extends IgniteCacheAbstractSqlDml
     public void testUpdateSimple() {
         IgniteCache p = cache();
 
-        QueryCursor<List<?>> c = p.query(new SqlFieldsQuery("update Person p
set p.id = p.id * 2, p.name = " +
-            "substring(p.name, 0, 2) where length(p._key) = ? or p.secondName like ?").setArgs(2,
"%ite"));
+        QueryCursor<List<?>> c = p.query(new SqlFieldsQuery("update Person p
set p.id = p.id * 2, p.firstName = " +
+            "substring(p.firstName, 0, 2) where length(p._key) = ? or p.secondName like ?").setArgs(2,
"%ite"));
 
         c.iterator();
 


Mime
View raw message