[ 
https://issues.apache.org/jira/browse/GEODE-533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14993947#comment-14993947
 ] 

ASF subversion and git services commented on GEODE-533:
-------------------------------------------------------

Commit 1b8a35734a7808623f0247ad5f82de92aea70c14 in incubator-geode's branch 
refs/heads/develop from [~jens.deppe]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-geode.git;h=1b8a357 ]

GEODE-533: GFSH query swaps row values when they are null


> GFSH query swaps row values when they are null
> ----------------------------------------------
>
>                 Key: GEODE-533
>                 URL: https://issues.apache.org/jira/browse/GEODE-533
>             Project: Geode
>          Issue Type: Bug
>          Components: management
>            Reporter: Jens Deppe
>            Assignee: Jens Deppe
>
> gfsh shows incorrect value for the name String field when value is null it 
> swaps the values between rows as can be seen in the GFSH output in the below.
> Domain object Customer
> {noformat}
> package com.gopivotal.gemfire.sample;
> import java.io.Serializable;
> import java.util.List;
> public class Customer implements Serializable {       
>   private static final long serialVersionUID = 1L;
>   private String name;
>   private Integer custId;
>   public Customer() {
>   }
>   public Customer(String name,Integer custId) {
>     this.setCustId(custId); this.setName(name);
>   }
>   public String getName() {
>     return name;
>   }
>   public void setName(String name) {
>     this.name = name;
>   }
>   public Integer getCustId() {
>     return custId; 
>   }
>   public void setCustId(Integer custId) {
>     this.custId = custId;
>   }
>   public String toString() {
>     StringBuffer sb = new StringBuffer();
>     sb.append("nothing");
>     return sb.toString();
>   }
> }
> {noformat}
> Data Putter
> {noformat}
> package com.gopivotal.gemfire.sample;
> import java.util.ArrayList;
> import java.util.List;
> import com.gemstone.gemfire.cache.Cache;
> import com.gemstone.gemfire.cache.Region;
> import com.gemstone.gemfire.cache.client.ClientCache;
> import com.gemstone.gemfire.cache.client.ClientCacheFactory;
> import com.gemstone.gemfire.cache.client.ClientRegionFactory;
> import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
> import com.gemstone.gemfire.cache.partition.PartitionRegionHelper;
> public class MyDataPutterGFSHSwapNull {
>   public static void main(String[] argv) throws Exception {
>     MyDataPutterGFSHSwapNull mdp = new MyDataPutterGFSHSwapNull();    
>     mdp.fire(Integer.parseInt("100000"));
>   }
>   public void fire(int count) throws Exception {
>     ClientCacheFactory ccf=new ClientCacheFactory(); 
>     ccf.addPoolLocator("localhost", 10334);
>     ClientCache ccache=ccf.create();
>     ClientRegionFactory rf; rf = 
> cache.createClientRegionFactory(ClientRegionShortcut.PROXY);
>     Region<Integer,Customer> customer=rf.create("Customer");   
>     customer.put(new Integer(1), new Customer(null, 1));
>     customer.put(new Integer(2), new Customer("Tommy", 2));  
>     ccache.close();
>   }
> }
> {noformat}
> GFSH command and result:
> ------------------------
> {noformat}
> gfsh>query --query="select * from /Customer"
> Result : true
> startCount : 0
> endCount : 20
> Rows : 2
> Query Trace : Query Executed in 4.920503 ms; indexesUsed(0)
> custId | name
> ------ | -----
> 1 | Tommy
> 2 | null
> NEXT_STEP_NAME : END
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to