You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Kevin Liew (JIRA)" <ji...@apache.org> on 2016/12/22 18:57:58 UTC
[jira] [Comment Edited] (PHOENIX-2170) WHERE condition with string
expression returns incorrect results
[ https://issues.apache.org/jira/browse/PHOENIX-2170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15770796#comment-15770796 ]
Kevin Liew edited comment on PHOENIX-2170 at 12/22/16 6:57 PM:
---------------------------------------------------------------
Yes, the unit tests passed locally. Sorry that was a bit confusing, I meant verify that this is fixed, not verify that the bug persists.
was (Author: kliew):
Yes, the unit tests passed locally.
> WHERE condition with string expression returns incorrect results
> ----------------------------------------------------------------
>
> Key: PHOENIX-2170
> URL: https://issues.apache.org/jira/browse/PHOENIX-2170
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.5.0
> Reporter: Dan Meany
> Assignee: Kevin Liew
> Labels: verify
> Fix For: 4.10.0
>
> Attachments: PHOENIX-2170.patch
>
> Original Estimate: 504h
> Remaining Estimate: 504h
>
> Results incorrect for string expression in where clause.
> {code:sql}
> create table TEST (ID BIGINT PRIMARY KEY, FIRST_NAME VARCHAR,LAST_NAME VARCHAR);
> upsert into TEST (ID, FIRST_NAME, LAST_NAME) values (1,'Joe','Smith');
> {code}
> /* incorrectly returns 0 */
> {code:sql}
> select count(*) from TEST where lower(FIRST_NAME || ' ' || LAST_NAME) = 'joe smith';
> {code}
> /* incorrectly returns no rows */
> {code:sql}
> select * from TEST where lower(FIRST_NAME || ' ' || LAST_NAME) = 'joe smith';
> {code}
> /* correctly returns 1 */
> {code:sql}
> select count(*) from TEST where lower(FIRST_NAME || ' ' ) = 'joe ';
> select count(*) from TEST where lower(' ' || LAST_NAME) = ' smith';
> select count(*) from TEST where lower(FIRST_NAME || ' ' || ' ') = 'joe ';
> {code}
> /* correctly returns 'joe smith' */
> {code:sql}
> select LOWER(FIRST_NAME||' '||LAST_NAME) from TEST;
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)