Merge branch 'cassandra-2.1' into cassandra-2.2

This commit is contained in:
Stefania Alborghetti 2020-04-09 08:56:38 -04:00
commit c8081c2467
3 changed files with 12 additions and 3 deletions

View File

@ -1,5 +1,7 @@
2.2.18
* Disable JMX rebinding (CASSANDRA-15653)
Merged from 2.1:
* Fix parse error in cqlsh COPY FROM and formatting for map of blobs (CASSANDRA-15679)
2.2.17
* Fix Commit log replays when static column clustering keys are collections (CASSANDRA-14365)

View File

@ -52,7 +52,7 @@ from cassandra.util import Date, Time
from cql3handling import CqlRuleSet
from displaying import NO_COLOR_MAP
from formatting import format_value_default, DateTimeFormat, EMPTY, get_formatter
from formatting import format_value_default, DateTimeFormat, EMPTY, get_formatter, BlobType
from sslhandling import ssl_settings
PROFILE_ON = False
@ -1810,7 +1810,7 @@ class ImportConversion(object):
return converters.get(t.typename, convert_unknown)(v, ct=t)
def convert_blob(v, **_):
return bytearray.fromhex(v[2:])
return BlobType(v[2:].decode("hex"))
def convert_text(v, **_):
return v

View File

@ -147,13 +147,20 @@ def formatter_for(typname):
return f
return registrator
class BlobType(object):
def __init__(self, val):
self.val = val
@formatter_for('bytearray')
def __str__(self):
return str(self.val)
@formatter_for('BlobType')
def format_value_blob(val, colormap, **_):
bval = '0x' + binascii.hexlify(val)
return colorme(bval, colormap, 'blob')
formatter_for('bytearray')(format_value_blob)
formatter_for('buffer')(format_value_blob)