Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-4890

Don't allow prepared marker inside collections

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 1.2.0 beta 2
    • None
    • None
    • Low

    Description

      Currently the parser don't disallow preparing queries like (where l is a list<string>):

      INSERT INTO test (k, l) VALUES (0, [1, ?, 2])
      

      However, we don't handler it correctly. And in fact we can't really handle it properly currently since we return the name of the prepared column during prepare and here the marker don't correspond to a column (concretely, the code currently return l and list<string> for the name and type of the prepared value, which is incorrect). We also don't handle it during execute, though that last could in theory be fixed with some effort.

      But overall I don't think allowing that kind of things is really useful (you can of course prepare the whole collection), so I suggest just refusing it for now.

      Attachments

        1. 4890.txt
          2 kB
          Sylvain Lebresne

        Activity

          People

            slebresne Sylvain Lebresne
            slebresne Sylvain Lebresne
            Sylvain Lebresne
            Jonathan Ellis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: