Cassandra
  1. Cassandra
  2. CASSANDRA-5349

Add binary protocol support for bind variables to non-prepared statements

    Details

    • Type: Task Task
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Fix Version/s: 2.0 beta 1
    • Component/s: CQL
    • Labels:

      Description

      Currently, the binary protocol allows requests as "string" or "[prepared statement] id + bind vars". Allowing "string + bind vars" as well would simplify life for users with one-off statements and not have to choose between adding boilerplate for PS, and having to manually escape parameters, which is particularly painful for binary data.

      1. 0001-CASSANDRA-5349-binary-protocol-support-for-binding-v.patch
        24 kB
        Marcus Eriksson
      2. 0001-CASSANDRA-5349.patch
        7 kB
        Marcus Eriksson
      3. 0001-5349-v3.patch
        7 kB
        Marcus Eriksson

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Patch Available Patch Available
          24d 18h 15m 1 Marcus Eriksson 08/Apr/13 11:28
          Patch Available Patch Available Resolved Resolved
          28d 7h 36m 1 Marcus Eriksson 06/May/13 19:05
          Aleksey Yeschenko made changes -
          Component/s CQL [ 12328220 ]
          Component/s API [ 12313742 ]
          Marcus Eriksson made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Marcus Eriksson added a comment -

          committed as df723af8a6c04536abd2b4a48cd101f3b2e96746, thanks

          Show
          Marcus Eriksson added a comment - committed as df723af8a6c04536abd2b4a48cd101f3b2e96746, thanks
          Hide
          Sylvain Lebresne added a comment -

          lgtm, +1

          Show
          Sylvain Lebresne added a comment - lgtm, +1
          Marcus Eriksson made changes -
          Attachment 0001-5349-v3.patch [ 12581574 ]
          Hide
          Marcus Eriksson added a comment -

          v3 adds the value count and values last

          also calls process() with empty list

          Show
          Marcus Eriksson added a comment - v3 adds the value count and values last also calls process() with empty list
          Hide
          Sylvain Lebresne added a comment -

          Wonder if it wouldn't be worth to put the new values at the end of the message, after the consistency level? That way, we could make that last part optional (i.e. the server would check whether there is remaining bytes to read after the CL). The 2 small advantages would be that 1) if you don't have bind variables, we could save the short encoding the number of values and 2) would made it marginally easier on the client if they want to support both v1 and v2 (as in the case of no binding variables, they don't have to bother about which version is in use). Not huge pros, but if there is no cons...

          Nit:

          • we can have the old QP.process() call the new one with an empty list.
          Show
          Sylvain Lebresne added a comment - Wonder if it wouldn't be worth to put the new values at the end of the message, after the consistency level? That way, we could make that last part optional (i.e. the server would check whether there is remaining bytes to read after the CL). The 2 small advantages would be that 1) if you don't have bind variables, we could save the short encoding the number of values and 2) would made it marginally easier on the client if they want to support both v1 and v2 (as in the case of no binding variables, they don't have to bother about which version is in use). Not huge pros, but if there is no cons... Nit: we can have the old QP.process() call the new one with an empty list.
          Marcus Eriksson made changes -
          Attachment 0001-CASSANDRA-5349.patch [ 12580260 ]
          Hide
          Marcus Eriksson added a comment -

          rebased and updated spec doc

          Show
          Marcus Eriksson added a comment - rebased and updated spec doc
          Hide
          Sylvain Lebresne added a comment -

          Alright, would you mind rebasing once you've committed CASSANDRA-5436? And if you could include the update of the specification doc that would be great, I'd rather keep the spec up to date at all time or things will fall through the cracks.

          Show
          Sylvain Lebresne added a comment - Alright, would you mind rebasing once you've committed CASSANDRA-5436 ? And if you could include the update of the specification doc that would be great, I'd rather keep the spec up to date at all time or things will fall through the cracks.
          Sylvain Lebresne made changes -
          Labels cql protocol
          Jonathan Ellis made changes -
          Reviewer jbellis slebresne
          Marcus Eriksson made changes -
          Link This issue is blocked by CASSANDRA-5436 [ CASSANDRA-5436 ]
          Sylvain Lebresne made changes -
          Fix Version/s 2.0 [ 12322954 ]
          Fix Version/s 1.2.4 [ 12324157 ]
          Marcus Eriksson made changes -
          Marcus Eriksson made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Hide
          Marcus Eriksson added a comment -

          adds bind variables to non-prepared statements

          also adds rudimentary protocol/message-versioning, this is backwards compatible but im creating a new ticket to do this properly (ie connecting with new clients to old servers is currently not possible for example)

          Show
          Marcus Eriksson added a comment - adds bind variables to non-prepared statements also adds rudimentary protocol/message-versioning, this is backwards compatible but im creating a new ticket to do this properly (ie connecting with new clients to old servers is currently not possible for example)
          Jonathan Ellis made changes -
          Field Original Value New Value
          Assignee Sylvain Lebresne [ slebresne ] Marcus Eriksson [ krummas ]
          Jonathan Ellis created issue -

            People

            • Assignee:
              Marcus Eriksson
              Reporter:
              Jonathan Ellis
              Reviewer:
              Sylvain Lebresne
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development