Cassandra
  1. Cassandra
  2. CASSANDRA-2664

JDBC driver for CQL works only with Strings

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Fix Version/s: None
    • Component/s: API
    • Labels:
    • Environment:

      It happens to JDBC driver for both: 0.8.0 beta version and 0.8.0-rc1

      Description

      CassandraPreparedStatement.java

      Line 141:

      String stringParam = makeCqlString(type.toString(param));

      It crashes with ClassCastException for all parameters that are not Strings. It is because, when the method applyDualBindings is called from makeUpdate it ALWAYS get one and the same "type" as parameter. In fact it is a comparator of columnfamily itself.

      In my case it is UTF8Type. And UTF8Type.toString() method expects only Strings.

      I think it must be column-dependent.

        Activity

        Roman Kuzmin created issue -
        Hide
        Jonathan Ellis added a comment -

        How are you getting that path to be invoked w/ non-Strings?

        Can you submit a patch to PreparedStatementTest that reproduces the error?

        Show
        Jonathan Ellis added a comment - How are you getting that path to be invoked w/ non-Strings? Can you submit a patch to PreparedStatementTest that reproduces the error?
        Hide
        Jonathan Ellis added a comment -

        Any update on this?

        Did you try rc1?

        Show
        Jonathan Ellis added a comment - Any update on this? Did you try rc1?
        Hide
        Rick Shaw added a comment -

        This appears closable... There is no such method in the current code and all current methods in the PreparedStatement unit test succeed.

        Show
        Rick Shaw added a comment - This appears closable... There is no such method in the current code and all current methods in the PreparedStatement unit test succeed.
        Jonathan Ellis made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]
        Gavin made changes -
        Workflow no-reopen-closed, patch-avail [ 12613894 ] patch-available, re-open possible [ 12751668 ]
        Gavin made changes -
        Workflow patch-available, re-open possible [ 12751668 ] reopen-resolved, no closed status, patch-avail, testing [ 12757170 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        102d 9h 4m 1 Jonathan Ellis 28/Aug/11 22:34

          People

          • Assignee:
            Unassigned
            Reporter:
            Roman Kuzmin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 4h
              4h
              Remaining:
              Remaining Estimate - 4h
              4h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development