You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jonathan Ellis (JIRA)" <ji...@apache.org> on 2013/10/14 10:47:46 UTC

[jira] [Comment Edited] (CASSANDRA-6185) Can't update int column to blob type.

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

Jonathan Ellis edited comment on CASSANDRA-6185 at 10/14/13 8:46 AM:
---------------------------------------------------------------------

Let's stick with 2.0 for this since it's new functionality and a bit involved.

Edit: or is this actually a regression?


was (Author: jbellis):
Let's stick with 2.0 for this since it's new functionality and a bit involved.

> Can't update int column to blob type.
> -------------------------------------
>
>                 Key: CASSANDRA-6185
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6185
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Nick Bailey
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>             Fix For: 2.0.2
>
>         Attachments: 6185.txt
>
>
> Patch for dtests:
> {noformat}
> diff --git a/cql_tests.py b/cql_tests.py
> index 11461e4..405c998 100644
> --- a/cql_tests.py
> +++ b/cql_tests.py
> @@ -1547,35 +1547,35 @@ class TestCQL(Tester):
>              CREATE TABLE test (
>                  k text,
>                  c text,
> -                v text,
> +                v int,
>                  PRIMARY KEY (k, c)
>              )
>          """)
> -        req = "INSERT INTO test (k, c, v) VALUES ('%s', '%s', '%s')"
> +        req = "INSERT INTO test (k, c, v) VALUES ('%s', '%s', %d)"
>          # using utf8 character so that we can see the transition to BytesType
> -        cursor.execute(req % ('ɸ', 'ɸ', 'ɸ'))
> +        cursor.execute(req % ('ɸ', 'ɸ', 1))
>          cursor.execute("SELECT * FROM test")
>          cursor.execute("SELECT * FROM test")
>          res = cursor.fetchall()
> -        assert res == [[u'ɸ', u'ɸ', u'ɸ']], res
> +        assert res == [[u'ɸ', u'ɸ', 1]], res
>          cursor.execute("ALTER TABLE test ALTER v TYPE blob")
>          cursor.execute("SELECT * FROM test")
>          res = cursor.fetchall()
>          # the last should not be utf8 but a raw string
> -        assert res == [[u'ɸ', u'ɸ', 'ɸ']], res
> +        assert res == [[u'ɸ', u'ɸ', '\x00\x00\x00\x01']], res
>          cursor.execute("ALTER TABLE test ALTER k TYPE blob")
>          cursor.execute("SELECT * FROM test")
>          res = cursor.fetchall()
> -        assert res == [['ɸ', u'ɸ', 'ɸ']], res
> +        assert res == [['ɸ', u'ɸ', '\x00\x00\x00\x01']], res
>          cursor.execute("ALTER TABLE test ALTER c TYPE blob")
>          cursor.execute("SELECT * FROM test")
>          res = cursor.fetchall()
> -        assert res == [['ɸ', 'ɸ', 'ɸ']], res
> +        assert res == [['ɸ', 'ɸ', '\x00\x00\x00\x01']], res
>      @since('1.2')
>      def composite_row_key_test(self):
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.1#6144)