[ 
https://issues.apache.org/jira/browse/PHOENIX-4083?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Josh Elser updated PHOENIX-4083:
--------------------------------
    Summary: Incorrect conditional when including OFFSET into explain plan  
(was: May cause a wrong sting value)

> Incorrect conditional when including OFFSET into explain plan
> -------------------------------------------------------------
>
>                 Key: PHOENIX-4083
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4083
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: JC
>            Priority: Trivial
>
> Hi
> I've found a suspicious code in a recent github repo.
> Path: 
> phoenix-core/src/main/java/org/apache/phoenix/iterate/OrderedResultIterator.java
> {code:java}
> 292     public void explain(List<String> planSteps) {
> 293         delegate.explain(planSteps);
> 294         planSteps.add("CLIENT" + (offset != null ? "" : " OFFSET " + 
> offset)
> 295                 + (limit == null ? "" : " TOP " + limit + " ROW" + (limit 
> == 1 ? "" : "S")) + " SORTED BY "
> 296                 + orderByExpressions.toString());
> 297     }
> {code}
> In Line 294, the condition, `offset != null', should be `offset == null'? 
> Otherwise, the string value willl be `CLIENT OFFSET null' only when the 
> offset is null. (c.f. limit returns an empty string when it is null.) Since I 
> don't have domain knowledge of this project, I have no idea if this is 
> intended. But I wanted to report this just in case.
> Thanks!



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to