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

Issues with parameters being escaped correctly in Python CQL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 0.8.4
    • None
    • Python CQL

    • Normal

    Description

      When using parameterised queries in Python CQL strings are not being escaped correctly.

      Query and Parameters:

      'UPDATE sites SET :col = :val WHERE KEY = :site_id'
      
      {'col': 'feed_stats:1312493736688033024',
       'site_id': '899d15e8-bd4a-11e0-bc8c-001fe14cba06',
       'val': "(dp0\nS'1'\np1\n(lp2\nI1\naI2\naI3\naI4\nasS'0'\np3\n(lp4\nI1\naI2\naI3\naI4\nasS'3'\np5\n(lp6\nI1\naI2\naI3\naI4\nasS'2'\np7\n(lp8\nI1\naI2\naI3\naI4\nas."}
      

      Query trying to be executed after processing parameters

           
      "UPDATE sites SET 'feed_stats:1312493736688033024' = '(dp0\nS''1''\np1\n(lp2\nI1\naI2\naI3\naI4\nasS''0''\np3\n(lp4\nI1\naI2\naI3\naI4\nasS''3''\np5\n(lp6\nI1\naI2\naI3\naI4\nasS''2''\np7\n(lp8\nI1\naI2\naI3\naI4\nas.' WHERE KEY = '899d15e8-bd4a-11e0-bc8c-001fe14cba06'"
      
      

      Attachments

        1. 2993-cql-grammar.txt
          0.5 kB
          Tom Hobbs
        2. 2993-pycql.txt
          1 kB
          Tom Hobbs
        3. 2993-system-test.txt
          1 kB
          Tom Hobbs

        Activity

          People

            thobbs Tom Hobbs
            bcvisin Blake Visin
            Tom Hobbs
            Pavel Yaskevich
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: