Details
-
Task
-
Status: Resolved
-
Normal
-
Resolution: Duplicate
-
None
-
None
-
Semantic
-
Low Hanging Fruit
-
All
-
None
-
Description
cqlsh escapes single quotes on complex types but not on text types:
Table: CREATE TABLE test (name text, foo map<text,text>, PRIMARY KEY(name));
Insert:
INSERT INTO test (name, foo) VALUES ( 'jos''emy',{'foo':'josemy''s houñse'});
Query: SELECT * FROM test;
name | foo -----------+----------------------------- jos'emy | {'foo': 'josemy''s houñse'}
This behavior is confusing because simple text fields containing single quotes are not escaped on cqlsh, while complex types (such as collections or UDTs) are escaped. A couple of tickets were created to clarify this behavior: CASSANDRA-10263 and CASSANDRA-15458.
We should probably document this behavior on cqlsh documentation to avoid confusion.
Attachments
Issue Links
- duplicates
-
CASSANDRA-18185 Accumulate all the `docs` PR from GitHub into a single patch
- Resolved
- is related to
-
CASSANDRA-10263 Insert in Cassandra in a collection, values with single quote
- Resolved
-
CASSANDRA-15458 CQL: Unable to escape single quote in a map<int,text> attribute
- Resolved