db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hao Zhong (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DERBY-6951) ClientPreparedStatement may be buggy
Date Thu, 13 Jul 2017 08:47:00 GMT
Hao Zhong created DERBY-6951:
--------------------------------

             Summary: ClientPreparedStatement may be buggy
                 Key: DERBY-6951
                 URL: https://issues.apache.org/jira/browse/DERBY-6951
             Project: Derby
          Issue Type: Bug
          Components: SQL
            Reporter: Hao Zhong


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:
{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();
        }
    }
{code}
The fixed code is as follow:
{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( checkForEscapedCallWithResult( parameterIndex
) );

                ...
        }
        catch ( SqlException se )
        {
            throw se.getSQLException();
        }
    }
{code}

The repair can be applied to ClientPreparedStatement.java



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message