Merge branch 'cassandra-3.0' into cassandra-3.X

This commit is contained in:
Stefania Alborghetti 2016-11-11 11:01:41 +08:00
commit 574ca2e2dd
2 changed files with 8 additions and 4 deletions

View File

@ -147,6 +147,7 @@ Merged from 3.0:
* Correct log message for statistics of offheap memtable flush (CASSANDRA-12776)
* Explicitly set locale for string validation (CASSANDRA-12541,CASSANDRA-12542,CASSANDRA-12543,CASSANDRA-12545)
Merged from 2.2:
* cqlsh COPY: unprotected pk values before converting them if not using prepared statements (CASSANDRA-12863)
* Fix Util.spinAssertEquals (CASSANDRA-12283)
* Fix potential NPE for compactionstats (CASSANDRA-12462)
* Prepare legacy authenticate statement if credentials table initialised after node startup (CASSANDRA-12813)

View File

@ -1836,15 +1836,18 @@ class ImportConversion(object):
where_clause)
return parent.session.prepare(select_query)
@staticmethod
def unprotect(v):
if v is not None:
return CqlRuleSet.dequote_value(v)
def _get_converter(self, cql_type):
"""
Return a function that converts a string into a value the can be passed
into BoundStatement.bind() for the given cql type. See cassandra.cqltypes
for more details.
"""
def unprotect(v):
if v is not None:
return CqlRuleSet.dequote_value(v)
unprotect = self.unprotect
def convert(t, v):
v = unprotect(v)
@ -2095,7 +2098,7 @@ class ImportConversion(object):
return self.cqltypes[n].serialize(v, self.proto_version)
def serialize_value_not_prepared(n, v):
return self.cqltypes[n].serialize(self.converters[n](v), self.proto_version)
return self.cqltypes[n].serialize(self.converters[n](self.unprotect(v)), self.proto_version)
partition_key_indexes = self.partition_key_indexes
serialize = serialize_value_prepared if self.use_prepared_statements else serialize_value_not_prepared