Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 20754 invoked from network); 30 Aug 2006 10:10:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Aug 2006 10:10:45 -0000 Received: (qmail 22529 invoked by uid 500); 30 Aug 2006 10:10:43 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 22487 invoked by uid 500); 30 Aug 2006 10:10:42 -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 22394 invoked by uid 99); 30 Aug 2006 10:10:42 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Aug 2006 03:10:41 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Aug 2006 03:10:40 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 591027142D0 for ; Wed, 30 Aug 2006 10:07:22 +0000 (GMT) Message-ID: <6465284.1156932442342.JavaMail.jira@brutus> Date: Wed, 30 Aug 2006 03:07:22 -0700 (PDT) From: "Olav Sandstaa (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Created: (DERBY-1783) Logical error in code for determining mode for opening of log files MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Logical error in code for determining mode for opening of log files ------------------------------------------------------------------- Key: DERBY-1783 URL: http://issues.apache.org/jira/browse/DERBY-1783 Project: Derby Issue Type: Bug Components: Store Affects Versions: 10.2.1.0 Environment: JVM 1.4.2 and later Reporter: Olav Sandstaa Priority: Trivial There is a logical error in the following function in DirFile4.java for determining which mode to use when opening a new log file: public StorageRandomAccessFile getRandomAccessFile( String mode) throws FileNotFoundException { // Assume that modes "rws" and "rwd" are not supported. if(!rwsOK && "rws".equals( mode) || "rwd".equals( mode)) mode = "rw"; return new DirRandomAccessFile4( (File) this, mode); } // end of getRandomAccessFile The expression in the if test is missing parentheses around the OR expression making it return the wrong value for one case. If "rwd" mode is requested for the file (and this is supported by the JVM), the file is opened with "rw" instead of "rwd". NOTE: this bug does not effect any current Derby versions since as far as I know "rwd" is never used for log files. I came across it when experimenting with using "rwd" for the log. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira