cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abhishek Gupta (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CASSANDRA-8638) CQLSH -f option should ignore BOM in files
Date Tue, 20 Jan 2015 05:37:34 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-8638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14282830#comment-14282830
] 

Abhishek Gupta edited comment on CASSANDRA-8638 at 1/20/15 5:36 AM:
--------------------------------------------------------------------

[~s_delima] I am currently trying to analyze a fix for this defect. 
1. how do we reproduce this in real world scenario. How does these BOM characters get introduced.
is it is because of different architectures like intel / sparc? 
2. how may BOM characters do we need to handle, is there a list of characters?
3. do we need to look for these characters at the beginning of file or anywhere in the file?



was (Author: abhish_gl):
[~s_delima] I am currently trying to analyze a fix for this defect. Here are the queries which
will help me understand the defect and identify a correct fix:

1. how do we reproduce this in real world scenario. How does these BOM characters get introduced.
is it is because of different architectures like intel / sparc? 
2. how may BOM characters do we need to handle, is there a list of characters?
3. do we need to look for these characters at the beginning of file or anywhere in the file?

thanks for help. 

> CQLSH -f option should ignore BOM in files
> ------------------------------------------
>
>                 Key: CASSANDRA-8638
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8638
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>         Environment: Red Hat linux
>            Reporter: Sotirios Delimanolis
>            Priority: Trivial
>              Labels: cqlsh, lhf
>             Fix For: 2.1.3
>
>
> I fell in byte order mark trap trying to execute a CQL script through CQLSH. 
> The file contained the simple (plus BOM)
> {noformat}
> CREATE KEYSPACE IF NOT EXISTS xobni WITH replication = {'class': 'SimpleStrategy', 'replication_factor':
'3'}  AND durable_writes = true; 
> -- and another "CREATE TABLE bucket_flags" query
> {noformat}
> I executed the script
> {noformat}
> [~]$ 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'.">
> {noformat}
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message