You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Olav Sandstaa (JIRA)" <de...@db.apache.org> on 2006/08/30 12:07:22 UTC

[jira] Created: (DERBY-1783) Logical error in code for determining mode for opening of log files

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

        

[jira] Updated: (DERBY-1783) Logical error in code for determining mode for opening of log files

Posted by "Olav Sandstaa (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1783?page=all ]

Olav Sandstaa updated DERBY-1783:
---------------------------------

    Attachment: rwsync.diff

Patch that fixes the logical code error by adding parentheses around the OR clause. In addition one minor fix to the javadoc for the method is done. 

The patch touches the following file:

M      java/engine/org/apache/derby/impl/io/DirFile4.java

I have run derbyall on Solaris 10 x86 with JVM 1.5 with no failures. The patch is ready for review and commit.

> 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
>         Assigned To: Olav Sandstaa
>            Priority: Trivial
>             Fix For: 10.3.0.0
>
>         Attachments: rwsync.diff
>
>
> 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

        

[jira] Updated: (DERBY-1783) Logical error in code for determining mode for opening of log files

Posted by "Olav Sandstaa (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1783?page=all ]

Olav Sandstaa updated DERBY-1783:
---------------------------------

    Fix Version/s: 10.3.0.0
       Derby Info: [Patch Available]

> 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
>         Assigned To: Olav Sandstaa
>            Priority: Trivial
>             Fix For: 10.3.0.0
>
>         Attachments: rwsync.diff
>
>
> 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

        

[jira] Assigned: (DERBY-1783) Logical error in code for determining mode for opening of log files

Posted by "Olav Sandstaa (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1783?page=all ]

Olav Sandstaa reassigned DERBY-1783:
------------------------------------

    Assignee: Olav Sandstaa

> 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
>         Assigned To: 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

        

[jira] Resolved: (DERBY-1783) Logical error in code for determining mode for opening of log files

Posted by "Olav Sandstaa (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1783?page=all ]

Olav Sandstaa resolved DERBY-1783.
----------------------------------

    Resolution: Fixed
    Derby Info:   (was: [Patch Available])

Thanks for reviewing and committing this patch, Suresh.

I have verified the fix on trunk.

> 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
>         Assigned To: Olav Sandstaa
>            Priority: Trivial
>             Fix For: 10.3.0.0
>
>         Attachments: rwsync.diff
>
>
> 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

        

[jira] Commented: (DERBY-1783) Logical error in code for determining mode for opening of log files

Posted by "Suresh Thalamati (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1783?page=comments#action_12432019 ] 
            
Suresh Thalamati commented on DERBY-1783:
-----------------------------------------

Committted the patch (rwsyn.diff) to trunk,  revision 439128.  Thanks Olav, 


> 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
>         Assigned To: Olav Sandstaa
>            Priority: Trivial
>             Fix For: 10.3.0.0
>
>         Attachments: rwsync.diff
>
>
> 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

        

[jira] Commented: (DERBY-1783) Logical error in code for determining mode for opening of log files

Posted by "Suresh Thalamati (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1783?page=comments#action_12431642 ] 
            
Suresh Thalamati commented on DERBY-1783:
-----------------------------------------

Good Catch Olav.  I will review and commit the patch. 


> 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
>         Assigned To: Olav Sandstaa
>            Priority: Trivial
>             Fix For: 10.3.0.0
>
>         Attachments: rwsync.diff
>
>
> 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

        

[jira] Closed: (DERBY-1783) Logical error in code for determining mode for opening of log files

Posted by "Olav Sandstaa (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1783?page=all ]

Olav Sandstaa closed DERBY-1783.
--------------------------------


Problem fixed on trunk.

> 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
>         Assigned To: Olav Sandstaa
>            Priority: Trivial
>             Fix For: 10.3.0.0
>
>         Attachments: rwsync.diff
>
>
> 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

        

[jira] Closed: (DERBY-1783) Logical error in code for determining mode for opening of log files

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren closed DERBY-1783.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.2.1.6
                   10.2.2.0

> Logical error in code for determining mode for opening of log files
> -------------------------------------------------------------------
>
>                 Key: DERBY-1783
>                 URL: https://issues.apache.org/jira/browse/DERBY-1783
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.1.6
>         Environment: JVM 1.4.2 and later
>            Reporter: Olav Sandstaa
>         Assigned To: Olav Sandstaa
>            Priority: Trivial
>             Fix For: 10.3.0.0, 10.2.2.0, 10.2.1.6
>
>         Attachments: rwsync.diff
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (DERBY-1783) Logical error in code for determining mode for opening of log files

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren reopened DERBY-1783:
---------------------------------------


> Logical error in code for determining mode for opening of log files
> -------------------------------------------------------------------
>
>                 Key: DERBY-1783
>                 URL: https://issues.apache.org/jira/browse/DERBY-1783
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.2.1.6
>         Environment: JVM 1.4.2 and later
>            Reporter: Olav Sandstaa
>         Assigned To: Olav Sandstaa
>            Priority: Trivial
>             Fix For: 10.2.1.6, 10.2.2.0, 10.3.0.0
>
>         Attachments: rwsync.diff
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.