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

cqlsh tab completion doesn't work in 2.1

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Low
    • Resolution: Duplicate
    • Fix Version/s: None
    • Component/s: Legacy/CQL
    • Labels:
    • Severity:
      Low

      Description

      cqlsh tab completion doesn't work when there are two tables with the same prefix.
      I found the similar completion issue at CASSANDRA-10733, but my problem is not fixed by the existing issue in 2.1.

      cqlsh> CREATE KEYSPACE sample_ks WITH replication = {'class': 'SimpleStrategy' , 'replication_factor': 1 };
      cqlsh> CREATE TABLE sample_ks.tbl_a ( key text PRIMARY KEY );
      cqlsh> CREATE TABLE sample_ks.tbl_b ( key text PRIMARY KEY, value int );
      
      // works correctly
      cqlsh> INSERT INTO sample_ks.tb<TAB>
      cqlsh> INSERT INTO sample_ks.tbl_
      
      // fix required
      cqlsh> INSERT INTO samp<TAB>
      cqlsh> INSERT INTO sample_ks.tbl_( 
      

      Also, completion doesn't work with a single column table.

      cqlsh> CREATE KEYSPACE sample_ks WITH replication = {'class': 'SimpleStrategy' , 'replication_factor': 1 };
      cqlsh> CREATE TABLE sample_ks.tbl_a ( key text PRIMARY KEY );
      cqlsh> CREATE TABLE sample_ks.tbl_b ( key text PRIMARY KEY, value int );
      
      // fix required (unnecessary comma)
      cqlsh> INSERT INTO sample_ks.tbl_a<TAB>
      cqlsh> INSERT INTO sample_ks.tbl_a (key,
      // fix required (no reaction)
      cqlsh> INSERT INTO sample_ks.tbl_a (key) VALU<TAB>
      cqlsh> INSERT INTO sample_ks.tbl_a (key) VALU
      // fix required (I can't insert only a key.)
      cqlsh> INSERT INTO sample_ks.tbl_b<TAB>
      cqlsh> INSERT INTO sample_ks.tbl_b (key, value
      

      I fixed the completion problem in 2.1 branch. Could someone review the attached patch?

        Attachments

        1. CASSANDRA-11976-2.patch
          1.0 kB
          Yusuke Takata
        2. CASSANDRA-11976-1.patch
          0.7 kB
          Yusuke Takata

          Activity

            People

            • Assignee:
              ytakata Yusuke Takata
              Reporter:
              ytakata Yusuke Takata
              Authors:
              Yusuke Takata
              Reviewers:
              Tom Hobbs
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: