Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8955C10C92 for ; Thu, 1 Aug 2013 18:33:52 +0000 (UTC) Received: (qmail 76943 invoked by uid 500); 1 Aug 2013 18:33:51 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 76260 invoked by uid 500); 1 Aug 2013 18:33:50 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 75157 invoked by uid 99); 1 Aug 2013 18:33:49 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Aug 2013 18:33:49 +0000 Date: Thu, 1 Aug 2013 18:33:49 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-5972) Grammar doesn't accept OR operator without parentheses MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-5972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13726715#comment-13726715 ] ASF subversion and git services commented on DERBY-5972: -------------------------------------------------------- Commit 1509375 from [~kmarsden] in branch 'code/branches/10.8' [ https://svn.apache.org/r1509375 ] DERBY-5972 - Grammar doesn't accept OR operator without parentheses backport 1408136 from trunk to 10.8 Contributed by Knut Anders Hatlen > Grammar doesn't accept OR operator without parentheses > ------------------------------------------------------ > > Key: DERBY-5972 > URL: https://issues.apache.org/jira/browse/DERBY-5972 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.10.1.1 > Reporter: Knut Anders Hatlen > Assignee: Kathey Marsden > Fix For: 10.10.1.1 > > Attachments: d5972-1a.diff > > > The grammar doesn't accept the OR operator without parentheses in some constructs. > For example, in a select list: > ij> create table t(b1 boolean, b2 boolean); > 0 rows inserted/updated/deleted > ij> select b1 or b2 from t; > ERROR 42X01: Syntax error: Encountered "or" at line 1, column 11. (errorCode = 30000) > Issue the 'help' command for general information on IJ command syntax. > Any unrecognized commands are treated as potential SQL commands and executed directly. > Consult your DBMS server reference documentation for details of the SQL syntax supported by your server. > However, it does not fail if OR is replaced by AND, or if parentheses are used around the OR expression: > ij> select (b1 or b2) from t; > 1 > ----- > 0 rows selected > ij> select b1 and b2 from t; > 1 > ----- > 0 rows selected > Similar behaviour is seen in VALUES statements: > ij> values true or false; > ERROR 42X01: Syntax error: Encountered "or" at line 1, column 13. (errorCode = 30000) > Issue the 'help' command for general information on IJ command syntax. > Any unrecognized commands are treated as potential SQL commands and executed directly. > Consult your DBMS server reference documentation for details of the SQL syntax supported by your server. > ij> values (true or false); > 1 > ----- > true > 1 row selected > ij> values true and false; > 1 > ----- > false > 1 row selected -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira