Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6951

ClientPreparedStatement may be buggy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • SQL
    • None

    Description

      DERBY-1610 fixed some bugs in PreparedStatement.java. I find that the buggy file is similar to ClientPreparedStatement.java. For example, both files have the following code:

      public void setBigDecimal(int parameterIndex, java.math.BigDecimal x) throws SQLException {
              try
              {
                  synchronized (connection_) {
                      if (agent_.loggingEnabled()) {
                          agent_.logWriter_.traceEntry(this, "setBigDecimal", parameterIndex, x);
                      }
                      
                      final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);
      
                    ...
              }
              catch ( SqlException se )
              {
                  throw se.getSQLException();
              }
          }
      

      The fixed code is as follow:

      public void setBigDecimal(int parameterIndex, java.math.BigDecimal x) throws SQLException {
              try
              {
                  synchronized (connection_) {
                      if (agent_.loggingEnabled()) {
                          agent_.logWriter_.traceEntry(this, "setBigDecimal", parameterIndex, x);
                      }
                      
                      final int paramType = 
                          getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );
      
                      ...
              }
              catch ( SqlException se )
              {
                  throw se.getSQLException();
              }
          }
      

      The repair can be applied to ClientPreparedStatement.java

      Attachments

        Activity

          People

            lashan faliq Lashan Faliq
            haozhong Hao Zhong
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: