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

Most CQL3 functions should handle null gracefully

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 1.2.10
    • None
    • None
    • Low

    Description

      Currently, we don't allow null parameters for functions. So

      UPDATE test SET d=dateOf(null) WHERE k=0
      

      is basically an invalid query. Unfortunately, there's at least one case where we don't validate correctly, namely if we do:

      SELECT k, dateOf(t) FROM test
      

      In that case, if for any of the row t is null, we end up with a server side NPE. But more importantly, throwing an InvalidException in that case would be pretty inconvenient and actually somewhat wrong since the query is not invalid in itself. So, at least in that latter case, we want dateOf(t) == null when t == null. And if we do that, I suggest making it always the case (i.e. make the first query valid but assigning null to d).

      Attachments

        1. 5910-v2.txt
          3 kB
          Sylvain Lebresne
        2. 5910.txt
          5 kB
          Sylvain Lebresne

        Activity

          People

            slebresne Sylvain Lebresne
            slebresne Sylvain Lebresne
            Sylvain Lebresne
            Aleksey Yeschenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: