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

Don't require quotes for true and false

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Fix Version/s: 1.2.0 beta 2
    • Component/s: None
    • Labels:
    • Environment:

      Mac OS X, Fedora 16

      Description

      The docs at http://cassandra.apache.org/doc/cql3/CQL.html#identifiers describe using double quotes for an identifier that is a reserved word. The following works as expected,

      cqlsh:test> select "columnfamily" from system.schema_columnfamilies;

      I have a table with a boolean column. In order to insert a boolean value, I have to enclose it in single quotes. The table looks like,

      CREATE TABLE bool_test (
      id int PRIMARY KEY,
      val boolean
      );

      Here is what happens when I try using double quotes,

      cqlsh:rhq> insert into bool_test (id, val) values (4, "false");
      Bad Request: line 1:43 no viable alternative at input 'false'

      The use of single quotes here seems inconsistent with what is described in the docs, and makes things a bit confusing. It would be nice if single or double quotes could be used for identifiers that are reserved words. I also think it is a bit counter-intuitive to require quotes for true and false which are literal values.

        Attachments

        1. 4776.txt
          2 kB
          Sylvain Lebresne
        2. 4776-cqlsh.txt
          1 kB
          Aleksey Yeschenko

          Activity

            People

            • Assignee:
              slebresne Sylvain Lebresne
              Reporter:
              jsanda John Sanda
              Reviewer:
              Jonathan Ellis
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: