Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B7065175C5 for ; Fri, 10 Oct 2014 21:59:34 +0000 (UTC) Received: (qmail 76818 invoked by uid 500); 10 Oct 2014 21:59:34 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 76736 invoked by uid 500); 10 Oct 2014 21:59:34 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 76541 invoked by uid 99); 10 Oct 2014 21:59:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2014 21:59:34 +0000 Date: Fri, 10 Oct 2014 21:59:34 +0000 (UTC) From: "Tyler Hobbs (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-8101) Invalid ASCII and UTF-8 chars not rejected in CQL string literals MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-8101?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D= 14167608#comment-14167608 ]=20 Tyler Hobbs commented on CASSANDRA-8101: ---------------------------------------- Pull request for netty opened here: https://github.com/netty/netty/pull/299= 9 > Invalid ASCII and UTF-8 chars not rejected in CQL string literals > ----------------------------------------------------------------- > > Key: CASSANDRA-8101 > URL: https://issues.apache.org/jira/browse/CASSANDRA-8101 > Project: Cassandra > Issue Type: Bug > Components: Core > Reporter: Tyler Hobbs > Assignee: Tyler Hobbs > Priority: Critical > Fix For: 2.0.11, 2.1.1 > > Attachments: 8101.txt > > > When processing CQL string literals, we ultimately use {{String.getBytes(= Charset)}}, which has the following note: > {quote} > This method always replaces malformed-input and unmappable-character sequ= ences with this charset's default replacement byte array. The CharsetEncode= r class should be used when more control over the encoding process is requi= red. > {quote} > So, if we insert a non-ASCII character into an ascii string literal, it w= ill be replaced with a {{?}} char. Something similar happens for UTF-8. > For example: > {noformat} > cqlsh:ks1> create table badstrings (a int primary key, b ascii); > cqlsh:ks1> insert into badstrings (a, b) VALUES ( 0, '=CE=8E=CE=94=CE=B4= =CF=A0'); > cqlsh:ks1> select * from badstrings; > a | b > ---+------ > 0 | ???? > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)