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

CQLSH -f option should ignore BOM in files

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 2.1.3
    • Legacy/Tools
    • Red Hat linux

    Description

      I fell in byte order mark trap trying to execute a CQL script through CQLSH.

      The file contained the simple (plus BOM)

      CREATE KEYSPACE IF NOT EXISTS xobni WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '3'}  AND durable_writes = true; 
      
      -- and another "CREATE TABLE bucket_flags" query
      

      I executed the script

      [~]$ cqlsh --file /home/selimanolis/Schema/patches/setup.cql 
      /home/selimanolis/Schema/patches/setup.cql:2:Invalid syntax at char 1
      /home/selimanolis/Schema/patches/setup.cql:2:  CREATE KEYSPACE IF NOT EXISTS test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '3'}  AND durable_writes = true; 
      /home/selimanolis/Schema/patches/setup.cql:2:  ^
      /home/selimanolis/Schema/patches/setup.cql:22:ConfigurationException: <ErrorMessage code=2300 [Query invalid because of configuration issue] message="Cannot add column family 'bucket_flags' to non existing keyspace 'test'.">
      

      I realized much later that the file had a BOM which was seemingly screwing with how CQLSH parsed the file.

      It would be nice to have CQLSH ignore the BOM when processing files.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            abhish_gl Abhishek Gupta Assign to me
            s_delima Sotirios Delimanolis
            Abhishek Gupta
            Tom Hobbs
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment