diff --git a/CHANGES.txt b/CHANGES.txt index 7110b84278..211ad8cc1b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -76,6 +76,7 @@ Merged from 2.2: * Make deprecated repair methods backward-compatible with previous notification service (CASSANDRA-11430) * IncomingStreamingConnection version check message wrong (CASSANDRA-11462) Merged from 2.1: + * cqlsh COPY FROM fails with []{} chars in UDT/tuple fields/values (CASSANDRA-11633) * clqsh: COPY FROM throws TypeError with Cython extensions enabled (CASSANDRA-11574) * cqlsh: COPY FROM ignores NULL values in conversion (CASSANDRA-11549) diff --git a/pylib/cqlshlib/copyutil.py b/pylib/cqlshlib/copyutil.py index addbdcec34..36c951ca18 100644 --- a/pylib/cqlshlib/copyutil.py +++ b/pylib/cqlshlib/copyutil.py @@ -1786,15 +1786,16 @@ class ImportConversion(object): level = 0 quote = False for i, c in enumerate(val): - if c == '{' or c == '[' or c == '(': - level += 1 - elif c == '}' or c == ']' or c == ')': - level -= 1 - elif c == '\'': + if c == '\'': quote = not quote - elif c == sep and level == 1 and not quote: - ret.append(val[last:i]) - last = i + 1 + elif not quote: + if c == '{' or c == '[' or c == '(': + level += 1 + elif c == '}' or c == ']' or c == ')': + level -= 1 + elif c == sep and level == 1: + ret.append(val[last:i]) + last = i + 1 else: if last < len(val) - 1: ret.append(val[last:-1])