git commit: cqlsh: fix COPY FROM with ReversedType

2013-06-03 Thread aleksey
Updated Branches:
  refs/heads/cassandra-1.2 11eb35291 - 46273c4dd


cqlsh: fix COPY FROM with ReversedType

patch by Aleksey Yeschenko; reviewed by Brandon Williams for
CASSANDRA-5610


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/46273c4d
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/46273c4d
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/46273c4d

Branch: refs/heads/cassandra-1.2
Commit: 46273c4dd4de28e596eb2c1eb272f6da60b06d57
Parents: 11eb352
Author: Aleksey Yeschenko alek...@apache.org
Authored: Tue Jun 4 00:58:31 2013 +0300
Committer: Aleksey Yeschenko alek...@apache.org
Committed: Tue Jun 4 00:58:31 2013 +0300

--
 CHANGES.txt |1 +
 bin/cqlsh   |8 +---
 2 files changed, 6 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/46273c4d/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 6e05a51..09e9119 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -16,6 +16,7 @@
  * have BulkLoader ignore snapshots directories (CASSANDRA-5587) 
  * fix SnitchProperties logging context (CASSANDRA-5602)
  * Expose whether jna is enabled and memory is locked via JMX (CASSANDRA-5508)
+ * cqlsh: fix COPY FROM with ReversedType (CASSANDRA-5610)
 Merged from 1.1:
  * Remove buggy thrift max message length option (CASSANDRA-5529)
  * Fix NPE in Pig's widerow mode (CASSANDRA-5488)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/46273c4d/bin/cqlsh
--
diff --git a/bin/cqlsh b/bin/cqlsh
index 1abd078..dd4c00d 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -32,7 +32,7 @@ exit 1
 from __future__ import with_statement
 
 description = CQL Shell for Apache Cassandra
-version = 3.1.0
+version = 3.1.1
 
 from StringIO import StringIO
 from itertools import groupby
@@ -1681,8 +1681,10 @@ class Shell(cmd.Cmd):
 rowmap = {}
 for name, value in zip(columns, row):
 if value != nullval:
-type = layout.get_column(name).cqltype.cql_parameterized_type()
-if type in ('ascii', 'text', 'timestamp', 'inet'):
+type = layout.get_column(name).cqltype
+if issubclass(type, ReversedType):
+type = type.subtypes[0]
+if type.cql_parameterized_type() in ('ascii', 'text', 
'timestamp', 'inet'):
 rowmap[name] = self.cql_protect_value(value)
 else:
 rowmap[name] = value



[1/2] git commit: cqlsh: fix COPY FROM with ReversedType

2013-06-03 Thread aleksey
Updated Branches:
  refs/heads/trunk 9e8691c26 - ccc87fb30


cqlsh: fix COPY FROM with ReversedType

patch by Aleksey Yeschenko; reviewed by Brandon Williams for
CASSANDRA-5610


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/46273c4d
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/46273c4d
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/46273c4d

Branch: refs/heads/trunk
Commit: 46273c4dd4de28e596eb2c1eb272f6da60b06d57
Parents: 11eb352
Author: Aleksey Yeschenko alek...@apache.org
Authored: Tue Jun 4 00:58:31 2013 +0300
Committer: Aleksey Yeschenko alek...@apache.org
Committed: Tue Jun 4 00:58:31 2013 +0300

--
 CHANGES.txt |1 +
 bin/cqlsh   |8 +---
 2 files changed, 6 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cassandra/blob/46273c4d/CHANGES.txt
--
diff --git a/CHANGES.txt b/CHANGES.txt
index 6e05a51..09e9119 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -16,6 +16,7 @@
  * have BulkLoader ignore snapshots directories (CASSANDRA-5587) 
  * fix SnitchProperties logging context (CASSANDRA-5602)
  * Expose whether jna is enabled and memory is locked via JMX (CASSANDRA-5508)
+ * cqlsh: fix COPY FROM with ReversedType (CASSANDRA-5610)
 Merged from 1.1:
  * Remove buggy thrift max message length option (CASSANDRA-5529)
  * Fix NPE in Pig's widerow mode (CASSANDRA-5488)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/46273c4d/bin/cqlsh
--
diff --git a/bin/cqlsh b/bin/cqlsh
index 1abd078..dd4c00d 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -32,7 +32,7 @@ exit 1
 from __future__ import with_statement
 
 description = CQL Shell for Apache Cassandra
-version = 3.1.0
+version = 3.1.1
 
 from StringIO import StringIO
 from itertools import groupby
@@ -1681,8 +1681,10 @@ class Shell(cmd.Cmd):
 rowmap = {}
 for name, value in zip(columns, row):
 if value != nullval:
-type = layout.get_column(name).cqltype.cql_parameterized_type()
-if type in ('ascii', 'text', 'timestamp', 'inet'):
+type = layout.get_column(name).cqltype
+if issubclass(type, ReversedType):
+type = type.subtypes[0]
+if type.cql_parameterized_type() in ('ascii', 'text', 
'timestamp', 'inet'):
 rowmap[name] = self.cql_protect_value(value)
 else:
 rowmap[name] = value