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 ECF0FE810 for ; Fri, 1 Feb 2013 19:56:15 +0000 (UTC) Received: (qmail 88515 invoked by uid 500); 1 Feb 2013 19:56:14 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 88483 invoked by uid 500); 1 Feb 2013 19:56:14 -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 88407 invoked by uid 99); 1 Feb 2013 19:56:14 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2013 19:56:14 +0000 Date: Fri, 1 Feb 2013 19:56:14 +0000 (UTC) From: "T Jake Luciani (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-5198) Fix CQL3 loose type validation of constants MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-5198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13569019#comment-13569019 ] T Jake Luciani commented on CASSANDRA-5198: ------------------------------------------- This is a breaking change for us or anyone who is using CQL with blobs. Since we no longer accept '' hex but 0x didn't previously work till now, there is no way to upgrade 1.2.x to 1.2.2 due to this change. I suggest you allow both formats for a single release and add a note in NEWS.txt, that way someone can deploy 1.2.2 then update their app to the new syntax > Fix CQL3 loose type validation of constants > -------------------------------------------- > > Key: CASSANDRA-5198 > URL: https://issues.apache.org/jira/browse/CASSANDRA-5198 > Project: Cassandra > Issue Type: Bug > Affects Versions: 1.2.1 > Reporter: Edward Capriolo > Assignee: Sylvain Lebresne > Priority: Minor > Fix For: 1.2.2 > > Attachments: 0001-Respect-CQL3-constant-types.txt, 0002-Improve-printing-of-type-in-error-message.txt, 0003-Respect-partitioner-type-for-Token-function.txt > > > This works as it should. > {noformat} > cqlsh:movies> select * from users where token (username) > token('') ; > username | created_date | email | firstname | lastname | password > -----------+--------------+-------+-----------+----------+---------- > bsmith | null | null | bob | smith | null > scapriolo | null | null | stacey | capriolo | null > ecapriolo | null | null | edward | capriolo | null > cqlsh:movies> select * from users where token (username) > token('bsmith') ; > username | created_date | email | firstname | lastname | password > -----------+--------------+-------+-----------+----------+---------- > scapriolo | null | null | stacey | capriolo | null > ecapriolo | null | null | edward | capriolo | null > cqlsh:movies> select * from users where token (username) > token('scapriolo') ; > username | created_date | email | firstname | lastname | password > -----------+--------------+-------+-----------+----------+---------- > ecapriolo | null | null | edward | capriolo | null > {noformat} > But look what happens when you supply numbers into the token function. > {noformat} > qlsh:movies> select * from users where token (username) > token(0) ; > username | created_date | email | firstname | lastname | password > -----------+--------------+-------+-----------+----------+---------- > ecapriolo | null | null | edward | capriolo | null > cqlsh:movies> select * from users where token (username) > token(1134314) ; > username | created_date | email | firstname | lastname | password > -----------+--------------+-------+-----------+----------+---------- > bsmith | null | null | bob | smith | null > scapriolo | null | null | stacey | capriolo | null > ecapriolo | null | null | edward | capriolo | null > cqlsh:movies> select * from users where token (username) > token(113431431) ; > username | created_date | email | firstname | lastname | password > -----------+--------------+-------+-----------+----------+---------- > scapriolo | null | null | stacey | capriolo | null > ecapriolo | null | null | edward | capriolo | null > cqlsh:movies> select * from users where token (username) > token(1134) ; > username | created_date | email | firstname | lastname | password > -----------+--------------+-------+-----------+----------+---------- > ecapriolo | null | null | edward | capriolo | null > cqlsh:movies> select * from users where token (username) > token(1134434) ; > username | created_date | email | firstname | lastname | password > -----------+--------------+-------+-----------+----------+---------- > scapriolo | null | null | stacey | capriolo | null > {noformat} > This does not make sense to me. The token function is apparently converting integers to strings leading to seemingly unpredictable results. > However I find this syntax odd, I feel like I should be able to say > 'token(username) > 0 and token(username) < 10' because from a thrift side I can page tokens or I can page keys. In this case, I guess, I am only able to page keys because the token is not returned to the user. > Is token 0 = ''? How do I arrive at the minimal token for and int column. > Should the token() function at least be smart enough to reject integers for string columns? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira