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

CQL should not allow an empty string as column identifier

    XMLWordPrintableJSON

Details

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

    Description

      CQL currently allows users to create a table with an empty string as column identifier:

      CREATE TABLE t (k int primary key, "" int);
      

      Which results in the following table:

      CREATE TABLE t (
        k int,
        "" int,
        PRIMARY KEY (k)
      ) WITH
        bloom_filter_fp_chance=0.010000 AND
        caching='KEYS_ONLY' AND
        comment='' AND
        dclocal_read_repair_chance=0.000000 AND
        gc_grace_seconds=864000 AND
        index_interval=128 AND
        read_repair_chance=0.100000 AND
        replicate_on_write='true' AND
        populate_io_cache_on_flush='false' AND
        default_time_to_live=0 AND
        speculative_retry='NONE' AND
        memtable_flush_period_in_ms=0 AND
        compaction={'class': 'SizeTieredCompactionStrategy'} AND
        compression={'sstable_compression': 'SnappyCompressor'};
      

      Empty strings are not allowed for keyspace and table identifiers though.

      I guess it's just a case that we haven't covered. Of course making it illegal in a future version would be a breaking change, but nobody serious would manually have chosen such an identifier...

      Attachments

        1. 6136_v2.txt
          2 kB
          David Brosius
        2. 6136_v3.txt
          0.6 kB
          David Brosius
        3. 6136.txt
          1 kB
          David Brosius

        Activity

          People

            dbrosius David Brosius
            mfiguiere Michaël Figuière
            David Brosius
            Sylvain Lebresne
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: