#ignite-757 - decimal temporary fix

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

Branch: refs/heads/ignite-286
Commit: f674ec7bb438215316e9a2d1291d44297ee364b6
Parents: 2fb6213
Author: S.Vladykin <svlady...@gridgain.com>
Authored: Mon Apr 27 11:11:13 2015 +0300
Committer: S.Vladykin <svlady...@gridgain.com>
Committed: Mon Apr 27 11:11:13 2015 +0300

----------------------------------------------------------------------
 .../processors/query/h2/twostep/msg/GridH2Decimal.java  | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f674ec7b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Decimal.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Decimal.java
 
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Decimal.java
index ea1b87c..c51df77 100644
--- 
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Decimal.java
+++ 
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/msg/GridH2Decimal.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.query.h2.twostep.msg;
 
 import org.apache.ignite.plugin.extensions.communication.*;
+import org.h2.util.*;
 import org.h2.value.*;
 
 import java.math.*;
@@ -26,10 +27,9 @@ import java.nio.*;
 /**
  * H2 Decimal.
  */
-// TODO optimize representation
 public class GridH2Decimal extends GridH2ValueMessage {
     /** */
-    private String b;
+    private byte[] b;
 
     /**
      *
@@ -44,12 +44,12 @@ public class GridH2Decimal extends GridH2ValueMessage {
     public GridH2Decimal(Value val) {
         assert val.getType() == Value.DECIMAL : val.getType();
 
-        b = val.getString();
+        b = Utils.serialize(val.getBigDecimal(), null);
     }
 
     /** {@inheritDoc} */
     @Override public Value value() {
-        return ValueDecimal.get(new BigDecimal(b));
+        return ValueDecimal.get((BigDecimal)Utils.deserialize(b, null));
     }
 
     /** {@inheritDoc} */
@@ -68,7 +68,7 @@ public class GridH2Decimal extends GridH2ValueMessage {
 
         switch (writer.state()) {
             case 0:
-                if (!writer.writeString("b", b))
+                if (!writer.writeByteArray("b", b))
                     return false;
 
                 writer.incrementState();
@@ -90,7 +90,7 @@ public class GridH2Decimal extends GridH2ValueMessage {
 
         switch (reader.state()) {
             case 0:
-                b = reader.readString("b");
+                b = reader.readByteArray("b");
 
                 if (!reader.isLastRead())
                     return false;

Reply via email to