Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 641D1200BE3 for ; Thu, 22 Dec 2016 19:34:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 62A3C160B27; Thu, 22 Dec 2016 18:34:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B63CB160B1B for ; Thu, 22 Dec 2016 19:33:59 +0100 (CET) Received: (qmail 56187 invoked by uid 500); 22 Dec 2016 18:33:58 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 56163 invoked by uid 99); 22 Dec 2016 18:33:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Dec 2016 18:33:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id B67E52C1F5A for ; Thu, 22 Dec 2016 18:33:58 +0000 (UTC) Date: Thu, 22 Dec 2016 18:33:58 +0000 (UTC) From: "James Taylor (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-2170) WHERE condition with string expression returns incorrect results MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 22 Dec 2016 18:34:00 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-2170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15770750#comment-15770750 ] James Taylor commented on PHOENIX-2170: --------------------------------------- That's not good. Looks like a bug in LOWER or the concat operator. Does this return the expected row? {code} select * from TEST where lower(FIRST_NAME) || ' ' || lower(LAST_NAME) = 'joe smith'; {code} > 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)