Derby
  1. Derby
  2. DERBY-4613

Make client driver treat BOOLEAN columns the same way as the embedded driver does.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.6.1.0
    • Fix Version/s: 10.7.1.1
    • Component/s: SQL
    • Labels:
      None
    • Issue & fix info:
      Patch Available
    • Bug behavior facts:
      Embedded/Client difference, Seen in production, Wrong query result

      Description

      The only operation currently allowed on BOOLEAN columns is to select them from the system tables. For instance, the following query selects BOOLEAN values:

      select systemalias from sys.sysaliases;

      There are discrepancies in how the embedded and client drivers handle these BOOLEAN columns. The embedded behavior is correct and the client behavior should conform. I will attach a spec describing what needs to be done.

      1. derby-4613-01-ac-correctBehavior.diff
        33 kB
        Rick Hillegas
      2. derby-4613-01-ab-correctBehavior.diff
        29 kB
        Rick Hillegas
      3. ASF.LICENSE.NOT.GRANTED--derby-4613-fs.html
        24 kB
        Rick Hillegas

        Issue Links

          Activity

          Gavin made changes -
          Workflow jira [ 12508218 ] Default workflow, editable Closed status [ 12800463 ]
          Rick Hillegas made changes -
          Fix Version/s 10.7.1.1 [ 12315564 ]
          Fix Version/s 10.7.1.0 [ 12314971 ]
          Rick Hillegas made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          Fix Version/s 10.7.0.0 [ 12314971 ]
          Hide
          Rick Hillegas added a comment -

          Committed derby-4613-01-ac-correctBehavior.diff at subversion revision 943465.

          Show
          Rick Hillegas added a comment - Committed derby-4613-01-ac-correctBehavior.diff at subversion revision 943465.
          Rick Hillegas made changes -
          Attachment derby-4613-01-ac-correctBehavior.diff [ 12444234 ]
          Hide
          Rick Hillegas added a comment -

          Attaching derby-4613-01-ac-correctBehavior.diff. This adds compatibility tests to the previous version of the patch.

          I verified the new tests by running them against combinations of the following client and server versions on jdk1.4, Java 5, and Java 6: I believe this patch is ready to be committed.

          10.0.2.1
          10.1.1.0
          10.2.2.0
          10.4.2.1
          10.6.1.0
          Trunk (10.7.0.0)

          Touches the following additional files:

          M java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/CompatibilitySuite.java
          M java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/JDBCDriverTest.java

          Show
          Rick Hillegas added a comment - Attaching derby-4613-01-ac-correctBehavior.diff. This adds compatibility tests to the previous version of the patch. I verified the new tests by running them against combinations of the following client and server versions on jdk1.4, Java 5, and Java 6: I believe this patch is ready to be committed. 10.0.2.1 10.1.1.0 10.2.2.0 10.4.2.1 10.6.1.0 Trunk (10.7.0.0) Touches the following additional files: M java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/CompatibilitySuite.java M java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/JDBCDriverTest.java
          Rick Hillegas made changes -
          Issue & fix info [Patch Available]
          Rick Hillegas made changes -
          Assignee Rick Hillegas [ rhillegas ]
          Rick Hillegas made changes -
          Attachment derby-4613-01-ab-correctBehavior.diff [ 12444141 ]
          Hide
          Rick Hillegas added a comment -

          Attaching derby-4613-01-ab-correctBehavior.diff. This patch implements the behavior described in the functional spec attached to this issue. This makes the embedded and network drivers treat BOOLEAN values identically provided that both the client and the server are Derby code at version 10.7 or higher. Regression tests passed cleanly for me. Compatibility tests need to be written to verify that clients and servers play well with down-rev partners.

          Touches the following files:

          -----------

          M java/engine/org/apache/derby/iapi/reference/DRDAConstants.java

          Exposes the DRDA and DB2 constants for the BOOLEAN datatype, as described in table 5-11 of section 5.7 (FD:OCA Meta Data Summary) of Volume 1 of version 4 of the DRDA spec.

          -----------

          M java/drda/org/apache/derby/impl/drda/AppRequester.java

          Server-side logic for determining whether the client-side of the connection is at 10.7 or higher.

          -----------

          M java/drda/org/apache/derby/impl/drda/FdocaConstants.java
          M java/drda/org/apache/derby/impl/drda/SQLTypes.java
          M java/drda/org/apache/derby/impl/drda/DRDAConnThread.java

          Server-side logic for sending BOOLEAN values and their corresponding metadata.

          -----------

          M java/client/org/apache/derby/client/net/NetConnection.java
          M java/client/org/apache/derby/client/net/NetDatabaseMetaData.java
          M java/client/org/apache/derby/client/am/DatabaseMetaData.java

          Client-side logic determining whether the server-side of a connection is at 10.7 or higher. I found that I needed this logic in the abstract am package. While I was in there, I moved a number of similar methods out of the concrete net package up into the abstract am package. Ultimately, I think that the am package should be eliminated. See DERBY-4648.

          -----------

          M java/client/org/apache/derby/client/net/Typdef.java
          M java/client/org/apache/derby/client/net/NetStatementRequest.java
          M java/client/org/apache/derby/client/am/Cursor.java
          M java/client/org/apache/derby/client/am/Types.java
          M java/client/org/apache/derby/client/am/SignedBinary.java
          M java/client/org/apache/derby/client/am/ColumnMetaData.java

          Client-side logic for reading BOOLEAN values and their corresponding metadata.

          -----------

          M java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
          M java/testing/org/apache/derbyTesting/functionTests/master/showindex_client.out

          Changes to the tests to reflect the new behavior of the network client.

          Show
          Rick Hillegas added a comment - Attaching derby-4613-01-ab-correctBehavior.diff. This patch implements the behavior described in the functional spec attached to this issue. This makes the embedded and network drivers treat BOOLEAN values identically provided that both the client and the server are Derby code at version 10.7 or higher. Regression tests passed cleanly for me. Compatibility tests need to be written to verify that clients and servers play well with down-rev partners. Touches the following files: ----------- M java/engine/org/apache/derby/iapi/reference/DRDAConstants.java Exposes the DRDA and DB2 constants for the BOOLEAN datatype, as described in table 5-11 of section 5.7 (FD:OCA Meta Data Summary) of Volume 1 of version 4 of the DRDA spec. ----------- M java/drda/org/apache/derby/impl/drda/AppRequester.java Server-side logic for determining whether the client-side of the connection is at 10.7 or higher. ----------- M java/drda/org/apache/derby/impl/drda/FdocaConstants.java M java/drda/org/apache/derby/impl/drda/SQLTypes.java M java/drda/org/apache/derby/impl/drda/DRDAConnThread.java Server-side logic for sending BOOLEAN values and their corresponding metadata. ----------- M java/client/org/apache/derby/client/net/NetConnection.java M java/client/org/apache/derby/client/net/NetDatabaseMetaData.java M java/client/org/apache/derby/client/am/DatabaseMetaData.java Client-side logic determining whether the server-side of a connection is at 10.7 or higher. I found that I needed this logic in the abstract am package. While I was in there, I moved a number of similar methods out of the concrete net package up into the abstract am package. Ultimately, I think that the am package should be eliminated. See DERBY-4648 . ----------- M java/client/org/apache/derby/client/net/Typdef.java M java/client/org/apache/derby/client/net/NetStatementRequest.java M java/client/org/apache/derby/client/am/Cursor.java M java/client/org/apache/derby/client/am/Types.java M java/client/org/apache/derby/client/am/SignedBinary.java M java/client/org/apache/derby/client/am/ColumnMetaData.java Client-side logic for reading BOOLEAN values and their corresponding metadata. ----------- M java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java M java/testing/org/apache/derbyTesting/functionTests/master/showindex_client.out Changes to the tests to reflect the new behavior of the network client.
          Hide
          Knut Anders Hatlen added a comment -

          Thanks for writing this clear spec, Rick. I agree that the embedded driver behaves correctly in these cases and that we should change the client driver to match, with the very reasonable exceptions mentioned in the spec. +1 from me.

          Show
          Knut Anders Hatlen added a comment - Thanks for writing this clear spec, Rick. I agree that the embedded driver behaves correctly in these cases and that we should change the client driver to match, with the very reasonable exceptions mentioned in the spec. +1 from me.
          Rick Hillegas made changes -
          Attachment derby-4613-fs.html [ 12441542 ]
          Hide
          Rick Hillegas added a comment -

          Attaching functional spec for the work to be done here.

          Show
          Rick Hillegas added a comment - Attaching functional spec for the work to be done here.
          Rick Hillegas made changes -
          Field Original Value New Value
          Link This issue is part of DERBY-499 [ DERBY-499 ]
          Rick Hillegas created issue -

            People

            • Assignee:
              Rick Hillegas
              Reporter:
              Rick Hillegas
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development