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

ASF GitHub Bot commented on GEODE-8179:
---------------------------------------

alb3rtobr opened a new pull request #5187:
URL: https://github.com/apache/geode/pull/5187


   When parsing the user input in gfsh, the first `=` character position was 
used to split strings which were expected to follow the pattern 
`--parameter=value`. But if the `=` sign is not introduced, the `=` is deleted 
in `--parameter` and `value` (if exists).
   
   In the case of `--query` parameter, the value of the parameter (the query 
itself) is very likely to contain a `=`, which could be removed from the query.
   
   With this modification, if a query is introduced without the `=` between 
`--query` and the query statement, the `=` will not be removed from the query.
   
   I also have included the `--J` parameter in this check, because its value is 
always containing a `=`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> gfsh query command returns incorrect results if '=' sign is missing for query 
> option
> ------------------------------------------------------------------------------------
>
>                 Key: GEODE-8179
>                 URL: https://issues.apache.org/jira/browse/GEODE-8179
>             Project: Geode
>          Issue Type: Bug
>          Components: gfsh
>            Reporter: Eric Shu
>            Assignee: Alberto Bustamante Reyes
>            Priority: Major
>
> gfsh returns correct result when "=" is there for the query option:
> gfsh>query --query="Select ID from /portfolio where ID = 3"
> Result : true
> Limit  : 100
> Rows   : 1
> Result
> ------
> 3
> It returns wrong result when "=" is missing for the query option.
> gfsh>query --query "Select ID from /portfolio where ID <= 3 "
> Result : true
> Limit  : 100
> Rows   : 3
> Result
> ------
> 0
> 1
> 2
> gfsh>query --query "<trace> Select ID from /portfolio where ID = 3 "
> Result  : false
> Message : Query is invalid due to error : <Syntax error in query: unexpected 
> token: ID>
> gfsh>query --query "<trace> Select ID from /portfolio where ID == 3 "
> Result      : true
> Limit       : 100
> Rows        : 1
> Query Trace : Query Executed in 0.968059 ms; indexesUsed(0)
> Result
> ------
> 3
> gfsh>query --query "<trace> Select ID from /portfolio where ID =<= 3 "
> Result      : true
> Limit       : 100
> Rows        : 4
> Query Trace : Query Executed in 1.427194 ms; indexesUsed(0)
> Result
> ------
> 0
> 1
> 2
> 3
> Seems that first '=' in the query string is discarded by gfsh. 
> Either fail the query if the query option'=' is missing or gfsh should return 
> correct result from the query string.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to