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

Missing type checking on reused bind variables

    XMLWordPrintableJSON

Details

    • Correctness - API / Semantic Implementation
    • Normal
    • Normal
    • User Report
    • All
    • None

    Description

      A bind variable gets its type from its context (e.g. in INSERT INTO tab(a) VALUES(:var), :var has the same type as tab.a. But what if the same variable is used in contexts that have different types? Assume a and b have incompatible types:

      INSERT INTO ks.tab (id, a, b) VALUES(:id, :a, :a)

      The server should reject the query, but it doesn't.

      I think what happens is that one :a shadows the other, so the other :a can't even get a value.

      More complete reproducer attached.

      Attachments

        1. bind-var-type-conflict.py
          0.7 kB
          Avi Kivity

        Activity

          People

            Unassigned Unassigned
            avi.kivity Avi Kivity
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: